[MLton-user] Apparent bug in PackWord32Big.subVec

Ryan Newton newton at mit.edu
Thu Jun 21 18:42:15 PDT 2007


The following code works in SML/NJ, but generates a type error in MLton.

fun read_int32 vec i =
  Int32.fromLarge(Word32.toLargeInt(PackWord32Big.subVec(vec,0)))

>From the error message, it looks like PackWord32Big.subVec is
returning a Word64.word!

I'm using MLton 20061107, but will happily use the latest sources when
I can get them to build successfully.  I'm very new to mlton (and
sml).  And I'm failing to build rev 5666 on my macbook pro either
using the old powerpc binary or bootstrapping with sml-nj.  Also, if
there are detailed build instructions somewhere, I haven't found them.
 The installation page doesn't describe how to build from source:

http://mlton.org/Installation

And I only got the right svn url by guessing ;).  It seems like it
should be listed on:

http://mlton.org/Download

PackWord16Big

http://osdir.com/ml/lang.ml.mlton.user/2004-11/msg00011.html









  File upgrade-basis.sml does not exist.
"/Users/newton/build/mlton/trunk/bin/upgrade-basis"
'/Users/newton/build/mlton/trunk/build/bin:/Users/newton/build/mlton/trunk/build/bin:/Users/newton/build/mlton/trunk/build/bin:/Users/newton/build/mlton/trunk/bin:/Users/newton/build/mlton/trunk/build/bin:/Users/newton/build/mlton/trunk/bin:/Users/newton/build/mlton/trunk/build/bin:/Users/newton/build/mlton/trunk/bin:/usr/local/bin:/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/Users/newton/bin/Darwin-Universal:/Users/newton/bin/Darwin-Universal/other_ppls:/Users/newton/bin/Darwin-i386:/Users/newton/bin:/Users/newton/bin/scripts:/Users/newton/bin/scripts/minor:/Users/newton/bin/scripts/old:/Users/newton/bin/scripts/other_ppls:/Users/newton/.rrn_scripts:/Users/newton/bin/godi/Darwin-i386/bin:/Users/newton/bin/godi/Darwin-i386/sbin:/Users/newton/bin/Darwin-i386/other_ppls:/Users/newton/streamit:/Users/newton/wavescript/bin:/Users/newton/fiji/flask/bin:/Users/newton/streamit:/Users/newton/fiji/flask/bin:/Users/newton/streamit:/Users/newton/fiji/flask/bin:/Users/newton/build/usr/local/bin'
"x86" "darwin" >upgrade-basis.sml
/usr/bin/ld: warning
/Users/newton/build/usr/local/lib/mlton/self/libmlton.a archive's
cputype (18, architecture ppc) does not match cputype (7) for
specified -arch flag: i386 (can't load from it)
/usr/bin/ld: warning
/Users/newton/build/usr/local/lib/mlton/self/libgdtoa.a archive's
cputype (18, architecture ppc) does not match cputype (7) for
specified -arch flag: i386 (can't load from it)
/usr/bin/ld: Undefined symbols:
_GC_arrayAllocate
_GC_gc
_IntInf_smallMul
_MLton_bug
_MLton_exit
_Posix_Error_getErrno
_Posix_Error_strerror
_Posix_FileSys_ST_isReg
_Posix_FileSys_Stat_atime
_Posix_FileSys_Stat_ctime
_Posix_FileSys_Stat_dev
_Posix_FileSys_Stat_fstat
_Posix_FileSys_Stat_gid
_Posix_FileSys_Stat_ino
_Posix_FileSys_Stat_mode
_Posix_FileSys_Stat_mtime
_Posix_FileSys_Stat_nlink
_Posix_FileSys_Stat_size
_Posix_FileSys_Stat_uid
_Posix_IO_lseek
_Posix_IO_write
_Posix_ProcEnv_isatty
_Stdio_print
_WordS32_quot
_WordS32_rem
_GC_switchToThread
_MLton_init
_sfread
_swrite
collect2: ld returned 1 exit status
call to system failed with exit status 1:
gcc -std=gnu99 -o 719 /tmp/filemctdjQ.o /tmp/filekzwTsb.o
-L/Users/newton/build/usr/local/lib/mlton/self -lmlton -L/sw/lib -lgmp
-lgdtoa -lm
Error: cannot upgrade basis because the compiler doesn't work
make[4]: *** [upgrade-basis.sml] Error 1
make[3]: *** [mlton-compile] Error 2
make[2]: *** [compiler] Error 2
make[1]: *** [all-no-docs] Error 2
make: *** [all] Error 2



More information about the MLton-user mailing list