-
-
Save tedz2usa/725307535cb4c336941d13e2e5cf86eb to your computer and use it in GitHub Desktop.
Installation Tips for SML/NJ on Ubuntu 18.04 | |
Ted Zhu | |
First, follow the steps outlined in the SML/NJ installation instructions for Unix: | |
http://smlnj.org/install/ | |
The final step, | |
$ config/install.sh | |
Should reveal the following errors: | |
Error: | |
mkdir: cannot create directory ‘/usr/local/sml/bin’: Permission denied | |
config/install.sh: !!! Unable to make directory /usr/local/sml/bin! | |
Resolution: | |
Run sudo before the install script: | |
$ sudo config/install.sh | |
______________________________________________________________ | |
Error: | |
/usr/local/sml/config/chk-global-names.sh: 19: /usr/local/sml/config/chk-global-names.sh: cc: not found | |
config/install.sh: !!! Problems checking for underscores in asm names. | |
Resolution: | |
Install compilation tools for Ubuntu (gcc, etc.) | |
$ sudo apt install build-essential | |
______________________________________________________________ | |
Eror: | |
config/install.sh: !!! SML/NJ requires support for 32-bit executables. On Debian Linux, | |
you may need to apt-get install gcc-multilib g++-multilib ia32-libs. On RH Fedora, try: yum install glibc-devel.i686 libgcc.i686 | |
Resolution: | |
Attempt to install all the SML/NJ recommended packages for 32-bit support. | |
$ sudo apt-get install gcc-multilib g++-multilib ia32-libs | |
______________________________________________________________ | |
Error: | |
Package ia32-libs is not available, but is referred to by another package. | |
This may mean that the package is missing, has been obsoleted, or | |
is only available from another source | |
However the following packages replace it: | |
lib32ncurses5 lib32z1 | |
E: Package 'ia32-libs' has no installation candidate | |
Resolution: | |
Install only "gcc-multilib" | |
$ sudo apt-get install gcc-multilib | |
______________________________________________________________ | |
Now the final installation step of SML/NJ should work successfully, on Ubuntu 18.04 (64-bit). | |
$ sudo config/install.sh | |
... | |
... Installation complete. | |
______________________________________________________________ | |
To add the 'sml' executable to PATH, add the following line to ~/.profile: | |
PATH=$PATH:/usr/local/sml/bin | |
Restart your terminal and you should be able to run 'sml'. | |
______________________________________________________________ | |
To enable the arrow keys for history navigation inside the 'sml' interpreter, install and use rlwrap. | |
$ sudo add-apt-repository universe | |
$ sudo apt-get update | |
$ sudo apt install rlwrap | |
Then to run 'sml' with arrow key history navigation: | |
$ rlwrap sml | |
______________________________________________________________ | |
Please leave a comment below if this guide has helped you! | |
thanks, awesome post!.
Thank you - this saved me a lot of time.
Or maybe just https://riptutorial.com/sml/example/23479/installation
sudo apt install smlnj
Since Ubuntu has a package manager!
I get this error running config/install.sh
after installing only gcc-multilib
:
[ ... seemingly normal installer output ...]
echo "v-x86-linux" > v-x86-linux
gcc -ansi -c -O2 -m32 -I../config -I../objs -I../include ../config/gen-common.c
gcc -ansi -O2 -m32 -DHOST_X86 -DTARGET_X86 -DOPSYS_UNIX -DOPSYS_LINUX -D_GNU_SOURCE -DGNU_ASSEMBLER -DDLOPEN -D_FILE_OFFSET_BITS=64 -I../config -I../objs -I../include -o gen-sizes ../config/gen-sizes.c gen-common.o
./gen-sizes
./gen-sizes: 1: ./gen-sizes: Syntax error: word unexpected (expecting ")")
makefile:142: recipe for target 'ml-sizes.h' failed
make[1]: *** [ml-sizes.h] Error 2
make[1]: Leaving directory '/home/leon/cl-apps/smlnj/base/runtime/objs'
mk.x86-linux:30: recipe for target 'all' failed
make: *** [all] Error 2
config/install.sh: !!! Run-time system build failed for some reason.
I'm running WSL.
It seems that I can do this simply by apt running WSL2(Ubuntu 18.04 LTS)
sudo apt install smlnj -y
Thank you very much. The advise is useful and perfect!
Thank you very much!!!
Thanks, it really helped me.
Install only "gcc-multilib"
I also installed lib32z1
along with it.
Here are the pages that were also helpful:
I am getting the following error : ./install.sh: !!! File config/preloads is missing.
I am using ubuntu 20.04
Very helpful, appreciate you going step by step!
@shubhamkumar13 I know I'm late to the party, but I ran into this issue for a moment too. For anyone who also has the issue, the solution is to run the script from outside the config folder.
./config/install.sh
instead of
./install.sh
how to add PATH to ~/.profile
when i want to access ~/.profile i get this message :
bash: /home/ahmad/.profile: Permission denied