NSC Compiler wrapper


Level of support

Tier 1 NSC has at least one application expert on staff with knowledge about this software, and we will try to help you with any problems. We have also ran some internal tests to make sure that the program is working as intended. NSC also commits to installing updates to this program as they become available.

Please see the page describing our software support categories for more information.
You can also contact support@nsc.liu.se for further information.

There are two compiler suites supported by NSC on Triolith, Intel and the GNU compiler collection. Other compilers may be installed and made accessible in due course, but support will be restricted to Intel and GNU for the foreseeable future. The two compiler suites are wrapped by NSC to provide some extra compiler flags and environment variables in addition to native compiler options. These extra flags can help users in the compilation and running of codes. Usage of these flags are recommended by NSC. For more details about how to compile please see triolith compiler guide.

Please contact NSC Support if you have any questions or problems.

Loading compiler modules on Triolith

Triolith compilers are available via the modules. Below are few examples of loading compiler modules.

To load intel compilers use:

module load intel/12.1.4

To load gnu compilers use:

module load gcc/4.7.2   

When a compiler module is loaded the NSC wrapped compiler wrapper is available in the PATH.

Extra features of NSC wrapper on Triolith

NSC supported compilers have few additional features through compiler wrapper. These are few additional compiler flags and embedding library paths in binary (rpathing).

Compiler wrapper Flags

The compiler wrapper flags are

  • -Nmpi Adds the appropriate MPI libraries to compile and link MPI codes.
  • -Nmkl Adds the appropriate Intel mkl library paths (but not the library itself).
  • -Nverbose Extra verbosity about compiler wrapper.
  • -Nhelp Display the help information.

The compiler flags can be passed through command line or through the environment variable NSC_COMPILER_FLAG.

Few examples are:

gcc -Nmpi mpicode.c
icc -Nmkl -mkl=serial mklcode.c

Environment variables for compiler wrapper

NSC_COMPILER_FLAG : alternative for command line flags -Nxxx

Example:

export NSC_COMPILER_FLAG="-Nverbose -Nmpi"
icc mpicode.c

NSC_LD_FLAG : controls how the library paths are rpthed in the binary.

  • 0 no rpathing
  • 1 rpath libraries in the /software/ (default)
  • 2 rpath libraries in all folders

Example:

In the following example no rpathing will be done

export NSC_LD_FLAG=0
gcc -Nmpi -L/software/apps/lib1/ -llib1 -L/home/cbasu/lib2 -llib2 test.c

In the following example only the library under /software/apps/lib1 will be rpathed

export NSC_LD_FLAG=1
gcc -Nmpi -L/software/apps/lib1/ -llib1 -L/home/cbasu/lib2 -llib2 test.c 

In the following example both the library path will be rpathed

export NSC_LD_FLAG=2
gcc -Nmpi -L/software/apps/lib1/ -llib1 -L/home/cbasu/lib2 -llib2 test.c