Page 1 of 1

make problem for 6.4.1 on RHEL5

Posted: Fri Nov 12, 2010 4:14 pm
by tglotch
I'm trying to install abinit 6.4.1 on a Linux box running RHEL5. I put the tar.gz file in /usr/local and unzipped it. I then did a simple ./configure, which worked with no problems. When I tried make, I got the following error message:

make all-recursive
make[1]: Entering directory `/usr/local/abinit-6.4.1'
Making all in prereqs
make[2]: Entering directory `/usr/local/abinit-6.4.1/prereqs'
Making all in linalg
make[3]: Entering directory `/usr/local/abinit-6.4.1/prereqs/linalg'
make -f ../../prereqs/linalg/linalg.mk
make[4]: Entering directory `/usr/local/abinit-6.4.1/prereqs/linalg'
lapack-abinit_6.0 has been uncompressed.
touch configure-stamp
lapack-abinit_6.0 has been configured.
cd blas && make FC="gfortran" FCFLAGS=" -ffixed-form -g -O3 -mtune=native -march=native -funroll-loops -ffast-math" AR="ar" ARFLAGS="rc" RANLIB="ranlib"
make[5]: Entering directory `/usr/local/abinit-6.4.1/prereqs/linalg/blas'
gfortran -ffixed-form -g -O3 -mtune=native -march=native -funroll-loops -ffast-math -c caxpy.f
caxpy.f:0: error: bad value (native) for -march= switch
caxpy.f:0: error: bad value (native) for -mtune= switch
make[5]: *** [caxpy.o] Error 1
make[5]: Leaving directory `/usr/local/abinit-6.4.1/prereqs/linalg/blas'
make[4]: *** [build-stamp] Error 2
make[4]: Leaving directory `/usr/local/abinit-6.4.1/prereqs/linalg'
make[3]: *** [package-ready] Error 2
make[3]: Leaving directory `/usr/local/abinit-6.4.1/prereqs/linalg'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/abinit-6.4.1/prereqs'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/abinit-6.4.1'
make: *** [all] Error 2

I'm using the gnu fortran compiler, installed as gcc-fortran-4.1.2-46.el5_4.2. libgfortran and cpp are installed as the same version. Any help fixing this problem would be greatly appreciated.

Re: make problem for 6.4.1 on RHEL5

Posted: Fri Nov 12, 2010 7:00 pm
by jbeuken
Hello,

I'm using the gnu fortran compiler, installed as gcc-fortran-4.1.2-46.el5_4.2. libgfortran and cpp are installed as the same version.


the gcc 4.1.2 is not any more supported...

the default parameters for compilation are, among others, "-mtune=native -march=native" not recognized by gcc 4.1.2

try to find a rpm for rhe5 for gcc4.3.x, 4.4.x or 4.5.x ( you can try with the rpm for CentOS 5.x more easier to find ( no tested ) )

regards

jmb

Re: make problem for 6.4.1 on RHEL5

Posted: Mon Nov 15, 2010 5:47 pm
by Alain_Jacques
You'll probably face difficulties finding a recent (>4.2) gcc/gfortran "ready-to-use" rpm toolchain for RH5 because a release of a given linux version is heavily linked to the version of the compilers it has been built with. RH5 is a very solid distribution but it comes with antiquated - and buggy - fortran compilers. You cannot replace the gcc/gfortran binaries and their dependencies without either serious hacking or breaking the system.
So you have several options. Intel offers "free to use" versions of its Linux C and Fortran compilers (look at the conditions) accessible in http://software.intel.com/en-us/articles/non-commercial-software-development/. Choose the correct ABI. RH5 is well supported; they install in /opt so you'll have to install as root. Read the doc, "source" the appropriate shell scripts and Abinit configure should be able to find the C (icc) and Fortran (ifort) compilers. If you need MPI libs, you'll have to build a specific version for the new compilers. Other option ... download a gcc toolchain source from http://gcc.gnu.org/gcc-4.5/ and compile a new gcc and gfortran (not such a complicated task but you'll have to build the backing MPC and probably MPFR and GMP libraries as explained in the prerequisites and specify a suitable --prefix). Trick your system by a clever export PATH=newgfortran/bin:$PATH to have the new compilers invoked before the 4.1.2, reconfigure Abinit and now the make should work as advertised. Same story for MPI.

Kind regards,

Alain

Re: make problem for 6.4.1 on RHEL5

Posted: Wed Nov 17, 2010 5:12 pm
by tglotch
Alain,

Thank you for your help. I installed the Intel Linux C and Fortran compilers on my system. They were installed in /opt/intel. I then did a "source /opt/intel/bin/compilervars.sh intel64"

configure ran with no problem, but when I ran make, I got the same error message. Am I missing a step?

Thank you again for your help.

Tim

Re: make problem for 6.4.1 on RHEL5

Posted: Fri Nov 19, 2010 2:42 pm
by Alain_Jacques
Hello Tim,

I'm - slightly - surprised by the name of the file you have to source; on my system it is invoked by a

Code: Select all

source /opt/intel/Compiler/11.1/073/bin/ifortvars.sh intel64
but I assume it may change with compilers versions. Anyway, as long as a

Code: Select all

which icc
and a

Code: Select all

which ifort
return the correct full path names to the compilers, it is fine. Also check with an

Code: Select all

echo $LD_LIBRARY_PATH
that the source has added the path to the Intel libraries. In my case - with an Intel Fortran 11.1.073, it returns
echo $LD_LIBRARY_PATH
/opt/intel/Compiler/11.1/073/lib/intel64:/opt/intel/Compiler/11.1/073/ipp/em64t/sharedlib:/opt/intel/Compiler/11.1/073/mkl/lib/em64t:/opt/intel/Compiler/11.1/073/tbb/intel64/cc4.1.0_libc2.4_kernel2.6.16.21/lib
. Sorry if all this is obvious for you.

Now, start from a clean abinit source. I suggest to untar the distribution package, cd to abinit-xxx and then create a build subdirectory with a

Code: Select all

mkdir tmp-build
. Cd to the tmp-build and create a "local.ac" file to store the configure options (watch, most configure options are written with "-" on the command line but with "_" in the configuration file.

Code: Select all

enable_64bit_flags="yes"
enable_mpi="no"
AR=xiar
CC=icc
FC=ifort
CXX=icpc

do a

Code: Select all

../configure --with-config-file=./local.ac
then - if configure ran fine a

Code: Select all

make && cd tests && make tests_acc
. Check the tests results with

Code: Select all

more */*/report

Clean the build stuff between attempts with a

Code: Select all

make clean
or delete the whole tmp-build directory.
For production, I compile an optimized and static binary with the following local.ac file ...

Code: Select all

enable_64bit_flags="yes"
enable_mpi="no"
enable_debug="no"
enable_fft="yes"
with_fft_flavor="fftw3-mkl"
enable_linalg="yes"
with_linalg_flavor="mkl"
with_linalg_libs="-L/opt/intel/Compiler/11.1/073/mkl/lib/em64t -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread"
enable_gw_dpc="no"
AR=xiar
CC=icc
FC=ifort
CXX=icpc
CFLAGS="-xHOST -O3 -fp-model precise -funroll-loops -static"
CXXFLAGS="-xHOST -O3 -fp-model precise -funroll-loops -static"
FCFLAGS="-xHOST -O3 -fp-model precise -funroll-loops -static"
FC_LDFLAGS_EXTRA="-static"


Does it work for you?

Alain