-- 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 ...

    1# Set dynamic libraries path and path: Intel case
    2source /opt/intel/idb/9.0/bin/idbvars.sh
    3source /opt/intel/mkl/8.0.1/tools/environment/mklvars32.sh
    4source /opt/intel/cc/9.0/bin/iccvars.sh
    5source /opt/intel/fc/9.0/bin/ifortvars.sh
    6
    7# Verify compiler and its version and that it works well
    8which ifort
    9
   10# A simple test
   11cd /usr/local/paquetes/tests
   12ifort conftest.f90 -o conftest.exe
   13conftest.exe
   14
   15# Environment variable for MPICH: gfortran
   16export MPI_HOME="/usr/local/mpich2-ifc/1.0.5"
   17export MPI_INC="-I$MPI_HOME/include"
   18export MPI_LIB="-lc -L$MPI_HOME/lib -lpmpich -lmpich -lmpichf90 -lmpichcxx -lpthread"
   19export MPI_ADDLIBS=
   20
   21# Set dynamic libraries path and path: MPICH2
   22export LD1="/usr/local/lib" ; echo $LD1
   23if [ -z "${LD_LIBRARY_PATH}" ]
   24then
   25  export LD_LIBRARY_PATH="$MPI_HOME/lib"
   26else
   27  export LD_LIBRARY_PATH="$MPI_HOME/lib:$LD_LIBRARY_PATH:$LD1"
   28fi
   29if [ -z "${PATH}" ]
   30then
   31  export PATH="$MPI_HOME/bin:"
   32else
   33  export PATH="$PHOME/bin:$MPI_HOME/bin:$PATH"
   34fi
   35
   36# A control
   37echo $MPI_HOME ; echo $MPI_INC ; echo $MPI_LIB ; echo $MPI_ADDLIBS
   38echo "LD_LIBRARY_PATH = $LD_LIBRARY_PATH"
   39echo "PATH = $PATH"
   40
   41# Another test
   42cd /usr/local/paquetes/tests
   43ifort $MPI_INC $MPI_LIB -o conftest.exe conftest.f90
   44conftest.exe
   45
   46# Install the MPICH2 package with the same F90 compiler that it will be used with adaptor
   47
   48# Set ADAPTOR version, compiler and mpich-version
   49export VER="12.0"; export FIL="adp_12.0.tar.gz" ; echo $VER ; echo $FIL
   50export COM="ifc-105" ; echo $COM
   51
   52# Untar the adaptor source file
   53cd /usr/local ; mkdir adaptor ; cd /usr/local/adaptor ; mkdir $VER
   54cd $VER ; mkdir $COM ; cd $COM ; pwd
   55tar -zxvf /usr/local/paquetes/adaptor_install/$FIL
   56
   57# Propietario y grupo
   58cd ..
   59chown -R root $COM
   60chgrp -R root $COM
   61cd $COM ; pwd
   62
   63# Environment variable for PHOME
   64export PHOME=/usr/local/adaptor/$VER/$COM  ; echo $PHOME
   65
   66# Environment variables for the CC compiler
   67export CC=gcc ; echo $CC
   68export CFLAGS="-w -O" ; echo $CFLAGS
   69
   70# Environment variables for the F77 compiler
   71#
   72# ifort compiler: NOTE taht -Wp MUST BE at first place
   73export F77=ifort ; echo $F77
   74export F77_EXTEND="-extend-source" ; echo $F77_EXTEND 
   75export F77_NOWARN="-w" ; echo $F77_NOWARN
   76export F77_OPT="-Wp,-xP,-O3,-ipo,-vms,-recursive" ; echo $F77_OPT 
   77export F77_FLAGS="-fPIC -I$MPI_HOME/include" ; echo $F77_FLAGS
   78export F77_MP="-auto" ; echo $F77_MP
   79
   80# environment variable for the thread library
   81export THR_LIB=-lpthread ; echo $THR_LIB  
   82
   83# BEFORE to start:
   84#
   85# 1) Set dynamic libraries path and path.  THIS IS A CRITICAL POINT.
   86#
   87# 2) In "configure" file, check "extended LENGTH" (new line 2810)
   88#      ifort   : adds "-extend-source"
   89#
   90# 3) Also check "FREE source format" (new line 2952)
   91#      ifort   : "-free"
   92
   93# System's configuration:
   94#
   95# A configuration must be done as:
   96cd $PHOME ; pwd
   97make distclean
   98make clean
   99find . -name "*.o" | xargs rm -f
  100find . -name "*.log" | xargs rm -f
  101rm -f $PHOME/bin/cadapt
  102rm -f $PHOME/bin/adaptor
  103
  104./configure 2>&1 | tee configure.log
  105cat config.log
  106
  107# Looks in the ".adaptorrc" file the variables:
  108#   a) Libraries for distributed memory message passing:
  109#      DM:mpi = -lc -L/usr/local/mpich2/1.0.3/lib -lmpichf90 -lmpichf90 -lmpich
  110#      DM:mpi = -lc -L/usr/local/mpich2/g95/1.0.3/lib -lmpichf90 -lmpich -lf95 -lm
  111#   b) Fortran compiler:
  112#      FC=ifort -fPIC -I/usr/local/mpich2/1.0.x/include
  113#      FC_FREE=-free
  114#      FC_EXTEND=-extend-source
  115#      FC_EXTEND_LENGTH=132
  116#      FC_OPT=-Wp,-xP,-O3,-ipo,-vms,-recursive
  117#      FC_MP=-auto
  118#      FC_FLAGS=-w
  119#      LD_FLAGS=
  120
  121# PATCH for release 12.0 and IFORT 9.0
  122#
  123# There are problems due to the fact that the configure system is not working well at this time. 
  124# So the  'Makefile' in dalib is not okay and it should replace the assignment to PM_LIBS with:
  125PM_LIBS = $(PM_NULL)
  126#
  127# since ADAPTOR builds some libraries for performance measurement that are not really needed. 
  128# This modification must be performed next to the configuration step.
  129
  130# Make the System's construction
  131cd $PHOME ; pwd
  132make 2>&1 | tee make.log
  133
  134# Traductor's construction
  135cd $PHOME/src ; pwd
  136make clean
  137make 2>&1 | tee make_src.log
  138
  139# Settings
  140$PHOME/bin/adaptor -settings 2>&1 | tee adaptor_settings.log
  141$PHOME/bin/fadapt -settings 2>&1 | tee fadapt_settings.log
  142
  143# Before testing the compiler
  144cd $PHOME
  145chmod 775 -R test_examples
  146chmod 775 -R hpf_examples
  147chgrp -R users test_examples
  148chgrp -R users hpf_examples
  149
  150# in each user enviroment (e.g. .bashrc)
  151export PHOME=/usr/local/adaptor/12.0/ifc-105
  152export PATH=$PATH:$PHOME/bin 
  153export MANPATH=$MANPATH:$PHOME/man
  154
  155# ADAPTOR's bin and man in the PATH
  156export PATH=$PATH:$PHOME/bin ; echo $PATH
  157export MANPATH=$MANPATH:$PHOME/man ; echo $MANPATH
  158
  159# See Sec. 9.2  for testing the compiler
  160
  161#end
  162

Topic revision: r4 - 2014-09-05 - 23:11:42 - MarioStorti
 

TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright � by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback