Wiss. Rechnen » C and C++
 

There are two different compilers for C and C++ programs on the cluster: the Gnu Compiler Collection (GCC) and the Intel Compiler.

A good starting point for beginning C developers is the tutorial series at cprogramming.com.

GCC

The GCC compiler is installed in multiple versions. The default system compiler has the version 4.8.5, it is however more practical to use the more recent version 7.3.1 (available with module load gcc). The documentation of that version is here. Additionally, the versions 6.3.0 and 7.3.0 can be reached with module load gcc/6.3.0 and module load gcc/7.3.0, respectively.

In addition to the compiler, GCC also encompasses the Gnu Debugger (gdb) which is installed in the version 7.6.1. The command for the C compiler is gcc, for the C++ compiler it is g++ and for the debugger it is gdb.

$ module load gcc
$ gcc --version
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gdb --version GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7 Copyright (C) 2013 Free Software Foundation, Inc.

Intel compiler

The software suite Intel Cluster Studio is installed on the cluster, the installed version is 18.0.1. The command for calling the compiler is icc for the C compiler and icpc for the C++ compiler. Other installed versions can be listed with module avail intel/compiler.

$ module load intel/compiler $ icc --version icc (ICC) 18.0.1 20171018 Copyright (C) 1985-2017 Intel Corporation. All rights reserved.

In this example the module was loaded without specifying the compiler version. In that case the default setting for this module is used (it is marked with (D) when doing a module avail).

 

Aktualisiert um 12:08 am 14. August 2018 von Jan Philipp Stephan