Error compiling ABINIT 9.6.2 using GCC 8.2 (no rule to make target m_optim_dumper.F90)

Hello all,
I hope you are all well in Europe!

I am trying to compile ABINIT 9.6.2 using GCC 8.2 and OpenMPI 3.1.6 on a machine running RHEL 6.x

This is the error message (Final lines inside 14_hidewrite) :

make[5]: Entering directory '/gpfs/shared/src/abinit-9.6.2/build_gcc82_ompi316/shared/common/src/14_hidewrite'
mpif90 -DHAVE_CONFIG_H -I. -I../../../../../shared/common/src/14_hidewrite -I../../../..  -I../../../../shared/common/src/10_defs -I../../../../../shared/common/src/10_defs -I../../../../shared/common/src/11_memory_mpi -I../../../../../shared/common/src/11_memory_mpi -I../../../../shared/common/src/12_hide_mpi -I../../../../../shared/common/src/12_hide_mpi -I../../../../shared/common/src/14_hidewrite -I../../../../../shared/common/src/14_hidewrite -I../../../../shared/common/src/incs -I../../../../../shared/common/src/incs -I../../../../shared/common/src/mods -I../../../../../shared/common/src/mods -I../../../../src/incs -I../../../../../src/incs -I../../../../src/mods -I../../../../../src/mods -I../../../../shared/libpaw/incs -I../../../../../shared/libpaw/incs -I../../../../shared/libpaw/mods -I../../../../../shared/libpaw/mods   -ffree-form -J../mods -O2 -mtune=native -march=native  -g -ffree-line-length-none     -I/shared/src/abinit-9.6.2/build_gcc82_ompi316/fallbacks/install_fb/gnu/8.2/netcdf4/4.6.3/include  -I/shared/src/abinit-9.6.2/build_gcc82_ompi316/fallbacks/install_fb/gnu/8.2/netcdf4_fortran/4.5.2/include  -I/shared/src/abinit-9.6.2/build_gcc82_ompi316/fallbacks/install_fb/gnu/8.2/xmlf90/1.5.3.1/include  -I/shared/src/abinit-9.6.2/build_gcc82_ompi316/fallbacks/install_fb/gnu/8.2/libpsml/1.1.7/include  -c -o m_specialmsg.o ../../../../../shared/common/src/14_hidewrite/m_specialmsg.F90
mpif90 -DHAVE_CONFIG_H -I. -I../../../../../shared/common/src/14_hidewrite -I../../../..  -I../../../../shared/common/src/10_defs -I../../../../../shared/common/src/10_defs -I../../../../shared/common/src/11_memory_mpi -I../../../../../shared/common/src/11_memory_mpi -I../../../../shared/common/src/12_hide_mpi -I../../../../../shared/common/src/12_hide_mpi -I../../../../shared/common/src/14_hidewrite -I../../../../../shared/common/src/14_hidewrite -I../../../../shared/common/src/incs -I../../../../../shared/common/src/incs -I../../../../shared/common/src/mods -I../../../../../shared/common/src/mods -I../../../../src/incs -I../../../../../src/incs -I../../../../src/mods -I../../../../../src/mods -I../../../../shared/libpaw/incs -I../../../../../shared/libpaw/incs -I../../../../shared/libpaw/mods -I../../../../../shared/libpaw/mods   -ffree-form -J../mods -O2 -mtune=native -march=native  -g -ffree-line-length-none     -I/shared/src/abinit-9.6.2/build_gcc82_ompi316/fallbacks/install_fb/gnu/8.2/netcdf4/4.6.3/include  -I/shared/src/abinit-9.6.2/build_gcc82_ompi316/fallbacks/install_fb/gnu/8.2/netcdf4_fortran/4.5.2/include  -I/shared/src/abinit-9.6.2/build_gcc82_ompi316/fallbacks/install_fb/gnu/8.2/xmlf90/1.5.3.1/include  -I/shared/src/abinit-9.6.2/build_gcc82_ompi316/fallbacks/install_fb/gnu/8.2/libpsml/1.1.7/include  -c -o m_abicore.o ../../../../../shared/common/src/14_hidewrite/m_abicore.F90
make[5]: *** No rule to make target 'm_optim_dumper.F90', needed by 'm_optim_dumper.o'.  Stop.
make[5]: Leaving directory '/gpfs/shared/src/abinit-9.6.2/build_gcc82_ompi316/shared/common/src/14_hidewrite'
make[4]: *** [Makefile:1177: all-recursive] Error 1
make[4]: Leaving directory '/gpfs/shared/src/abinit-9.6.2/build_gcc82_ompi316/shared/common/src'
make[3]: *** [Makefile:1150: all-recursive] Error 1
make[3]: Leaving directory '/gpfs/shared/src/abinit-9.6.2/build_gcc82_ompi316/shared/common'
make[2]: *** [Makefile:1151: all-recursive] Error 1
make[2]: Leaving directory '/gpfs/shared/src/abinit-9.6.2/build_gcc82_ompi316/shared'
make[1]: *** [Makefile:1449: all-recursive] Error 1
make[1]: Leaving directory '/gpfs/shared/src/abinit-9.6.2/build_gcc82_ompi316'
make: *** [Makefile:1373: all] Error 2

This is my AC9 file:

prefix="/shared/software/atomistic/abinit/9.6.2_gcc82_ompi316" 
CC=mpicc
CXX=mpicxx
FC=mpif90
with_libxc=/shared/src/abinit-9.6.2/build_gcc82_ompi316/fallbacks/install_fb/gnu/8.2/libxc/4.3.4
with_hdf5=/shared/src/abinit-9.6.2/build_gcc82_ompi316/fallbacks/install_fb/gnu/8.2/hdf5/1.10.6
with_netcdf=/shared/src/abinit-9.6.2/build_gcc82_ompi316/fallbacks/install_fb/gnu/8.2/netcdf4/4.6.3
with_netcdf_fortran=/shared/src/abinit-9.6.2/build_gcc82_ompi316/fallbacks/install_fb/gnu/8.2/netcdf4_fortran/4.5.2
with_xmlf90=/shared/src/abinit-9.6.2/build_gcc82_ompi316/fallbacks/install_fb/gnu/8.2/xmlf90/1.5.3.1
with_libpsml=/shared/src/abinit-9.6.2/build_gcc82_ompi316/fallbacks/install_fb/gnu/8.2/libpsml/1.1.7

These are the versions of several relevant packages

14:43:54-build@srih0001:/shared/src/abinit-9.6.2/build_gcc82_ompi316$ mpicc -v
Using built-in specs.
COLLECT_GCC=/shared/software/lang/gcc/8.2.0/bin/gcc
COLLECT_LTO_WRAPPER=/gpfs/shared/software/lang/gcc/8.2.0/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --prefix=/shared/software/lang/gcc/8.2.0 --disable-multilib
Thread model: posix
gcc version 8.2.0 (GCC) 

14:45:27-build@srih0001:/shared/src/abinit-9.6.2/build_gcc82_ompi316$ autoconf --version
autoconf (GNU Autoconf) 2.69

14:45:31-build@srih0001:/shared/src/abinit-9.6.2/build_gcc82_ompi316$ automake --version
automake (GNU automake) 1.16.1

14:45:42-build@srih0001:/shared/src/abinit-9.6.2/build_gcc82_ompi316$ m4 --version
m4 (GNU M4) 1.4.18

I can reproduce exactly the same error with GCC 10.3 with the adding complication of having to use -fallow-argument-mismatch but that is another point particular to gfortran 10>

I can see a file config.optim having these values:

14:49:14-build@srih0001:/shared/src/abinit-9.6.2/build_gcc82_ompi316$ cat config.optim 
optim_dumper_template='/shared/src/abinit-9.6.2/build_gcc82_ompi316/../shared/common/src/14_hidewrite/m_optim_dumper.F90.in'
optim_dumper_output='/shared/src/abinit-9.6.2/build_gcc82_ompi316/shared/common/src/14_hidewrite/m_optim_dumper.F90'
fcflags_opt_default='-O2 -mtune=native -march=native'
fcflags_opt_43_ptgroups='-O0'
fcflags_opt_dirlist=' 43_ptgroups'

I am compiling on a separte build folder and the file m_optim_dumper.F90 is missing:

14:49:51-build@srih0001:/shared/src/abinit-9.6.2/build_gcc82_ompi316$ ls shared/common/src/14_hidewrite/
m_abicore.o  Makefile  m_build_info.F90  m_build_info.o  m_cppopts_dumper.o  m_fstrings.o  m_io_tools.o  m_specialmsg.o

I am not getting this error when building with Intel Compilers

Any guidance on how the F90 is generated from the .in is appreciated. I am bit lost on the building scritps.

Thank you

Hi,

I’ve seen you’re using RHEL 6, which is pretty outdated. This is likely due to the presence of a Python 2 interpreter.

The solution would be to make sure that the default Python interpreter in your session is Python 3.x. You can try to set an alias but there is no guarantee that it will work properly:

alias python="/full/path/to/python3"

Hello,

Yes, I was working yesterday trying to understand the issue.

You are right on your analysis. RHEL 6.x has Python 2.6 which fails to work with several of the scripts used by “configure”, in particular the python scripts that write

m_optim_dumper.F90

On the machine I have modules that load GCC 10.3 and Python 3.10

module load lang/gcc/10.3.0 lang/python/cpython_3.10.2_gcc103

However, the command “python” is still pointing to the RHEL Python 2.6

Your solution with the alias does not work, this is the proof:

12:05:14-gufranco@srih0001:~$ module load lang/gcc/10.3.0 lang/python/cpython_3.10.2_gcc103 
Loading gcc version 10.3.0 : lang/gcc/10.3.0
Loading python version cpython_3.10.2_gcc103 : lang/python/cpython_3.10.2_gcc103
12:05:19-gufranco@srih0001:~$ which python3
/shared/software/lang/python/3.10.2_gcc103/bin/python3
12:05:27-gufranco@srih0001:~$ which python
/usr/bin/python
12:05:33-gufranco@srih0001:~$ python --version
Python 2.6.6
12:05:41-gufranco@srih0001:~$ alias python="/shared/software/lang/python/3.10.2_gcc103/bin/python3"
12:06:16-gufranco@srih0001:~$ /usr/bin/env python
Python 2.6.6 (r266:84292, Aug  9 2016, 06:11:56) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

The problem is that the python scripts will not use python3 because the shebang starts with:

#!/usr/bin/env python

and will pick Python 2.6 instead of the python 3.x

Creating an alias does not work, tell me if I am missing something.
One option could be a symlink into a location on priority position on $PATH

However, I went in a different direction. I end up compiling Python 2.7.18 with GCC 10.3 and creating a module for it. That worked and the scripts are now working fine.

The final issue was with the script that build the fallbacks. I got some advances
adding -fallow-argument-mismatch but failed due to other errors with libz.so
I end up compiling libxc, hdf5 and the netcdf (c,fortran) myself and that is working.

I do not expect many people to face this kind of issue, except for those dealing with large clusters running RHEL 6.x, and their number will decrease over time.

Thank you