When you log in, the GNU prgenv with GCC would be loaded by default, but can be easily changed. For example, to use the Intel Programming Environment or toolchain:
module load prgenv/intel
See HPC2020: Compilers and The prgenv module for more details on how to customise your build environment and toolchains.
Compiler default versions for each family are:
Compiler | Version |
---|---|
GCC | 8.4.1 |
Intel | 2021.4.0 |
AOCC | 3.1.0 |
For MPI, Vendor OpenMPI, intel MPI and HPCX OpenMPI are available. The default version for each family are:
MPI flavour | Version |
---|---|
Atos OpenMPI | 4.1.1.1 |
Intel MPI | 2021.4.0 |
HPCX OpenMPI | 2.9.0 |
Best combination for performance
The recommended toolchain for performance at this stage is:
Currently Loaded Modules: 1) intel/2021.4.0 2) prgenv/intel 3) hpcx-openmpi/2.9.0 4) intel-mkl/19.0.5
Additional dependencies
When building your application, model or little post-processing tool, you may require some additional dependencies or libraries. Before you raise an issue or start building them on your own, please check if they are not already provided either through by default system or via modules with module spider.
If you find them in modules, you can make use of the environment variables defined there to configure your build scripts.
You can see what variables are defined in a module by running:
module show yourdependency
Typically, a module will define the following variables, besides some others that may be needed for each particular package to work:
Variable | When it is defined | Example value |
---|---|---|
PATH | If the package comes with binaries of executables, they will make it into your PATH | /usr/local/apps/netcdf4/4.7.4/GNU/8.3/bin |
MANPATH | If the package has got man pages, they will then be made available | /usr/local/apps/netcdf4/4.7.4/GNU/8.3/share/man |
<PACKAGE>_DIR | Path to the prefix of the installation of this particular package | /usr/local/apps/netcdf4/4.7.4/GNU/8.3 |
<PACKAGE>_VERSION | Version of the package | 4.7.4 |
<PACKAGE>_INCLUDE | If the package contains a library, it defines the flags to be used for preprocessing and finding headers | -I/usr/local/apps/netcdf4/4.7.4/GNU/8.3/include |
<PACKAGE>_LIB | If the package contains a library, it defines the flags to be used at linking time | -L/usr/local/apps/netcdf4/4.7.4/GNU/8.3/lib -Wl,-rpath,/usr/local/apps/netcdf4/4.7.4/GNU/8.3/lib -lnetcdff -lnetcdf_c++ -lnetcdf |
$ module show netcdf4 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ /usr/local/apps/modulefiles/lmod/flavours/gnu/8.3/netcdf4/4.7.4.lua: ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ setenv("netcdf4_DIR","/usr/local/apps/netcdf4/4.7.4/GNU/8.3") setenv("NETCDF4_DIR","/usr/local/apps/netcdf4/4.7.4/GNU/8.3") setenv("netcdf4_VERSION","4.7.4") setenv("NETCDF4_VERSION","4.7.4") family("netcdf") prepend_path("PATH","/usr/local/apps/netcdf4/4.7.4/GNU/8.3/bin") prepend_path("MANPATH","/usr/local/apps/netcdf4/4.7.4/GNU/8.3/share/man") prepend_path("INFOPATH","/usr/local/apps/netcdf4/4.7.4/GNU/8.3/share/info") setenv("NETCDF4_LIB","-L/usr/local/apps/netcdf4/4.7.4/GNU/8.3/lib -Wl,-rpath,/usr/local/apps/netcdf4/4.7.4/GNU/8.3/lib -lnetcdff -lnetcdf_c++ -lnetcdf") setenv("NETCDF4_INCLUDE","-I/usr/local/apps/netcdf4/4.7.4/GNU/8.3/include") whatis("NetCDF (Network Common Data Form) is a set of software libraries and machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data.") help([[NetCDF (Network Common Data Form) is a set of software libraries and machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. It is also a community standard for sharing scientific data. The Unidata Program Center supports and maintains netCDF programming interfaces for C, C++, Java, and Fortran. Programming interfaces are also available for Python, IDL, MATLAB, R, Ruby, and Perl. For more information visit https://www.unidata.ucar.edu/software/netcdf/ ]])
Best practices
- Avoid hardcoding any paths to the dependencies locations in your build or configure scripts. Use the environment variables defined by modules wherever possible instead.
- Always favour using the $
<PACKAGE>_INCLUDE
and $<PACKAGE>_LIB
environment variables to add into your compilation or linking flags. If your build scripts/system does not allow it, then make sure to use $<PACKAGE>_DIR
as the base location. - If defining linking flags manually, do not forget to add the rpath:
-Wl,-rpath,$<PACKAGE>_DIR/lib
so your application works at runtime. Using LD_LIBRARY_PATH is strongly discouraged.