[MLton-user] Installation of MLton under Cygwin

Stephen Weeks sweeks@sweeks.com
Sat, 13 Apr 2002 11:33:56 -0700


> I'm trying to take advantage of MLton's move to Cygwin. However, it does 
> not run. I get the following:
> 
>  > mlton
> "sread failed (error 0)

My guess is that the sread is when MLton is trying to load in the
preprocessed basis library, found in /usr/local/lib/mlton/world.mlton.
I'm not sure why it would fail, unless the file is corrupted in some
way.  Is yours 4411553 bytes?

> mlton is installed in "/cygdrive/d" ie, "d:\" - which is the root of my 
> filesystem.
> I have changed the "lib" variable in "/cygdrive/d/usr/local/lib/mlton" to be:
> lib='/cygdrive/d/usr/local/lib/mlton'
> 
> Cygwin is installed in "/cygdrive/d/Cygwin" ie, "d:\Cygwin".>

I am curious to know what error message you saw when you had lib set
to /usr/local/lib/mlton (the default).  I would have thought that
you wouldn't need to set lib.

As to the sread problem, can you please send the output of the
following commands (you may need to adjust paths).

% /usr/local/lib/mlton/mlton-compile
This will tell us if the executable is starting OK.  The expected
output is "unhandled exception: Fail usage: exportMLton root file".

% /usr/local/lib/mlton/mlton-compile @MLton load-world /usr/local/lib/mlton/world.mlton --

This will tell us if the basis library is being loaded OK. The
expected output is "mlton: incorrect args from shell script".  But, in
your case, this will probably fail.  If you are able to get an strace,
that would be helpful.

% /usr/local/lib/mlton/mlton-compile @MLton load-world /usr/local/lib/mlton/world.mlton -- /usr/local/lib/mlton gcc END

Assuming the previous step succeeded, this will tell us if the
compiler is running correctly.  The expected output is "must supply a
file".