Fortran could not compile .f90 files during 'make'  [SOLVED]

option, parallelism,...

Moderators: fgoudreault, mcote

Forum rules
Please have a look at ~abinit/doc/config/build-config.ac in the source package for detailed and up-to-date information about the configuration of Abinit 8 builds.
For a video explanation on how to build Abinit 7.x for Linux, please go to: http://www.youtube.com/watch?v=DppLQ-KQA68.
IMPORTANT: when an answer solves your problem, please check the little green V-like button on its upper-right corner to accept it.
Locked
kaelynf
Posts: 3
Joined: Fri Oct 06, 2017 12:24 am

Fortran could not compile .f90 files during 'make'

Post by kaelynf » Fri Oct 06, 2017 12:43 am

Hi all,

I am attempting to install the latest version of ABINIT (8.4.4). After successfully linking the mkl libraries and configuring abinit, I run into an error during the 'make' procedure:

checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc -m64 accepts -g... (cached) yes
checking for gcc -m64 option to accept ISO C89... (cached) none needed
checking whether gcc -m64 understands -c and -o together... (cached) yes
checking dependency style of gcc -m64... (cached) gcc3
checking for inline... inline
checking for ANSI C header files... (cached) yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking size of void*... 8
checking for sqrtf in -lm... yes
checking for cbrt in -lm... yes
checking for cbrtf in -lm... yes
checking for feenableexcept in -lm... yes
checking whether we are using the GNU Fortran compiler... no
checking whether ifort accepts -g... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
libtool.m4: error: problem compiling FC test program
checking for ifort option to produce PIC... -fPIC
checking if ifort PIC flag -fPIC works... no
checking if ifort static flag -static works... no
checking if ifort supports -c -o file.o... no
checking if ifort supports -c -o file.o... (cached) no
checking whether the ifort linker (/usr/x86_64-suse-linux/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for Fortran flag to compile .f90 files... unknown
configure: error: Fortran could not compile .f90 files

Makefile:766: recipe for target 'stamps/libxc-config-stamp' failed
make[3]: *** [stamps/libxc-config-stamp] Error 1
make[3]: Leaving directory '/home/ferris/ABINIT-8.4.4/abinit-8.4.4/fallbacks'
Makefile:731: recipe for target 'all-local' failed
make[2]: [all-local] Error 2 (ignored)
Checking build of libxc fallback
test -e stamps/libxc-install-stamp
Makefile:731: recipe for target 'all-local' failed
make[2]: *** [all-local] Error 1
make[2]: Leaving directory '/home/ferris/ABINIT-8.4.4/abinit-8.4.4/fallbacks'
Makefile:2457: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/ferris/ABINIT-8.4.4/abinit-8.4.4'
Makefile:2385: recipe for target 'all' failed
make: *** [all] Error 2

Currently I have the following flags in my configuration file

Code: Select all

enable_64bit_flags="yes"
enable_debug="verbose"
enable_optim="safe"
prefix="${HOME}/ABINIT"
enable_mpi="no"
with_fft_flavor="fftw3"
with_fft_incs="-I/opt/intel/composer_xe_2015.0.090/mkl/include -I/opt/intel/composer_xe_2015.0.090/mkl/include/fftw"
with_fft_libs="-L/opt/intel/composer_xe_2015.0.090/mkl/lib/intel64 -Wl,--start-group -lmkl_blas95_ilp64 -lmkl_lapack95_ilp64 -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread"
with_linalg_flavor="mkl"
with_linalg_incs="-I/opt/intel/composer_xe_2015.0.090/mkl/include -I/opt/intel/composer_xe_2015.0.090/mkl/include/intel64/ilp64"
with_linalg_libs="-L/opt/intel/composer_xe_2015.0.090/mkl/lib/intel64/ -Wl,--start-group -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread"
with_dft_flavor="libxc-fallback"


Additionally you may find the config.log file attached.

Any help would be greatly appreciated.

Kind Regards,
Kaelyn Ferris
Attachments
config.log
(137.74 KiB) Downloaded 327 times

kaelynf
Posts: 3
Joined: Fri Oct 06, 2017 12:24 am

Re: Fortran could not compile .f90 files during 'make'

Post by kaelynf » Fri Oct 13, 2017 7:19 pm

After some time debugging I have been able to determine what the issue was (however a new one has arisen). The problem I was running into was that I was not setting the environment variables the configuration and make scripts need to run. To accomplish this I sourced the intel compiler scripts compilervars, compilervars_arch, and mklvars. With these environment variables set, I am able to successfully build abinit using the fallback linear algebra and fft libraries.

The new problem I am running into is that when I try to link my linear algebra and fft libraries (Intel's mkl libraries and fft wrappers), I can run the makefile successfully, but I run into numerous SEGFAULT errors when running make check.

As a possible solution to this, I ensured the optimization level was set to "safe", but when I ran the make script, there is a flag set by FCFLAGS which my compiler does not like, -fp-model precise, which I find odd seeing as I was able to find it within intel's documentation of ifort.

Some helpful information: I am using the ifort 15.0 compiler and my config-file options can be found below.

Code: Select all

enable_64bit_flags="yes"
prefix="${HOME}/ABINIT-MKL-FFT"
CC="icc"
CXX="icc"
FC="ifort"
enable_mpi="no"
with_timer_flavor="none"
with_trio_flavor="none"
with_fft_flavor="fftw3"
with_fft_incs="-I/opt/intel/composer_xe_2015.0.090/mkl/include -I/opt/intel/composer_xe_2015.0.090/mkl/include/fftw"
with_fft_libs="-L/opt/intel/composer_xe_2015.0.090/mkl/lib/intel64 -Wl,--start-group -lmkl_blas95_ilp64 -lmkl_lapack95_ilp64 -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread"
with_linalg_flavor="mkl"
with_linalg_incs="-I/opt/intel/composer_xe_2015.0.090/mkl/include -I/opt/intel/composer_xe_2015.0.090/mkl/include/intel64/ilp64"
with_linalg_libs="-L/opt/intel/composer_xe_2015.0.090/mkl/lib/intel64/ -Wl,--start-group -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread"
with_dft_flavor="libxc"
with_libxc_incs="-I/home/ferris/local/libxc/include/"
with_libxc_libs="-L/home/ferris/local/libxc/lib64 -lxcf90 -lxc"


Cheers,
Kaelyn

kaelynf
Posts: 3
Joined: Fri Oct 06, 2017 12:24 am

Re: Fortran could not compile .f90 files during 'make'  [SOLVED]

Post by kaelynf » Mon Oct 16, 2017 8:10 pm

A solution has been found! I will explain what I did in the hopes that it may help someone in the future running into a similar issue.

The reason for the spurious SEGFAULT errors was that I was using the ilp64 version of the mkl and fft libraries which assumes the 64-bit integer type. However, the Fortran compiler assumes a 32-bit integer type by default which I realized after being inspired by this thread: https://forum.abinit.org/viewtopic.php?f=2&t=3259.

The fix was straightforward, I simply changed the libraries to link and include to lp64 version rather than the ilp64 version.

Code: Select all

with_fft_incs="-I/opt/intel/composer_xe_2015.0.090/mkl/include -I/opt/intel/composer_xe_2015.0.090/mkl/include/fftw"
with_fft_libs="-L/opt/intel/composer_xe_2015.0.090/mkl/lib/intel64 -Wl,--start-group -lmkl_blas95_ilp64 -lmkl_lapack95_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread"
with_linalg_flavor="mkl"
with_linalg_incs="-I/opt/intel/composer_xe_2015.0.090/mkl/include -I/opt/intel/composer_xe_2015.0.090/mkl/include/intel64/lp64"
with_linalg_libs="-L/opt/intel/composer_xe_2015.0.090/mkl/lib/intel64/ -Wl,--start-group -lmkl_blas95_ilp64 -lmkl_lapack95_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread"
with_dft_flavor="libxc"
.

Additionally, I changed the sourcing arguments to set up my environment variables to

Code: Select all

. $INTELROOT/bin/compilervars.sh intel64 mod lp64
. $INTELROOT/bin/compilervars_arch.sh intel64 mod lp64
. $MKLROOT/bin/mklvars.sh intel64 mod lp64

although I am unsure if the last argument in each line is completely necessary.

Hopefully this proves helpful to future readers of this forum running into a similar problem.

Cheers,
Kaelyn

Locked