Skip to content

Instantly share code, notes, and snippets.

@tedz2usa
Last active April 8, 2024 13:37
Show Gist options
  • Save tedz2usa/725307535cb4c336941d13e2e5cf86eb to your computer and use it in GitHub Desktop.
Save tedz2usa/725307535cb4c336941d13e2e5cf86eb to your computer and use it in GitHub Desktop.
Installing SML-NJ on Ubuntu 18.04
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!
@shubhamkumar13
Copy link

I am getting the following error : ./install.sh: !!! File config/preloads is missing.
I am using ubuntu 20.04

@ameryisafreeelf
Copy link

Very helpful, appreciate you going step by step!

@GShadow5
Copy link

GShadow5 commented Apr 8, 2024

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment