Skip to content

Compiling with Latest Compilers

pgimwolfe edited this page Jul 7, 2015 · 15 revisions

Using PGI 15.5 and 15.7 on Piz Daint

If you create a file named .mypgirc in your home directory and fill it with the following lines, you will get access to Mat's installed 15.5 and 15.7 compilers, even using Cray's ftn wrapper. Use ftn -VH15.5 to use the PGI 15.5 compiler, and -VH15.7 to use the PGI 15.7 compiler. The later compilers have some new features and bug fixes that may be important.

    switch "-VH15.5" is
            early
            help(Use the 15.5 compiler)
            helpgroup(overall)
            set(COMPBASE=/users/hck28/pgi)
            set(COMPVER=15.5)
            restart($COMPBASE/$COMPSYS/$COMPVER/bin);

    switch "-VH15.7" is
            early
            help(Use the 15.7 compiler)
            helpgroup(overall)
            set(COMPBASE=/users/hck28/pgi)
            set(COMPVER=15.7)
            restart($COMPBASE/$COMPSYS/$COMPVER/bin);

You will also want to add /users/hck28/pgi/linux86-64/15.7/lib to the head of your LD_LIBRARY_PATH, as descrkbed below on this page, perhaps in your .bashrc file.

PGI 15.5 Compiler

Mat Colgrove has made a local installation of PGI 15.5. A makefile for an MPI-capable code is below. The full example can be found at:

Lanczos MPI one- and two-sided communication with PGI 15.5

#
# This benchmark tests the communication portion of the sparse matrix-vector multiplication
# used in the QIS Spin model.
#
#
all:    ed_tfim.exe ed_tfim_mpi2.exe

%.o: %.c
        /users/hck28/pgi/linux86-64/15.5/bin/pgcc -c $< -I/opt/cray/mpt/7.2.2/gni/mpich2-pgi/153/include

ed_tfim.exe: ed_tfim.o
        /users/hck28/pgi/linux86-64/15.5/bin/pgcc -o ed_tfim.exe ed_tfim.o -L/opt/cray/mpt/7.2.2/gni/mpich2/pgi/153/lib -lmpich_pgi -L/apps/daint/lapack/3.4.2/gnu_472 -llapack /apps/daint/blas/2007/gnu_472/blas_LINUX.a -lgfortran

ed_tfim_mpi2.exe: ed_tfim_mpi2.o
        /users/hck28/pgi/linux86-64/15.5/bin/pgcc -o ed_tfim_mpi2.exe ed_tfim_mpi2.o -L/opt/cray/mpt/7.2.2/gni/mpich2-pgi/153/lib -lmpich_pgi -L/apps/daint/lapack/3.4.2/gnu_472 -llapack /apps/daint/blas/2007/gnu_472/blas_LINUX.a -lgfortran

clean:
        rm -f *.o *.exe

Sample Bash RC to use latest PGI

test -s ~/.alias && . ~/.alias || true

export PGI=/users/hck28/pgi/linux86-64/15.5
export PATH=${PGI}/bin:$PATH
export LD_LIBRARY_PATH=${PGI}/lib:$LD_LIBRARY_PATH

#terminal
PS1='\[\e[0;32m\]\u\[\e[m\]@\h \[\e[1;34m\]\w\[\e[m\] \[\e[1;32m\]\$\[\e[m\] \[\e[1;37m\]'
export LANG="en_US.UTF-8"
export LC_COLLATE="en_US.UTF-8"

#editors
export EDITOR=vi