Installing software in your home directory

From Alliance Doc
Revision as of 16:06, 7 July 2017 by Oldeman (talk | contribs) (added note about setrpaths.sh)
Jump to navigation Jump to search
Other languages:

Most academic software is freely available on the internet. You can email Compute Canada support staff, provide them with a URL, and ask them to install any such package so that you and other users will be able access it via a module load command. If the license terms and technical requirements are met they will make it available, typically in one or two business days.

You are permitted to install software in your own home space or project space if you wish. You might choose to do this, for example,

  • if you plan to make your own modifications to the code, or
  • if you wish to evaluate it on a shorter timescale than "one or two business days".

Read the installation instructions that accompany the software. These instructions often fall into one of the classes described below.

configure; make; make install[edit]

[name@server ~]$ ./configure
[name@server ~]$ make
[name@server ~]$ make install

is a very common instruction pattern. Variations include cmake . replacing ./configure, and sudo make install replacing make install.

Sometimes this will work exactly as prescribed, but sometimes it will fail at make install because the package expects to be able to write to /usr/local or some other shared area in the file system. It will always fail if sudo make install is attempted, because sudo is a request for "root" or administrator privileges. The usual solution is to supply a --prefix flag at the configure step, to direct the installation to go to the directory of your choice, e.g.:

Question.png
[name@server ~]$ ./configure --prefix=/my/project/directory/some-package && make && make install

If other errors arise, contact support. For more information see Make, Autotools, and CMake.

BLAS/LAPACK and MKL[edit]

Many software packages expect the commonly used numerical linear algebra libraries BLAS and LAPACK to be available as -lblas and -llapack which isn't the case on Compute Canada systems, where these libraries are integrated with Intel's Math Kernel Library (MKL). If you are using one of the Intel compilers (e.g. ifort, icc and icpc) then the solution is quite simple, you need only add the flag -mkl=sequential (without internal MKL threading) or -mkl (with threading) to your compiler and linker options in order to ensure that the MKL and thus BLAS/LAPACK are used; see also here. If you are using a non-Intel compiler, for example the Gnu compiler collection, then you will need to explicitly list the necessary MKL libraries during the link phase; Intel provides a tool for building the link syntax which you can use here.

apt-get and yum[edit]

If the software includes instructions to run apt-get or yum, it is unlikely that you will be able to install it using those instructions. Look for instructions that say "to build from source", or contact support for assistance.

Python, R, and Perl packages[edit]

Python, R, and Perl are languages with large libraries of extension packages, and package managers that can easily install almost any desired extension in your home directory. See the page for each language to find out if the package you're looking for is already available on our systems. If it is not, you should also find detailed guidance there on using that language's package manager to install it for yourself.

The Compute Canada software stack[edit]

Almost all software that is used on the new clusters is distributed centrally, using the CVMFS file system. What this means in practise is that this software is not installed under /usr/bin, /usr/include, and so on, as it would be in a Linux distribution, but instead somewhere under /cvmfs/soft.computecanada.ca, and is identical on all new clusters.

The core of this software stack is provided by the nixpkgs/16.09 module, which is loaded by default. This software stack, internally managed using the Nix package manager, is located at /cvmfs/soft.computecanada.ca/nix/var/nix/profiles/16.09. The environment variable $EBROOTNIXPKGS should be used to refer to this path. Under this location you can find all of the common packages typically included with Linux distributions, for instance make, ls, cat, grep, and so on. Typically, when you compile some software, the compiler and linker will automatically look for header files and libraries in the right location (via the environment variables $CPATH and $LIBRARY_PATH, respectively). Some software, however, has been hardcoded to look under /usr. If that is the case, the compilation will typically fail, and needs to be explicitly told about $EBROOTNIXPKGS. Sometimes that means adjusting a Makefile, sometimes it needs to be specified in a certain --with- flag for the configure script, or a configuration file needs to be edited. If you are not sure how to do this please do not hesitate to ask for help.

Similarly, if a package depends on a library that is provided by a module other than nixpkgs, you may need to provide the location of the header files and libraries of that module. The EBROOT convention applies to all modules, e.g. the HDF5 library is installed in $EBROOTHDF5, and its include and lib subdirectories once you module load hdf5.

If a header file or library that would usually be provided by an RPM or other package manager in a typical Linux distributon is neither present via nixpkgs or via another module, please let us know. Most likely it can be easily added to the existing stack.

Notes:

  • all binaries under /cvmfs/soft.computecanada.ca use what is called a RUNPATH, which means that the directories for the runtime libraries that these binaries depend on are put inside the binary. That means it is generally *not* necessary to use $LD_LIBRARY_PATH. In fact, $LD_LIBRARY_PATH overrides this runpath and you should not set that environment variable to locations such as /usr/lib64 or $EBROOTNIXPKGS/lib. Many binaries will no longer work if you attempt this.
  • if you install precompiled binaries in your home directory (for example Miniconda) they may fail using errors such as /lib64/libc.so.6: version `GLIBC_2.18' not found. Often such binaries can be patched using our setrpaths.sh script, using the syntax setrpaths.sh

--path path [--add_origin] where path refers to the directory where you installed that software. This script will make sure that the binaries use the correct interpreter, and search for the libraries they are dynamically linked to in the correct folder. The option --add_origin will also add $ORIGIN to the RUNPATH. This is sometimes helpful if the library cannot find other libraries in the same folder as itself.

  • if all else fails you can use module --force purge to remove the CVMFS environment. You are then left with a bare-bones CentOS-7 installation without modules. This may help for special situations such as compiling GCC yourself or using custom toolchains such as the MESA SDK. Purging modules would then only be necessary when you compile such software; the modules can be reloaded when running it.