C/C++

The users at CC-IN2P3 may use the different C/C++ compilers.

GNU compilers

GNU developped C/C++ compilers delivered with the Linux system.

  • gcc (via gcc or cc) is the GNU compiler for C.

  • g++ (via g++ or c++) is the GNU compiler available with Linux systems.

To find out the compiler version:

% gcc -v
% cc -v
% g++ -v

Please follow the software loader syntax to list and activate the required compiler version.

To see the compiler options use the man command as in the example below:

% man gcc

PGI compilers

CC-IN2P3 has some number of licences (via FlexLM) for the C/C++ compilers supplied by PGI (Portland group). In order to compile your program, follow the software loader syntax to list and activate the required compiler version.

Please find here the offcial PGI documentation.

  • pgcc is the PGI compiler for C

  • pgc++ is the PGI compiler for C++

  • pgdbg is the debuggers

  • pgprof is the profiler

To see the pgcc and pgc++ compiler options use:

% man pgcc
Compiling syntax example:

% pgcc -O -c test.c

For linking your program with the (CERNLIB), you should add the library libg2c.a which is a part of g77 compiler. The same remark is valid for other libraries compiled with g77 (like the NAG library).

% set g2c = '-lg2c'
% pgcc -O -o test test.c `cernlib` -lpthread -lm ${g2c}
% ./test

Intel compilers

CC-IN2P3 has some number of licences (via FlexLM) for the compilers supplied by INTEL.

This software contains the C/C++ and Fortran compilers with the interactive debug idb and with the libraries:

  • MKL (Math Kernel Library)

  • IPP (Integrated Performance Primitives)

  • Threading Building Blocks for Linux

In order to compile your program, follow the software loader syntax to list and activate the required compiler version. To see the compiler options use:

% man icc
Compiling syntax example:

% icc -O -c test.c

For linking your program with the (CERNLIB), you should add the library libg2c.a which is a part of g77 compiler. The same remark holds for other libraries compiled with g77 (like the NAG library).

% set g2c = '-lg2c'
% icc -O -o test test.c `cernlib` -lpthread -lm ${g2c}
% ./test

Please find here the offical Intel C++ documentation.

NAG Libraries

Please follow the software loader syntax to list and activate the required compiler version.

For a complete documentation, please refer to the provider’s site.