Example of a user application installation
This example will show how to install Octave on the hipotetical user username home directory HOME/soft/octave/5.1.0. The example will use the interactive host to install the software but if you can also write a script and submit a job as long the command line instructions could be automatized.
Login on the submit node
Login on the cluster submition node, check the page How to Access for more information:
$ ssh -l <username> hpc7.ncg.ingrid.pt
[username@hpc7 ~]$ _
Download the source code
[username@hpc7 ~]$ wget ftp://ftp.gnu.org/gnu/octave/octave-5.1.0.tar.xz
[username@hpc7 ~]$ tar Jxf octave-5.1.0.tar.xz
[username@hpc7 ~]$ cd octave-5.1.0
Configure and install
[username@hpc7 ~]$ ./configure --prefix=/home/mygroup/username/soft/octave/5.1.0 --enable-shared
[username@hpc7 ~]$ make
[username@hpc7 ~]$ make check
[username@hpc7 ~]$ make install
Setup environment
The most basic would be to configure the appropriate environment variables, or better, create a shell script to load when needed:
[username@hpc7 ~]$ cat .octave.bash
export OCTAVE_HOME=/home/mygroup/username/soft/octave/5.1.0
[ -z "$PATH" ] && export PATH=$OCTAVE_HOME/bin || export PATH=$OCTAVE_HOME/bin:$PATH
[ -z "$CPATH" ] && export PATH=$OCTAVE_HOME/include || export CPATH=$OCTAVE_HOME/include:$CPATH
[ -z "$LD_LIBRARY_PATH" ] && export LD_LIBRARY_PATH=$OCTAVE_HOME/lib || export LD_LIBRARY_PATH=$OCTAVE_HOME/lib:$LD_LIBRARY_PATH
[ -z "$PKG_CONFIG_PATH" ] && export PAG_CONFIG_PATH=$OCTAVE_HOME/lib/pkgconfig || export PKG_CONFIG__PATH=$OCTAVE_HOME/lib/pkgconfig:$PKG_CONFIG_PATH
Activate environment for application
[username@hpc7 ~]$ . .octave.bash
Run the application
[username@hpc7 ~]$ which octave
~/soft/octave/5.1.0/bin/octave
[username@hpc7 ~]$ octave
octave:1> _
Better way to setup environment: USE MODULES
A better way to provide configuration would be using the *module environment tool" customized for the user, check the User Customization With module page. It would be easier to manage and share with other users if needed.