System Preparation

System Preparation

The instructions here should be all you need for installing GCC, OpenMPI and Linux environment modules. Be sure to install it into a non-standard directory, for example /software. Otherwise you can really mess up your system if system-default and user-installed libraries are mixed. To be safe, make sure that you build and install this software as a non-root user. This will cause the installation to fail if it tries to install into system directories.

GCC

More information on building and installing GCC can be found here:
https://gcc.gnu.org/wiki/

The lowest version of GCC that US3D has currently been tested on is GCC-5.2, so you might want to install it as well as the latest GCC 8.x version. Otherwise just match the GCC version for the US3D package that you plan to install.

To build GCC, first download the .tar.gz file from:
http://mirrors-usa.go-parts.com/gcc/releases/gcc-5.2.0/
http://mirrors-usa.go-parts.com/gcc/releases/gcc-8.2.0/

Then run the commands:

tar-xzf gcc-5.2.0.tar.gz && cd gcc-5.2.0
./contrib/download_prerequisites
cd ..
mkdir build && cd build
../configure --prefix=/software/compilers/gcc/5.2.0 \
--enable-languages=c,c++,fortran
make && make install

Note that you should update the command above according to the version of GCC that you are installing.

OpenMPI

To build OpenMPI, first download the latest OpenMPI 3.1 from:
https://www.open-mpi.org/software/ompi/v3.1/

For building OpenMPI, I suggest again installing into a separate directory. I suggest /software as a convenient location. I build with a command like:

tar-xzf gcc-5.2.0.tar.gz && cd gcc-5.2.0
CC=`which gcc`
CXX=`which g++`
FC=`which gfortran`
PARGS="env CC=$CC FC=$FC CXX=$CXX"
ARGS=" --enable-shared --enable-mpi-fortran=usempi"
ARGS+=" --enable-mpi-thread-multiple"
ARGS+=" --prefix=/software/openmpi/3.1.0/gcc/5.2.0"
mkdir -p build && cd build
$PARGS ../configure $ARGS
$PARGS make -j8 && make install

Next, you’ll want to make sure that you set up Environment Modules to help manage your environment.