Child pages
  • Hyak cpp11
Skip to end of metadata
Go to start of metadata

These instructions are for using C++11 on ikt. Using C++11 on mox does not require any special steps.

Replace program.cpp with your C++ file name. The source command below enables g++ 4.8. This is required even for the Intel compiler since the Intel compiler uses the g++ standard library.

For Non-MPI programs:

Intel C++ compiler icpc:

srun -p build --time=2:00:00 --mem=100G --pty /bin/bash

source /opt/rh/devtoolset-2/enable

module load icc_16.0.2

icpc program.cpp -std=c++11

gnu C++ compiler g++ 4.8:

srun -p build --time=2:00:00 --mem=100G --pty /bin/bash

source /opt/rh/devtoolset-2/enable

g++ program.cpp -std=c++11


For MPI programs:

Note that the order of the "source" and the "module load" commands are different for gcc and icc.

Intel C++ compiler icpc + Intel MPI:

srun -p build --time=2:00:00 --mem=100G --pty /bin/bash

source /opt/rh/devtoolset-2/enable

module load icc_16.0.2-impi_5.1.3

icpc program.cpp -std=c++11

gnu C++ compiler g++ 4.8 + Intel MPI:

srun -p build --time=2:00:00 --mem=100G --pty /bin/bash

module load gcc_4.4.7-impi_5.1.2

source /opt/rh/devtoolset-2/enable

g++ program.cpp -std=c++11

Note:

If you are using C++11 all the time, then you could also follow below steps

1) put below lines in your ikt .bashrc

           alias icpc="icpc -std=c++11"

          alias icc="icc -std=c++11"

          alias g++="g++ -std=c++11"

          alias gcc="gcc -std=c++11"

2) logout of all ikt terminals

3) login to ikt and follow above instructions

 

 

 

  • No labels