Page 1 of 1

Fortran could not compile .f90 files during 'make'

Posted: Mon Jun 11, 2012 9:52 am
by ilukacevic
Dear all,

after successfully configuring abinit, an error occurred during the 'make' procedure:

checking whether we are using the GNU Fortran compiler... no
checking whether gfortran accepts -g... yes
checking whether we are using the GNU Fortran compiler... (cached) no
checking whether gfortran accepts -g... (cached) 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 gfortran option to produce PIC...
checking if gfortran static flag works... no
checking if gfortran supports -c -o file.o... no
checking if gfortran supports -c -o file.o... (cached) no
checking whether the gfortran linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... 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
make[3]: *** [stamps/libxc-config-stamp] Error 1
make[3]: Leaving directory `/home/igor/abinit-6.13.1/fallbacks'
make[2]: [all-local] Error 2 (ignored)
Checking build of libxc fallback
test -e stamps/libxc-install-stamp
make[2]: *** [all-local] Error 1
make[2]: Leaving directory `/home/igor/abinit-6.13.1/fallbacks'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/igor/abinit-6.13.1'
make: *** [all] Error 2
[igor@nelson01 abinit-6.13.1]$

Can anyone help me and explain why this happens and possibly to solve this?

Thank you in advance!

Yours,

Igor Lukacevic

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

Posted: Mon Jun 11, 2012 12:47 pm
by pouillon
look at ~abinit/<your_build_dir>/fallbacks/sources/libxc-<version>/config.log for details about the failure.

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

Posted: Tue Jun 12, 2012 9:18 am
by ilukacevic
Dear Yann,

thanks for the tip. The config.log file contains many errors of the kind:

conftest.f:0: error: bad value (native) for -march= switch
conftest.f90:0: error: bad value (native) for -march= switch
conftest.f90:0: error: bad value (native) for -mtune= switch
conftest.c:11:28: error: ac_nonexistent.h: No such file or directory
configure:15036: error: Fortran could not compile .f90 files


appearing on many places. But I don't understand why they are there or what they mean. I'll try to google something, but a further help would be most appreciated.

Igor L.

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

Posted: Tue Jun 12, 2012 12:29 pm
by pouillon
Which compilers and versions are you using?

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

Posted: Tue Jun 12, 2012 1:22 pm
by ilukacevic
I didn't specify anything in the configure command, so abinit chose automatically:

configure:12056: checking for Fortran compiler version
configure:12065: gfortran --version >&5
GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44)

configure:3504: checking for C compiler version
configure:3513: gcc --version >&5
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44)

this is written in the log file you told me to look at.

Igor

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

Posted: Tue Jun 12, 2012 8:03 pm
by jbeuken
Hi Igor,

the very old gcc 4.1.2 is anymore supported for abinit...

at least, upgrade to 4.4.x

jmb

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

Posted: Wed Jun 13, 2012 8:15 am
by ilukacevic
Dear Jean-Michel,

thanks for the answer. I will see what can be done about it.

Best regards,

Igor L.

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

Posted: Wed Jun 13, 2012 8:43 pm
by Mascha
Hi,

I have to handle with the same error massage at the building process of the netcdf fallback. (For the fallbacks lapack and libxc the building process seems to went well.)
You can see in the config.log file the following:

Code: Select all

ABINIT WRAPPER END (exit code 249)
configure:6548: $? = 249
configure:6537: /home/maust/abinit-6.12.3/config/wrappers/wrap-fc -qversion >&5
ABINIT WRAPPER BEGIN
xlf -q64 -qversion
IBM XL Fortran Advanced Edition for Linux, V11.1
Version: 11.01.0000.0004
ABINIT WRAPPER END (exit code 0)
configure:6548: $? = 0
configure:6557: checking whether we are using the GNU Fortran 77 compiler
configure:6570: /home/maust/abinit-6.12.3/config/wrappers/wrap-fc -c -qsuffix=cpp=F:f=f -qfixed -q64  -qzerosize  -O3 -qmaxmem=65536 -qspill=2000 -qarch=auto -qtune=auto -qcache=auto -qstrict -qsuppress=1520-022:1520-031 -DNDEBUG -DIBMR2Fortran -g -WF,-DIBMR2Fortran,-DNDEBUG -I/home/maust/abinit-6.12.3/fallbacks/exports/include conftest.F >&5
ABINIT WRAPPER BEGIN
cpp -P -traditional-cpp  -DNDEBUG -DIBMR2Fortran -DIBMR2Fortran -DNDEBUG  -I/home/maust/abinit-6.12.3/fallbacks/exports/include conftest.F > conftest_cpp.f
xlf -q64  -c -qsuffix=cpp=F:f=f -qfixed -q64 -qzerosize -O3 -qmaxmem=65536 -qspill=2000 -qarch=auto -qtune=auto -qcache=auto -qstrict -qsuppress=1520-022:1520-031 -DNDEBUG -DIBMR2Fortran -g  -I/home/maust/abinit-6.12.3/fallbacks/exports/include conftest_cpp.f
ABINIT WRAPPER END (exit code 40)
xlf: 1501-210 (S) command option NDEBUG contains an incorrect subargument
configure:6570: $? = 40
configure: failed program was:
|       program main
| #ifndef __GNUC__
|        choke me
| #endif
|
|       end
configure:6579: result: no
configure:6585: checking whether /home/maust/abinit-6.12.3/config/wrappers/wrap-fc accepts -g
configure:6596: /home/maust/abinit-6.12.3/config/wrappers/wrap-fc -c -g conftest.f >&5
ABINIT WRAPPER BEGIN
xlf -q64 -c -g conftest.f
ABINIT WRAPPER END (exit code 0)
** main   === End of Compilation 1 ===
1501-510  Compilation successful for file conftest.f.
configure:6596: $? = 0
configure:6604: result: yes
configure:6650: setting up Fortran 90
configure:6669: checking for Fortran flag to compile .f90 files
configure:6685: /home/maust/abinit-6.12.3/config/wrappers/wrap-fc -c -qsuffix=cpp=F90:f=f90 -qfree=f90 -q64  -qzerosize  -O3 -qmaxmem=65536 -qspill=2000 -qarch=auto -qtune=auto -qcache=auto -qstrict -qsuppress=1520-022:1520-031 -DNDEBUG -DIBMR2Fortran -g -WF,-DIBMR2Fortran,-DNDEBUG -I/home/maust/abinit-6.12.3/fallbacks/exports/include  conftest.f90 >&5
ABINIT WRAPPER BEGIN
xlf -q64 -c -qsuffix=cpp=F90:f=f90 -qfree=f90 -q64 -qzerosize -O3 -qmaxmem=65536 -qspill=2000 -qarch=auto -qtune=auto -qcache=auto -qstrict -qsuppress=1520-022:1520-031 -DNDEBUG -DIBMR2Fortran -g -WF,-DIBMR2Fortran,-DNDEBUG -I/home/maust/abinit-6.12.3/fallbacks/exports/include conftest.f90
ABINIT WRAPPER END (exit code 40)
xlf: 1501-210 (S) command option NDEBUG contains an incorrect subargument
configure:6685: $? = 40
configure: failed program was:
|       program main
|
|       end
configure:6685: /home/maust/abinit-6.12.3/config/wrappers/wrap-fc -c -qsuffix=cpp=F90:f=f90 -qfree=f90 -q64  -qzerosize  -O3 -qmaxmem=65536 -qspill=2000 -qarch=auto -qtune=auto -qcache=auto -qstrict -qsuppress=1520-022:1520-031 -DNDEBUG -DIBMR2Fortran -g -WF,-DIBMR2Fortran,-DNDEBUG -I/home/maust/abinit-6.12.3/fallbacks/exports/include -qsuffix=f=f90 conftest.f90 >&5
ABINIT WRAPPER BEGIN
xlf -q64 -c -qsuffix=cpp=F90:f=f90 -qfree=f90 -q64 -qzerosize -O3 -qmaxmem=65536 -qspill=2000 -qarch=auto -qtune=auto -qcache=auto -qstrict -qsuppress=1520-022:1520-031 -DNDEBUG -DIBMR2Fortran -g -WF,-DIBMR2Fortran,-DNDEBUG -I/home/maust/abinit-6.12.3/fallbacks/exports/include -qsuffix=f=f90 conftest.f90
ABINIT WRAPPER END (exit code 40)
xlf: 1501-210 (S) command option NDEBUG contains an incorrect subargument
configure:6685: $? = 40
configure: failed program was:
|       program main
|
|       end
configure:6685: /home/maust/abinit-6.12.3/config/wrappers/wrap-fc -c -qsuffix=cpp=F90:f=f90 -qfree=f90 -q64  -qzerosize  -O3 -qmaxmem=65536 -qspill=2000 -qarch=auto -qtune=auto -qcache=auto -qstrict -qsuppress=1520-022:1520-031 -DNDEBUG -DIBMR2Fortran -g -WF,-DIBMR2Fortran,-DNDEBUG -I/home/maust/abinit-6.12.3/fallbacks/exports/include -Tf conftest.f90 >&5
ABINIT WRAPPER BEGIN
xlf -q64 -c -qsuffix=cpp=F90:f=f90 -qfree=f90 -q64 -qzerosize -O3 -qmaxmem=65536 -qspill=2000 -qarch=auto -qtune=auto -qcache=auto -qstrict -qsuppress=1520-022:1520-031 -DNDEBUG -DIBMR2Fortran -g -WF,-DIBMR2Fortran,-DNDEBUG -I/home/maust/abinit-6.12.3/fallbacks/exports/include -Tf conftest.f90
ABINIT WRAPPER END (exit code 40)
xlf: 1501-210 (S) command option NDEBUG contains an incorrect subargument
configure:6685: $? = 40
configure: failed program was:
|       program main
|
|       end
configure:6694: result: unknown
configure:6697: error: Fortran could not compile .f90 files


I use the compiler: IBM XL Fortran Advanced Edition for Linux, V11.1

Can someone please tell me, what can I do?

Regards

Maria

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

Posted: Thu Jun 14, 2012 4:04 pm
by pouillon
Try setting FPP to a standard C preprocessor (best one: GNU cpp) when configuring Abinit.

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

Posted: Tue Jun 26, 2012 10:51 am
by ilukacevic
Dear all,

it's been fixed, after switching to ifort and lowering the optimization to -O2.

Thanks again to Yan and JMB!

Best regards,

Igor L.

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

Posted: Mon Jun 03, 2013 11:13 am
by hnf191
Hi,
I have also this problem with the error :
libtool.m4: error: problem compiling FC test program
checking for gfortran option to produce PIC...
checking if gfortran static flag works... no
checking if gfortran supports -c -o file.o... no
checking if gfortran supports -c -o file.o... (cached) no
checking whether the gfortran linker (/usr/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



when I run make after successful run of ./configure

need help on it

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

Posted: Mon Jun 03, 2013 11:27 am
by hnf191
pouillon wrote:Try setting FPP to a standard C preprocessor (best one: GNU cpp) when configuring Abinit.



How it should be done?

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

Posted: Mon Jun 03, 2013 8:22 pm
by pouillon
E.g.:

Code: Select all

../configure [your options] FPP=/usr/bin/cpp

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

Posted: Wed Jun 05, 2013 10:58 am
by hnf191
pouillon wrote:E.g.:

Code: Select all

../configure [your options] FPP=/usr/bin/cpp



Thanks

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

Posted: Wed Jun 05, 2013 11:01 am
by hnf191
Is there any command to run abinit in a smp machine with several cores without parallel configuration?

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

Posted: Wed Jun 05, 2013 12:53 pm
by jbeuken
Hi

Is there any command to run abinit in a smp machine with several cores without parallel configuration?


yes, you can use OpenMP

this is a example of .ac file with gfortran 4.6 :

Code: Select all

enable_mpi = no
enable_mpi_io = no
with_dft_flavor = none
FC_LDFLAGS_EXTRA = -fopenmp
FCFLAGS_EXTRA = -fopenmp
enable_openmp = yes


regards

jmb

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

Posted: Wed Jun 05, 2013 1:17 pm
by hnf191
jbeuken wrote:Hi

Is there any command to run abinit in a smp machine with several cores without parallel configuration?


yes, you can use OpenMP

this is a example of .ac file with gfortran 4.6 :

Code: Select all

enable_mpi = no
enable_mpi_io = no
with_dft_flavor = none
FC_LDFLAGS_EXTRA = -fopenmp
FCFLAGS_EXTRA = -fopenmp
enable_openmp = yes


regards

jmb




Thanks.
But I meant something like

Code: Select all

abinit -x number of cores <file.files>
for ruining abinit. I heard there exists but I couldn't find it

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

Posted: Thu Jun 06, 2013 1:16 pm
by pouillon
As a Fortran program, Abinit doesn't accept command-line arguments (I know it's possible, but it's not so well and widely supported by the compilers).

You can however wrap it within a run_abinit.sh shell script that accepts command-line arguments. Here is an example:

Code: Select all

#!/bin/sh
#
# To run abinit, type: ./run_abinit.sh #_of_threads abinit_control_file, e.g. ./run_abinit.sh 8 ab.files
#

OMP_NUM_THREADS=$1
export OMP_NUM_THREADS

/path/to/abinit <$2
exit $?

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

Posted: Tue Jun 25, 2013 11:19 am
by hnf191
pouillon wrote:As a Fortran program, Abinit doesn't accept command-line arguments (I know it's possible, but it's not so well and widely supported by the compilers).

You can however wrap it within a run_abinit.sh shell script that accepts command-line arguments. Here is an example:

Code: Select all

#!/bin/sh
#
# To run abinit, type: ./run_abinit.sh #_of_threads abinit_control_file, e.g. ./run_abinit.sh 8 ab.files
#

OMP_NUM_THREADS=$1
export OMP_NUM_THREADS

/path/to/abinit <$2
exit $?


thanks

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

Posted: Mon Feb 16, 2015 4:30 pm
by mdigennaro
Hi all,

I keep having the same error:

Code: Select all

checking for Fortran flag to compile .f90 files... none
configure: error: cannot run /bin/bash config/config.sub


I used this configure.ac file:

Code: Select all

prefix="/usr/local"
enable_mpi="yes"
enable_mpi_io="yes"
enable_openmp = yes
with_mpi_prefix="/usr"
with_netcdf_incs="-I/usr/include"
with_netcdf_libs="-L/usr/lib64 -lnetcdf -lnetcdff"
with_fft_flavor="fftw3"
with_fft_incs="-I/usr/include/"
with_fft_libs="-L/usr/lib -lfftw3 -lfftw3f"
with_linalg_flavor="atlas"
with_linalg_libs="-L/usr/lib64 -llapack -lf77blas -lcblas -latlas"
with_dft_flavor="atompaw+bigdft+libxc+wannier90"
enable_gw_dpc="yes"
enable_maintainer_checks="no"

FC=mpif90
CXX=mpicc
CC="mpicc -m64"

FC_LDFLAGS_EXTRA = -fopenmp
FCFLAGS_EXTRA = -fopenmp


I also used " --enable-optim=aggressive" and "FPP=/usr/bin/cp" at the configuration stage but nothing.

I am using gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)

*Note: I need 7.5.3 version since some features have disappeared since then

thanks in advance

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

Posted: Mon Feb 16, 2015 8:24 pm
by jbeuken
I also used " --enable-optim=aggressive" and "FPP=/usr/bin/cp" at the configuration stage but nothing.


perhaps a typo in your FPP :roll:

try with :

Code: Select all

FPP=/usr/bin/cpp