Skip to content

Instantly share code, notes, and snippets.

@jfhbrook
Created June 12, 2010 00:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfhbrook/435229 to your computer and use it in GitHub Desktop.
Save jfhbrook/435229 to your computer and use it in GitHub Desktop.
A server-side parallel to arsc_remote, so to speak.

#ABOUT: #

After talking with a colleague about some stuff, I came to this realization that the ARSC user experience could use some explaining too. At the same time, I've had my own issues with wanting to run things without having admin priveleges, which I'm not used to. In addition to that, the ARSC workstation setups have their own SNAFUS for us to deal with.

#TODO: #

  • Explain everything better
  • Clean up my .profile
  • Add action to add $SCRATCH/arsc_user to $PATH
  • Put worthwhile things in $SCRATCH/arsc_user
  • Accidentally deleted my toarchive and fromarchive scripts, so I should replace them with something more betters
  • etc, etc

#Getting COMSOL to Work: #

First, open the terminal.

Then, change the permissions of .profile so you can read and write to it:

chmod +rw ~/.profile

Now, edit it:

gedit ~/.profile &

Add something like the following to the end:

export PATH=$PATH:/usr/local/pkg/comsol/comsol-3.5a/bin/

This basically takes the contents of PATH and tacks on the folder that comsol 3.5a's executable is in. In fact, you can tack on as many things to $PATH as you want! More on that later.

Now, save and quit, then type the following into your terminal:

. ~/.profile

This makes your changes register. Now, if you have access to comsol, when you type the following, comsol should pop up!

comsol &

#Using $SCRATCH: #

On the ARSC workstations, your home directory has a size quota of about 512 megabytes--TINY! Instead, you should work on things in $WORKDIR, aka $SCRATCH:

cd $WORKDIR

and save .zip (or .tar or .tgz) archives in $ARCHIVE, kinda like this:

cp $WORKDIR/whatever.zip $ARCHIVE/

Computers you haven't used won't have a $WORKDIR on them for you yet, so you'll have to create it before you use it:

mkdir $WORKDIR

To make this easier, I also tacked the following into my .profile:

#Creates scratch folder if not exist
if [ ! -d $WORKDIR ]
    then
        mkdir $WORKDIR
fi

and that will automatically set you up whenever you log in. I also made shortcuts in home to these two folders:

ln -s $WORKDIR ~/scratch
ln -s $ARCHIVE ~/archive

#Using Modules (Such as MATLAB): #

You can add all of this stuff to your .profile.

First, you need to source some stuff to get modules working right:

. /usr/local/pkg/modules/init/bash

Now, you can load any of the available modules you want. For example, from my .profile:

module load matlab-7.8.0
module load git-1.6.1.3
module load paraview-3.6.1

Note that matlab requires a license file. ARSC asked me not to share this information (that's kinda like piracy right?) so you'll have to ask them how to deal with this.

#Installing Stuff:

Chances are, there's gonna be some software that you wish ARSC had. Because you don't have admin priveleges, you have to do user-level installs. Sometimes this is a pain in the butt!

To start, I created a directory in $SCRATCH called arsc_user, which has its own bin and lib folders, and added the bin folder to my $PATH:

export PATH=$SCRATCH/arsc_user/bin/:$PATH

##bzr: ##

I installed this so that I could pull projects from Launchpad. It turned out to not be very useful.

The biggest issue I had was that, since I was installing it on a user level, it couldn't find bzrlib, which ended up residing in $PREFIX/lib64/python/ . Adding it to $PYTHONPATH didn't seem to work for some reason, so I added it into the bzr executable itself:

sys.path=sys.path+['/scratch/holbrook/arsc_user/lib64/python/']

(after import sys, of course.)

##cmake: ##

ARSC has cmake, but it's an old version. Download the latest from the Cmake peeps and do the following to install:

$ chmod +x bootstrap
$ ./bootstrap --prefix=$SCRATCH/arsc_user
$ make
$ make install

##gmsh: ##

Should be pretty straightforward once deps are in place. You'll need to install at least cmake 1.6, and fltk will be required in order to get graphics. You might not want them though--ymmv. If I remember correctly, while I had installed FLTK, it didn't seem to work with gmsh.

$ mkdir build && cd build
$ cmake -DCMAKE_PREFIX_PATH=$SCRATCH/arsc_user ..
$ make
$ make install

##haskell-platform: ##

First, download the 64-bit version of ghc from here. Use the --prefix and --enable-user-install flags. When I did it with the 32-bit version, I got some pretty gnarly error messages, which made suggestions about getting the gmp libraries. While I do happen to have the gmp libraries installed at this point (I did try it), I think that particular error message was a red herring.

You can test to make sure everything's working by typing the following:

echo 'main = putStr "Hello world!\n"' > test.hs && ghc -o test.bin test.hs

First, make a .cabal folder in $SCRATCH somewhere and make a symbolic link to it in $HOME so that ARSC's disc quotas aren't ran against.

Then, install the Cabal library. Download it from here, and run bootstrap.sh .

The next step is to make it so you can run things in .cabal/bin . Add that shit to your $PATH.

At this point, you SHOULD be able to run cabal:

cabal update

Finally, get the Haskell Platform cabal file from here. cd into it and cabal install!

cabal install

I did have a few issues after this: I needed to install happy and haskell-src on my own (but using cabal, so no problem right?) After this, everything has been great!

There are a bunch of warnings about `Prelude' being deprecated, whenever I install anything, but I think that's an issue with a relatively new ghc version more than anything. g2g!

LaTeX macros:

Symbolic link texmf to $SCRATCH:

ln -s $SCRATCH/texmf ~/texmf

I have my personal texmf bundle on github, which can be cloned using git (you added the git module, right?):

git clone git://github.com/jesusabdullah/texmf.git

Now, you need to get LaTeX to register it if it's not smart:

texhash

Now you can dump stuff from CTAN into texmf/tex/latex/ and go nuts!

mutt:

I installed mutt so that I could send emails from the command line. It actually works with minimal fuss!

./configure --prefix=$ARCHIVE/arsc_user
make
make install

Make install threw a few errors when it tried to install documentation, but it hasn't affected mutt itself.

Numpy:

Numpy (basically) requires lapack and blas in order to compile. Since I had them installed, I specified their locations while configuring (and prefix) like this:

LAPACK=$SCRATCH/arsc_user/lib BLAS=$SCRATCH/arsc_user/lib ./configure --prefix=$SCRATCH/arsc_user

An important note: I didn't pay very much attention while doing this, so these instructions may be inaccurate. If it doesn't work, just play with the options or try checking the configure script's help to get the flags and locations right. Sorry!

pandoc:

Just an example of how easy cabal is to use once the haskell platform is up and rolling:

cabal install pandoc

This also installs markdown2pdf, which you may use to process (for example) this very document!

cpython:

The ARSCputers have python 2.5. I was able to install a working python 2.6.5 and a working python 2.7 with relative ease. However, due to some mysterious missing dev libraries, distutils didn't work properly. While I find the relative age of 2.5 frustrating, most stuff written for python 2-series still works with python 2.5, and the ARSC install has plenty of (albeit stale) libs. I'd recommend sticking with 2.5.

Scipy:

Scipy requires lapack, blas, and some sparse matrix library I couldn't get to install (no config script, lots of deps, cantankerous makefile), but I was able to extract the individual part I needed. I guess you could do the same. Or, figure out how to compile SuiteSparse. Good luck!

##Sun Java JDK: ##

Get the 64-bit version. Running the executable unpacks into a folder. Copy the libs and bins to where you want them.

##Sikuli: ##

Sikuli looks awesome! Unfortunately, I couldn't get it running on any computer, much less the ARSCputers.

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