HPC cluster users rarely have root privileges for installing new software. Default location for installation is usually /usr/bin/, but our user directories are usually located somewhere else like /home/ljcohen/ or /mnt/home/ljcohen/. So, what are you supposed to do when you need to use a new software package? You can contact your cluster sysamins to have them install the package cluster-wide. In general, it’s a good idea to be in contact with them. (Usually they’re nice, helpful, and like to hear from their users to learn more about how you’re using the cluster.) But, sometimes you just want to try something out to see if it’s useful. Here is how.
I wanted to install samstat. (btw, I don’t mean to single out samstat. This is just what I happened to be trying out today. And it was a relatively easy fix!)
The first step is to download the installation file by grabbing the latest version available through the software’s website:
But, notice how this web address is longer than it needs to be. This is because sourceforge.net puts on the extra stuff at the end you don’t need. You could first download this file to your local harddrive then transfer the file onto your cluster account. But, the easiest thing is the wget command and download the file directly into your linux cluster environment.
Right-click on the “Direct Link”, select “Copy Link Address” from the menu, then manually delete everything after the filename:
Create and keep a directory where you will download and install all of your local software. I keep software in .local. Navigate to that directory and download the file. Use this command:
If you follow the installation instructions exactly, you will get a few errors:
By looking at the README file, there are slightly different instructions compared to the website:
After decompressing the .tar.gz file, the next command ./configure results in “self tests run under valgrind” not passing:
I decided to keep going and see what would happen. Running the next command ‘make’ appears fine:
Even ‘make check’ passes all the tests:
The executable file ‘samstat’ is in the appropriate directory. It appears everything is fine:
However, the final command ‘make install’ has a problem:
There is a problem creating a file in /usr/local/bin/samstat with “Permission denied”. This directory does not belong to me, and I don’t have privileges to write there.
From experience, I know that I need to tell the installation process where to install files so it does not try in the default location.
But how do I know this?
When faced with errors, knowing what to use as a Google search string can be a challenge. When I used the exact error “cannot create regular file”, the results were not very helpful. (at least for me)
This is what I used: “make install without root privileges”.
To undo the failed installation attempt, all you have to do is delete the directory with rm -rf. But remember to keep the compressed tar file!
Then start over. Finally, I managed to get it right! Here are the working commands I used:
tar -zxvf samstat-1.5.1.tar.gz cd samstat-1.5.1/ ./configure --prefix=/home/ljcohen/.local make make check make install
And it works!
Don’t forget to add this working directory to your $PATH.
When you get something to work, it feels good. 🙂 While all of your commands are saved in your history. Don’t forget to keep a log of what you’ve done and how to fix it so that your future self can remember when this happens again.