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
ilukacevic
Posts: 271
Joined: Sat Jan 16, 2010 12:05 pm
Location: Dept. of Physics, University J. J. Strossmayer, Osijek, Croatia
Contact:

Fortran could not compile .f90 files during 'make'

Post by ilukacevic » Mon Jun 11, 2012 9:52 am

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
Last edited by ilukacevic on Tue Jun 26, 2012 10:52 am, edited 1 time in total.

User avatar
pouillon
Posts: 651
Joined: Wed Aug 19, 2009 10:08 am
Location: Spain
Contact:

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

Post by pouillon » Mon Jun 11, 2012 12:47 pm

look at ~abinit/<your_build_dir>/fallbacks/sources/libxc-<version>/config.log for details about the failure.
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain

ilukacevic
Posts: 271
Joined: Sat Jan 16, 2010 12:05 pm
Location: Dept. of Physics, University J. J. Strossmayer, Osijek, Croatia
Contact:

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

Post by ilukacevic » Tue Jun 12, 2012 9:18 am

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.

User avatar
pouillon
Posts: 651
Joined: Wed Aug 19, 2009 10:08 am
Location: Spain
Contact:

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

Post by pouillon » Tue Jun 12, 2012 12:29 pm

Which compilers and versions are you using?
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain

ilukacevic
Posts: 271
Joined: Sat Jan 16, 2010 12:05 pm
Location: Dept. of Physics, University J. J. Strossmayer, Osijek, Croatia
Contact:

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

Post by ilukacevic » Tue Jun 12, 2012 1:22 pm

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

User avatar
jbeuken
Posts: 365
Joined: Tue Aug 18, 2009 9:24 pm
Contact:

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

Post by jbeuken » Tue Jun 12, 2012 8:03 pm

Hi Igor,

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

at least, upgrade to 4.4.x

jmb
------
Jean-Michel Beuken
Computer Scientist

ilukacevic
Posts: 271
Joined: Sat Jan 16, 2010 12:05 pm
Location: Dept. of Physics, University J. J. Strossmayer, Osijek, Croatia
Contact:

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

Post by ilukacevic » Wed Jun 13, 2012 8:15 am

Dear Jean-Michel,

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

Best regards,

Igor L.

Mascha
Posts: 8
Joined: Mon Apr 02, 2012 5:32 pm

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

Post by Mascha » Wed Jun 13, 2012 8:43 pm

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

User avatar
pouillon
Posts: 651
Joined: Wed Aug 19, 2009 10:08 am
Location: Spain
Contact:

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

Post by pouillon » Thu Jun 14, 2012 4:04 pm

Try setting FPP to a standard C preprocessor (best one: GNU cpp) when configuring Abinit.
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain

ilukacevic
Posts: 271
Joined: Sat Jan 16, 2010 12:05 pm
Location: Dept. of Physics, University J. J. Strossmayer, Osijek, Croatia
Contact:

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

Post by ilukacevic » Tue Jun 26, 2012 10:51 am

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.

hnf191
Posts: 8
Joined: Mon Jun 03, 2013 11:11 am

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

Post by hnf191 » Mon Jun 03, 2013 11:13 am

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

hnf191
Posts: 8
Joined: Mon Jun 03, 2013 11:11 am

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

Post by hnf191 » Mon Jun 03, 2013 11:27 am

pouillon wrote:Try setting FPP to a standard C preprocessor (best one: GNU cpp) when configuring Abinit.



How it should be done?

User avatar
pouillon
Posts: 651
Joined: Wed Aug 19, 2009 10:08 am
Location: Spain
Contact:

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

Post by pouillon » Mon Jun 03, 2013 8:22 pm

E.g.:

Code: Select all

../configure [your options] FPP=/usr/bin/cpp
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain

hnf191
Posts: 8
Joined: Mon Jun 03, 2013 11:11 am

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

Post by hnf191 » Wed Jun 05, 2013 10:58 am

pouillon wrote:E.g.:

Code: Select all

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



Thanks

hnf191
Posts: 8
Joined: Mon Jun 03, 2013 11:11 am

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

Post by hnf191 » Wed Jun 05, 2013 11:01 am

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

User avatar
jbeuken
Posts: 365
Joined: Tue Aug 18, 2009 9:24 pm
Contact:

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

Post by jbeuken » Wed Jun 05, 2013 12:53 pm

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
------
Jean-Michel Beuken
Computer Scientist

hnf191
Posts: 8
Joined: Mon Jun 03, 2013 11:11 am

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

Post by hnf191 » Wed Jun 05, 2013 1:17 pm

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

User avatar
pouillon
Posts: 651
Joined: Wed Aug 19, 2009 10:08 am
Location: Spain
Contact:

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

Post by pouillon » Thu Jun 06, 2013 1:16 pm

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 $?
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain

hnf191
Posts: 8
Joined: Mon Jun 03, 2013 11:11 am

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

Post by hnf191 » Tue Jun 25, 2013 11:19 am

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

mdigennaro
Posts: 1
Joined: Mon Feb 16, 2015 4:23 pm

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

Post by mdigennaro » Mon Feb 16, 2015 4:30 pm

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

User avatar
jbeuken
Posts: 365
Joined: Tue Aug 18, 2009 9:24 pm
Contact:

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

Post by jbeuken » Mon Feb 16, 2015 8:24 pm

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
------
Jean-Michel Beuken
Computer Scientist

Locked