Compilers and libraries on Tegner

This cluster does not use compiler wrappers so you must load the appropriate modules and link to libraries yourself. many versions of the different compilers do exist and the command does differ depending on language and type of compiler.

Examples

Compiling serial code:

# GNUgfortran -o hello hello.fgcc -o hello hello.cg++ -o hello hello.cpp# Intelmodule add i-compilersifort -FR -o hello hello.ficc -o hello hello.cicpc -o hello hello.cpp# Portlandmodule add pgipgf90 -fast -o hello hello.fpgcc -fast -o hello hello.cpgc++ -fast -o hello hello.cpp

Compiling OpenMP/MPI code:

# GNU+OpenMPImodule add gcc/5.1 openmpi/1.8-gcc-5.1mpif90 -FR -fopenmp -o hello_mpi hello_mpi.fmpicc -fopenmp -o hello_mpi hello_mpi.cmpic++ -fopenmp -o hello_mpi hello_mpi.cpp# Intel+IntelMPImodule add i-compilers intelmpimpiifort -openmp -o hello.f90 -o hello_mpimpiicc -openmp -o hello_mpi hello_mpi.cmpiicpc  -openmp -o hello_mpi hello_mpi.cpp# Portlandmodule add pgipgf90 -mp -fast -o hello hello.fpgcc -mp -fast -o hello hello.cpgc++ -mp -fast -o hello hello.cpp

Compiling CUDA code:

# CUDAmodule add cuda/8.0nvcc -arch=sm_37 -O2  hello.cu -o hello.x