[MLton] extending the cml library

Matthew Fluet fluet@cs.cornell.edu
Tue, 1 Feb 2005 18:16:13 -0500 (EST)


> I am extending the cml library in MLton for my research. I would like to 
> use all the mlton libraries in my code, mainly directedgraph.  In the 
> core-cml.mlb I added ../../mlton/sources.mlb, but this clearly is not 
> correct because when I do a make libraries it is complaining the file is 
> not found in build/lib/sml/ etc etc.

Indeed.  When you reference

$(SML_LIB)/cml/cml.mlb

you are referencing the CML Library that got moved from <src>/lib/cml to 
<src>/build/lib/sml/cml.  The latter directory is further moved to 
/usr/local/lib/mlton/sml (or /usr/lib/mlton/sml) for an "offical" release 
package.

So, the point is that when you use the $(SML_LIB) path variable, you will 
always be talking about src/<build> or /usr/local/lib/mlton/sml.

My personal suggestion would be to add something like

MLTON_SRC_LIB /home/fluet/mlton/mlton.cvs.HEAD/lib/mlton

to your .mlton/mlb-path-map file.  Then in your modified CML Library, you 
should reference $(MLTON_SRC_LIB)/sources.mlb.  You might even copy 
<src>/lib/cml to some other location (i.e., outside the mlton source tree) 
and add

NEW_CML_LIB /home/lziarek/research/new-cml

to your .mlton/mlb-path-map.  Then you can reference 
$(NEW_CML_LIB)/cml.mlb and know that you definitely are talking about your 
changes.