CMSC 331 Principles of Programming Languages
CSEE | 331 | Current | Resources

CMSC 331: Principles of Programming Languages

Spring 2003 - Section 0201

Back to Homepage

How to Setup ML in Your UMBC GL Account

These steps will setup your UNIX account such that you will be able to run the sml interpreter from anywhere within your UMBC GL account on either linux[123].gl.umbc.edu or a locally on a lab machine.

  1. These instructions assume that you are using tcsh (Turbo C Shell), the default on GL at UMBC. To verify that you are using the Turbo C shell, you can check the $SHELL environment variable. If you are using the Turbo C Shell you should see the following. If you have changed your shell from tcsh to something else (such as bash, ksh, sh, etc...), I assume that you know how adapt the following directions into the shell of your choice.

    linux1 [1]# echo $SHELL /bin/tcsh linux1 [2]#

     
  2. Now, make sure that you are in your home directory.

    linux1 [2]# cd linux1 [3]# pwd /afs/umbc.edu/users/d/h/dhood2/home linux1 [4]#

     
  3. As it turnsout, tcsh is setup to have ~/bin/ (that is a bin directory within your home directory) in your path by default here on GL at UMBC. Basically whenever you type a command your shell looks here to see if there is a file there with the name of the command you typed, and if so it tries to execute it. So check and see if you have a bin directory in your home directory.

    linux1 [4]# ls bin ls: bin: No such file or directory linux1 [5]#

     
  4. So if you do not have a bin directory in your home directory, meaning that you got the same error message as show in step 3, then you will need to create such a directory. If you already have one, then skip ahead to step 5.

    linux1 [5]# mkdir bin linux1 [6]#

     
  5. Now we are going to create a symbolic link (equivalent to a shortcut in windows) to the SML interpreter. Dr. Nicholas has installed a SML within his account. So let's set up the link, puting it in your personal bin directory.

    linux1 [6]# ln -s ~nicholas/../pub/331/smlnj.linux/bin/sml ~/bin/sml linux1 [7]#

     
  6. Now in order to have tcsh recognize that the link is now in the path, you need to will need to force the shell to look at what all it thinks is in the path again. To do this, we basically re-run the shell's configuration file .cshrc.

    linux1 [7]# source ~/.cshrc linux1 [8]#

     
  7. Okay, now everything should be setup properly. Let's give it a spin, redirecting our program (foobar.sml) into the interpreter.

    linux1 [8]# sml < foobar.sml Standard ML of New Jersey, Version 110.0.7, September 28, 2000 val use = fn : string -> unit - hello world! val it = () : unit linux1 [9]#

     
Last Modified: Monday, 28-Apr-2003 16:59:39 EDT