Fortran could not compile .f90 files during 'make' [SOLVED]
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.
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.
-
- 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'
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
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.
Re: Fortran could not compile .f90 files during 'make'
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
Simune Atomistics
Donostia-San Sebastián, Spain
-
- 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'
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.
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'
Which compilers and versions are you using?
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain
Simune Atomistics
Donostia-San Sebastián, Spain
-
- 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'
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
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'
Hi Igor,
the very old gcc 4.1.2 is anymore supported for abinit...
at least, upgrade to 4.4.x
jmb
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
Jean-Michel Beuken
Computer Scientist
-
- 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'
Dear Jean-Michel,
thanks for the answer. I will see what can be done about it.
Best regards,
Igor L.
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'
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:
I use the compiler: IBM XL Fortran Advanced Edition for Linux, V11.1
Can someone please tell me, what can I do?
Regards
Maria
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'
Try setting FPP to a standard C preprocessor (best one: GNU cpp) when configuring Abinit.
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain
Simune Atomistics
Donostia-San Sebastián, Spain
-
- 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'
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.
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
Hi,
I have also this problem with the error :
when I run make after successful run of ./configure
need help on it
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'
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
E.g.:
Code: Select all
../configure [your options] FPP=/usr/bin/cpp
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain
Simune Atomistics
Donostia-San Sebastián, Spain
Re: [SOLVED] Fortran could not compile .f90 files during 'ma
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
Hi
yes, you can use OpenMP
this is a example of .ac file with gfortran 4.6 :
regards
jmb
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
Jean-Michel Beuken
Computer Scientist
Re: [SOLVED] Fortran could not compile .f90 files during 'ma
jbeuken wrote:HiIs 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>
Re: [SOLVED] Fortran could not compile .f90 files during 'ma
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:
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
Simune Atomistics
Donostia-San Sebastián, Spain
Re: [SOLVED] Fortran could not compile .f90 files during 'ma [SOLVED]
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
-
- Posts: 1
- Joined: Mon Feb 16, 2015 4:23 pm
Re: Fortran could not compile .f90 files during 'make'
Hi all,
I keep having the same error:
I used this configure.ac file:
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
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'
I also used " --enable-optim=aggressive" and "FPP=/usr/bin/cp" at the configuration stage but nothing.
perhaps a typo in your FPP

try with :
Code: Select all
FPP=/usr/bin/cpp
------
Jean-Michel Beuken
Computer Scientist
Jean-Michel Beuken
Computer Scientist