Re: Problems porting from old Compilation Manager
Colin Fleming <[email protected]> Fri, 27 Nov 2009 14:43:12 +0100
| Newsgroups | gmane.comp.lang.sml.smlnj |
|---|---|
| Message-ID | <[email protected]> |
Hi Joe, Thanks for the reply. Yes, both Version and PackageManager are part of MLj. I couldn't find a .cm file that looked likely anywhere, either in the binary or source distributions. I'll have to read up about the CM and see if I can figure it out. Thanks, Colin 2009/11/27 Joe Wells <[email protected]>: > Colin Fleming <[email protected]> writes: > >> Hi all, >> >> I'm trying to compile MLj, the SML to JVM compiler. The project is >> pretty well abandoned, and they recommend compiling it with a very old >> version of SML/NJ (110.0.7) which I couldn't get to compile on OSX. >> That version uses the old CM, so when I try to compile with the most >> recent version, it fails. The culprit seems to be the build.sml file: >> >> val path =3D >> =A0 case OS.Process.getEnv "BOOTCLASSPATH" of >> =A0 =A0 NONE =3D> >> =A0 =A0 (print >> =A0 "\nSet BOOTCLASSPATH to the zip or jar file containing system classe= s\n"; >> =A0 =A0 =A0OS.Process.exit OS.Process.failure) >> >> =A0 | SOME path =3D> path; >> >> val version_id =3D #version_id Compiler.version; >> val newer =3D hd version_id > 110 orelse hd (tl version_id) > 0; >> if newer then CM.set_root "sources2.cm" else (); >> OS.FileSys.chDir "src"; >> CM.make (); >> Version.compileTime :=3D Date.toString (Date.fromTimeLocal (Time.now ())= ); >> SMLofNJ.Internals.GC.messages false; >> >> PackageManager.setBootClassPath (Path.pathToList path); >> >> if Make.makeAndFreezeBasis (true, "build.log") >> then SMLofNJ.exportFn ("../bin/mlj-jdk1.1.1", TopLevel.main) >> else (print "\nFailed to build basis\n"; OS.Process.exit OS.Process.fail= ure); >> >> I managed to make some progress by commenting the CM.set_root line and >> adjusting the CM.make command to 'CM.make "sources2.cm"', but then the >> subsequent lines fail because it can't find Version or PackageManager. > > PackageManager is probably part of MLj. =A0I don't know about Version. > >> Did something change with the visibility of compiled structures in the >> switch to the new CM? Can I explicitly import those structures somehow >> in the new one? > > If you can find them in one of the installed binary .cm files, then > you can import them. =A0For example, picking an internal function purely > at random, here is how you would get access to PickleUtil.pickle: > > =A0Standard ML of New Jersey v110.70 [built: Thu Aug 27 23:53:55 2009] > =A0- PickleUtil.pickle; > =A0stdIn:1.1-1.18 Error: unbound structure: PickleUtil in path PickleUtil= .pickle > =A0- CM.autoload "$/pickle-lib.cm"; > =A0[autoloading] > =A0[library $smlnj/cm/cm.cm is stable] > =A0[library $smlnj/internal/cm-sig-lib.cm is stable] > =A0[library $/pgraph.cm is stable] > =A0[library $smlnj/internal/srcpath-lib.cm is stable] > =A0[library $SMLNJ-BASIS/basis.cm is stable] > =A0[autoloading done] > =A0[library $/pickle-lib.cm is stable] > =A0val it =3D true : bool > =A0- PickleUtil.pickle; > =A0[autoloading] > =A0[library $SMLNJ-LIB/Util/smlnj-lib.cm is stable] > =A0[autoloading done] > =A0val it =3D fn : 'a -> 'a PickleUtil.pickle -> string > > I hope this is helpful. > > -- > With my best regards, > > Joe > >> Apologies if the question is very basic, I'm very new to SML. >> >> Thanks for any help, >> Colin >> > > > -- > Heriot-Watt University is a Scottish charity > registered under charity number SC000278. > > ---------------------------------------------------------------------------= --- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day = trial. Simplify your report design, integration and deployment - and focus = on = what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july