Computational Research Center
Skip navigation

Shale User Paths

[ Shale User Instructions | Shale Submission Scripts | Shale User Paths ]

.bash_profile Document Setup

To setup your environment/compiler variables of your Shale user account to compile for MPI, edit your ".bash_profile" document located in your user home directory. You can use either vi, vim, or emacs to edit this file.

Environment/Compiler/PATH Variables

First add the additional lines to your PATH enviornment variable to include the standard libraries and APIs for compiling.

PATH=$PATH:/usr/include:/usr/lib
PATH=$PATH:/usr/local/include:/usr/local/lib
export PATH

GCC Compiler Variables

To setup the compiler variables for a GCC compile of an MPI program, add the following lines of to ".bash_profile".

For the C language set the CC environment variable.

CC=/usr/bin/gcc44
export CC

For the C++ language set the CXX environment variable.

CXX=/usr/bin/g++
export CXX

For the C language parallel compiler set the MPICC environment variable.

MPICC=/usr/local/bin/mpicc
export MPICC

For the C++ language parallel compiler set the MPIXX environment variable.

MPICXX=/usr/local/bin/mpicxx
export MPICXX

PGI Compiler Variables

Alternatively, your environment/compiler variables can be setup to use the PGI compiler to build MPI applications. First you to add the standard PGI includes and libraries to your path.

PATH=$PATH:/opt/pgi/linux86-64/7.1/lib:/opt/pgi/linux86-64/7.1/include
export PATH

Then you will need to set the compiler variables for PGI.

CC=/opt/pgi/linux86-64/7.1/bin/pgcc
export CC
CXX=/opt/pgi/linux86-64/7.1/bin/pgCC
export CXX

MPICC=/opt/pgi/linux86-64/7.1/mpi/mpich/bin/mpicc
export MPICC
MPICXX=/opt/pgi/linux86-64/7.1/mpi/mpich/bin/mpicxx
export MPICXX

CUDA Programs

The CUDA compiler is only available on the following nodes: node24, node25, node26, node27. Instructions on accessing these nodes are available on the Shale User Instructions page. However, you will still need to add the following to your environment variables.

NVCC=/usr/local/cuda/bin/nvcc
export NVCC

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
export LD_LIBRARY_PATH

Set Up Your Alias Commands

Now that you have your environment/compiler variables setup, add your compiler aliases to your ".bash_profile" document.

alias cc=$CC
alias cxx=$CXX
alias mpicc=$MPICC
alias mpixx=$MPICXX     <----- notice that there is no 'c' character in the alias.
alias nvcc=$NVCC

Once you are done editing the ".bash_profile" document, save it. Then logout, and then login once more. You should be ready to compile.