--
LauraBattaglia - 29 Sep 2006
ADAPTOR version 12.0. Installation with gcc and ifort
Primero instalar y compilar el MPICH (o el MPI), incluyendo f77 y f90 con el mismo compilador que luego se va a usar en las aplicaciones. Luego, sigue lo siguiente ...
%CODE{ lang="bash" num="1" }%
# Set dynamic libraries path and path: Intel case
source /opt/intel/idb/9.0/bin/idbvars.sh
source /opt/intel/mkl/8.0.1/tools/environment/mklvars32.sh
source /opt/intel/cc/9.0/bin/iccvars.sh
source /opt/intel/fc/9.0/bin/ifortvars.sh
# Verify compiler and its version and that it works well
which ifort
# A simple test
cd /usr/local/paquetes/tests
ifort conftest.f90 -o conftest.exe
conftest.exe
# Environment variable for MPICH: gfortran
export MPI_HOME="/usr/local/mpich2-ifc/1.0.5"
export MPI_INC="-I$MPI_HOME/include"
export MPI_LIB="-lc -L$MPI_HOME/lib -lpmpich -lmpich -lmpichf90 -lmpichcxx -lpthread"
export MPI_ADDLIBS=
# Set dynamic libraries path and path: MPICH2
export LD1="/usr/local/lib" ; echo $LD1
if [ -z "${LD_LIBRARY_PATH}" ]
then
export LD_LIBRARY_PATH="$MPI_HOME/lib"
else
export LD_LIBRARY_PATH="$MPI_HOME/lib:$LD_LIBRARY_PATH:$LD1"
fi
if [ -z "${PATH}" ]
then
export PATH="$MPI_HOME/bin:"
else
export PATH="$PHOME/bin:$MPI_HOME/bin:$PATH"
fi
# A control
echo $MPI_HOME ; echo $MPI_INC ; echo $MPI_LIB ; echo $MPI_ADDLIBS
echo "LD_LIBRARY_PATH = $LD_LIBRARY_PATH"
echo "PATH = $PATH"
# Another test
cd /usr/local/paquetes/tests
ifort $MPI_INC $MPI_LIB -o conftest.exe conftest.f90
conftest.exe
# Install the MPICH2 package with the same F90 compiler that it will be used with adaptor
# Set ADAPTOR version, compiler and mpich-version
export VER="12.0"; export FIL="adp_12.0.tar.gz" ; echo $VER ; echo $FIL
export COM="ifc-105" ; echo $COM
# Untar the adaptor source file
cd /usr/local ; mkdir adaptor ; cd /usr/local/adaptor ; mkdir $VER
cd $VER ; mkdir $COM ; cd $COM ; pwd
tar -zxvf /usr/local/paquetes/adaptor_install/$FIL
# Propietario y grupo
cd ..
chown -R root $COM
chgrp -R root $COM
cd $COM ; pwd
# Environment variable for PHOME
export PHOME=/usr/local/adaptor/$VER/$COM ; echo $PHOME
# Environment variables for the CC compiler
export CC=gcc ; echo $CC
export CFLAGS="-w -O" ; echo $CFLAGS
# Environment variables for the F77 compiler
#
# ifort compiler: NOTE taht -Wp MUST BE at first place
export F77=ifort ; echo $F77
export F77_EXTEND="-extend-source" ; echo $F77_EXTEND
export F77_NOWARN="-w" ; echo $F77_NOWARN
export F77_OPT="-Wp,-xP,-O3,-ipo,-vms,-recursive" ; echo $F77_OPT
export F77_FLAGS="-fPIC -I$MPI_HOME/include" ; echo $F77_FLAGS
export F77_MP="-auto" ; echo $F77_MP
# environment variable for the thread library
export THR_LIB=-lpthread ; echo $THR_LIB
# BEFORE to start:
#
# 1) Set dynamic libraries path and path. THIS IS A CRITICAL POINT.
#
# 2) In "configure" file, check "extended LENGTH" (new line 2810)
# ifort : adds "-extend-source"
#
# 3) Also check "FREE source format" (new line 2952)
# ifort : "-free"
# System's configuration:
#
# A configuration must be done as:
cd $PHOME ; pwd
make distclean
make clean
find . -name "*.o" | xargs rm -f
find . -name "*.log" | xargs rm -f
rm -f $PHOME/bin/cadapt
rm -f $PHOME/bin/adaptor
./configure 2>&1 | tee configure.log
cat config.log
# Looks in the ".adaptorrc" file the variables:
# a) Libraries for distributed memory message passing:
# DM:mpi = -lc -L/usr/local/mpich2/1.0.3/lib -lmpichf90 -lmpichf90 -lmpich
# DM:mpi = -lc -L/usr/local/mpich2/g95/1.0.3/lib -lmpichf90 -lmpich -lf95 -lm
# b) Fortran compiler:
# FC=ifort -fPIC -I/usr/local/mpich2/1.0.x/include
# FC_FREE=-free
# FC_EXTEND=-extend-source
# FC_EXTEND_LENGTH=132
# FC_OPT=-Wp,-xP,-O3,-ipo,-vms,-recursive
# FC_MP=-auto
# FC_FLAGS=-w
# LD_FLAGS=
# PATCH for release 12.0 and IFORT 9.0
#
# There are problems due to the fact that the configure system is not working well at this time.
# So the 'Makefile' in dalib is not okay and it should replace the assignment to PM_LIBS with:
PM_LIBS = $(PM_NULL)
#
# since ADAPTOR builds some libraries for performance measurement that are not really needed.
# This modification must be performed next to the configuration step.
# Make the System's construction
cd $PHOME ; pwd
make 2>&1 | tee make.log
# Traductor's construction
cd $PHOME/src ; pwd
make clean
make 2>&1 | tee make_src.log
# Settings
$PHOME/bin/adaptor -settings 2>&1 | tee adaptor_settings.log
$PHOME/bin/fadapt -settings 2>&1 | tee fadapt_settings.log
# Before testing the compiler
cd $PHOME
chmod 775 -R test_examples
chmod 775 -R hpf_examples
chgrp -R users test_examples
chgrp -R users hpf_examples
# in each user enviroment (e.g. .bashrc)
export PHOME=/usr/local/adaptor/12.0/ifc-105
export PATH=$PATH:$PHOME/bin
export MANPATH=$MANPATH:$PHOME/man
# ADAPTOR's bin and man in the PATH
export PATH=$PATH:$PHOME/bin ; echo $PATH
export MANPATH=$MANPATH:$PHOME/man ; echo $MANPATH
# See Sec. 9.2 for testing the compiler
#end
%ENDCODE%