Installing software in your home directory: Difference between revisions

Marked this version for translation
No edit summary
(Marked this version for translation)
Line 25: Line 25:
If other errors arise, contact [mailto:support@computecanada.ca support]. For more information see [[Make]], [[Autotools]], and [[CMake]].
If other errors arise, contact [mailto:support@computecanada.ca support]. For more information see [[Make]], [[Autotools]], and [[CMake]].


== BLAS/LAPACK and MKL ==
== BLAS/LAPACK and MKL == <!--T:10-->
Many software packages expect the commonly used numerical linear algebra libraries BLAS and LAPACK to be available as <tt>-lblas</tt> and <tt>-llapack</tt> which isn't the case on Compute Canada systems, where these libraries are integrated with Intel's [https://software.intel.com/en-us/mkl 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 <tt>-mkl=sequential</tt> (without internal MKL threading) or <tt>-mkl</tt> (with threading) to your compiler and linker options in order to ensure that the MKL and thus BLAS/LAPACK are used; see also [https://software.intel.com/en-us/mkl-linux-developer-guide-using-the-mkl-compiler-option 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 [https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor here].
Many software packages expect the commonly used numerical linear algebra libraries BLAS and LAPACK to be available as <tt>-lblas</tt> and <tt>-llapack</tt> which isn't the case on Compute Canada systems, where these libraries are integrated with Intel's [https://software.intel.com/en-us/mkl 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 <tt>-mkl=sequential</tt> (without internal MKL threading) or <tt>-mkl</tt> (with threading) to your compiler and linker options in order to ensure that the MKL and thus BLAS/LAPACK are used; see also [https://software.intel.com/en-us/mkl-linux-developer-guide-using-the-mkl-compiler-option 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 [https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor here].


Line 37: Line 37:
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 <code>/usr/bin</code>, <code>/usr/include</code>, and so on, as it would be in a Linux distribution, but instead somewhere under <code>/cvmfs/soft.computecanada.ca</code>, and is identical on all new clusters.
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 <code>/usr/bin</code>, <code>/usr/include</code>, and so on, as it would be in a Linux distribution, but instead somewhere under <code>/cvmfs/soft.computecanada.ca</code>, and is identical on all new clusters.


<!--T:11-->
The core of this software stack is provided by the <code>nixpkgs/16.09</code> module, which is loaded by default. This software stack, internally managed using the Nix package manager, is located at <code>/cvmfs/soft.computecanada.ca/nix/var/nix/profiles/16.09</code>. The environment variable <code>$EBROOTNIXPKGS</code> should be used to refer to this path.
The core of this software stack is provided by the <code>nixpkgs/16.09</code> module, which is loaded by default. This software stack, internally managed using the Nix package manager, is located at <code>/cvmfs/soft.computecanada.ca/nix/var/nix/profiles/16.09</code>. The environment variable <code>$EBROOTNIXPKGS</code> 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 <code>make</code>, <code>ls</code>, <code>cat</code>, <code>grep</code>, 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 <code>$CPATH</code> and <code>$LIBRARY_PATH</code>, respectively).
Under this location you can find all of the common packages typically included with Linux distributions, for instance <code>make</code>, <code>ls</code>, <code>cat</code>, <code>grep</code>, 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 <code>$CPATH</code> and <code>$LIBRARY_PATH</code>, respectively).
Some software, however, has been hardcoded to look under <code>/usr</code>. If that is the case, the compilation will typically fail, and needs to be explicitly told about <code>$EBROOTNIXPKGS</code>. Sometimes that means adjusting a Makefile, sometimes it needs to be specified in a certain <code>--with-</code> 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.
Some software, however, has been hardcoded to look under <code>/usr</code>. If that is the case, the compilation will typically fail, and needs to be explicitly told about <code>$EBROOTNIXPKGS</code>. Sometimes that means adjusting a Makefile, sometimes it needs to be specified in a certain <code>--with-</code> 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.


<!--T:12-->
Similarly, if a package depends on a library that is provided by a module other than <code>nixpkgs</code>, 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 <code>$EBROOTHDF5</code>, and its <code>include</code> and <code>lib</code> subdirectories once you <code>module load hdf5</code>.
Similarly, if a package depends on a library that is provided by a module other than <code>nixpkgs</code>, 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 <code>$EBROOTHDF5</code>, and its <code>include</code> and <code>lib</code> subdirectories once you <code>module load hdf5</code>.


<!--T:13-->
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 <code>nixpkgs</code> or via another module, please let us know. Most likely it can be easily added to the existing stack.
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 <code>nixpkgs</code> or via another module, please let us know. Most likely it can be easily added to the existing stack.


<!--T:14-->
Notes:
Notes:
* all binaries under <code>/cvmfs/soft.computecanada.ca</code> 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 <code>$LD_LIBRARY_PATH</code>. In fact, <code>$LD_LIBRARY_PATH</code> overrides this runpath and you should '''not''' set that environment variable to locations such as <code>/usr/lib64</code> or <code>$EBROOTNIXPKGS/lib</code>. Many binaries will no longer work if you attempt this.
* all binaries under <code>/cvmfs/soft.computecanada.ca</code> 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 <code>$LD_LIBRARY_PATH</code>. In fact, <code>$LD_LIBRARY_PATH</code> overrides this runpath and you should '''not''' set that environment variable to locations such as <code>/usr/lib64</code> or <code>$EBROOTNIXPKGS/lib</code>. Many binaries will no longer work if you attempt this.
Bureaucrats, cc_docs_admin, cc_staff
2,306

edits