compiling with ifort compiler

Discussion about building and installing Elmer
Post Reply
Termo
Posts: 33
Joined: 19 Jul 2011, 11:10
Antispam: Yes

compiling with ifort compiler

Post by Termo »

When I try to compile the fem module with the intel fortran compiler, it fails with:

Code: Select all

CRSMatrix.f90(1134): error #8378: Pointer array is not contiguous unless it is declared CONTIGUOUS.   [ROWS]
     Rows   => A % Rows
-------------------^
CRSMatrix.f90(1134): error #8371: If pointer is declared CONTIGUOUS, target must be contiguous as well.   [ROWS]
     Rows   => A % Rows
-------------------^
I can compile just fine the normal gfortran (I'm running Ubuntu 11.04 64bit)

I can see that the makefile has changed 4 lines from CRSMatrix.src to CRSMatrix.f90 inserting CONTIGUOUS when defining some variables. If I revert this change back in the generated CRSMatrix.f90 file, it will continue compiling....

Why is this CONTIGUOUS inserted in these lines?
tzwinger
Site Admin
Posts: 100
Joined: 24 Aug 2009, 12:20
Antispam: Yes

Re: compiling with ifort compiler

Post by tzwinger »

Hello,
sorry, that this comes with such a vast delay. Nevertheless, I thought it might be good to share this script that has been written by my colleague Olli-Pekka Lehto as the problem you described persisted and has a workaround in the attached script. This is a compilation script that worked for us on a 64-bit RHEL based Sandy-Bridge Intel system (please change the paths):

Code: Select all

#!/bin/sh -f
# Compile Elmer modules and install it
#

# replace these with your compilers:
export CC=mpicc
export CXX=mpiCC
export FC=mpif90
export F77=mpif90
export BLAS_LIBS="-mkl=sequential"
export LAPACK_LIBS="-mkl=sequential"
# next lines include Hypre and MUMPS (they have to be compiled in advance using MKL)
# just comment those, if you do not want to have them included
export HYPRE=/opt/hypre/2.0.0/intel/openmpi/
export MUMPS=/opt/mumps/4.9.2-mkl-openmpi/
export CPPFLAGS="-I$HYPRE/include"
export FCPPFLAGS="$FCPPFLAGS -DHAVE_MUMPS"
#
export CFLAGS="-fPIC $OPTFLAGS"
export CXXFLAGS="-fPIC $OPTFLAGS"
export FFLAGS="-fPIC $OPTFLAGS" 
export FCFLAGS="-I$MUMPS/include -fPIC $OPTFLAGS"
export OPTFLAGS="-xAVX -O3 -fPIC" 
export LDFLAGS="-fPIC $OPTFLAGS -L$MUMPS/lib -lpord -ldmumps -lmumps_common -L/opt/intel/composer_xe_2011_sp1.7.256/mkl/lib/intel64 -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lmkl_blacs_openmpi_lp64 -lpthread"
modules="matc umfpack mathlibs meshgen2d eio hutiter fem elmergrid"
for m in $modules; do
cd $m
make distclean
CFLAGS="-fPIC $OPTFLAGS"
CXXFLAGS="-fPIC $OPTFLAGS"
FFLAGS="-fPIC $OPTFLAGS"
FCFLAGS="-I$MUMPS/include -fPIC $OPTFLAGS"
./configure --with-64bits=yes --with-mpi=yes --with-mpi-dir=/opt/openmpi-intel/ --prefix=/op/ElmerRev5731 --with-hypre="-L$HYPRE/lib -lHYPRE" 
if [ "$m"='fem' ]; then
ln -sf ../binio src/modules/binio
for mf in `find -name Makefile`; do
sed -i -e 's/,CONTIGUOUS//g' $mf
sed -i -e 's@lutil"@lutil@g' $mf
done
fi
make -j4
make install
cd ..
done
echo "DONE"
Best regards,

Thomas
Post Reply