Nwchem-dev.revision26704-src.2015-01-19 compilation fails with gfortran-5.0.0


Gets Around
Hi,

on Fedora Rawhide, with gcc-gfortran-5.0.0-0.15.fc23, and the following compilation instructions:

export NWCHEM_TOP=/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19
export NWCHEM_TARGET=LINUX
export CC=gcc
export FC=gfortran
export USE_NOFSCHECK=TRUE
export NWCHEM_FSCHECK=N
export LARGE_FILES=TRUE
export MRCC_THEORY=TRUE
export NWCHEM_LONG_PATHS=Y
export PYTHONHOME=/usr
export PYTHONVERSION=2.7
export PYTHONLIBTYPE=so
export HAS_BLAS=yes
export BLASOPT='-L/usr/lib -lopenblas'
export BLAS_SIZE='4'
export MAKE=/usr/bin/make
export LD_LIBRARY_PATH=/usr/lib/openmpi/lib
export USE_MPI=y
export USE_MPIF=y
export USE_MPIF4=y
export MPIEXEC=/usr/lib/openmpi/bin/mpiexec
export MPI_LIB=/usr/lib/openmpi/lib
export MPI_INCLUDE=/usr/include/openmpi-i386
export LIBMPI='-lmpi -lmpi_usempif08 -lmpi_mpifh'
$MAKE nwchem_config NWCHEM_MODULES="all python" 2>&1 | tee ../make_nwchem_config_openmpi.log
export MAKEOPTS=""
$MAKE ${MAKEOPTS} 2>&1


I get the following error:

...
ar r /scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/lib/LINUX/libnwdft.a rt_tddft_input_put_defaults.o rt_tddft_input_field.o rt_tddft_input_print.o rt_tddft_input_excite.o rt_tddft_input_tolerances.o rt_tddft_input_visualization.o rt_tddft_input.o
ranlib /scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/lib/LINUX/libnwdft.a
Making all in init
make[3]: *** No rule to make target '/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/lib/LINUX/libnwdft.a(rt_tddft_input.o)', needed by '/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/lib/LINUX/libnwdft.a'.  Stop.
../../config/makelib.h:224: recipe for target 'subdirs' failed
make[2]: *** [subdirs] Error 1
../config/makelib.h:224: recipe for target 'subdirs' failed
make[1]: *** [subdirs] Error 1
GNUmakefile:111: recipe for target 'libraries' failed
make: *** [libraries] Error 1

Forum Vet
Marcin
Does this problem show up only on 32-bit linux or is it there on 64-bit Fedora Rawhide, too?
By the way, could you please post a few more lines of the failed compilation?
Thanks

Gets Around
Actually the error showed up already with some version of gfortran-4.9.X on x86_64 Rawhide, but I didn't take
a note which X, and don't have access to this anymore.
The gfortran-4.9.2 on Fedora 21 is OK, after applying a patch for gfortran-4.9 similar to your patch for gfortran-4.8
(https://pkgs.fedoraproject.org/repo/pkgs/nwchem/Makefile_gcc4x8x9.patch/ - note: the site has a certificate expired currently).
You can see the full log for Rawhide x86_64 with gfortran-5.0.0 here, but for the 6.5.26243 release (it has the same
error, but it uses ga package from Fedora. Note also that the log will disappear after a couple of days):
https://kojipkgs.fedoraproject.org//work/tasks/5379/9015379/build.log

I already looked at the full log and did not spot any previous errors, here are few more lines:

Got lock on /scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/lib/LINUX/libnwdft.lock
ar r /scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/lib/LINUX/libnwdft.a rt_tddft_debug.o rt_tddft_header.o rt_tddft_output.o rt_tddft_calc.o rt_tddft_movecs_gs.o rt_tddft_movecs_import.o rt_tddft_moocc.o rt_tddft_atpoint.o rt_tddft_snapshot.o rt_tddft_geom_mask.o rt_tddft_estimate_rem.o rt_tddft_vec_quad.o rt_tddft_excite.o rt_tddft_checkpoint.o rt_tddft_zora_scale.o rt_tddft_project.o rt_tddft_zdens_tot_movecs.o
ranlib /scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/lib/LINUX/libnwdft.a
Making all in input
gfortran -c  -m32 -march=pentium4 -mtune=pentium4 -g -O2 -g -fno-aggressive-loop-optimizations -g -O0  -I. -I../../include -I../../../ddscf -I/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/src/include -I/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/src/tools/install/include -DLINUX -DGFORTRAN -DGCC46 -DCHKUNDFLW -DGCC4 -DPARALLEL_DIAG -DDEBUG_PRINT  rt_tddft_input_put_defaults.F
gfortran -c  -m32 -march=pentium4 -mtune=pentium4 -g -O2 -g -fno-aggressive-loop-optimizations -g -O0  -I. -I../../include -I../../../ddscf -I/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/src/include -I/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/src/tools/install/include -DLINUX -DGFORTRAN -DGCC46 -DCHKUNDFLW -DGCC4 -DPARALLEL_DIAG -DDEBUG_PRINT  rt_tddft_input_field.F
gfortran -c  -m32 -march=pentium4 -mtune=pentium4 -g -O2 -g -fno-aggressive-loop-optimizations -g -O0  -I. -I../../include -I../../../ddscf -I/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/src/include -I/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/src/tools/install/include -DLINUX -DGFORTRAN -DGCC46 -DCHKUNDFLW -DGCC4 -DPARALLEL_DIAG -DDEBUG_PRINT  rt_tddft_input_print.F
gfortran -c  -m32 -march=pentium4 -mtune=pentium4 -g -O2 -g -fno-aggressive-loop-optimizations -g -O0  -I. -I../../include -I../../../ddscf -I/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/src/include -I/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/src/tools/install/include -DLINUX -DGFORTRAN -DGCC46 -DCHKUNDFLW -DGCC4 -DPARALLEL_DIAG -DDEBUG_PRINT  rt_tddft_input_excite.F
gfortran -c  -m32 -march=pentium4 -mtune=pentium4 -g -O2 -g -fno-aggressive-loop-optimizations -g -O0  -I. -I../../include -I../../../ddscf -I/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/src/include -I/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/src/tools/install/include -DLINUX -DGFORTRAN -DGCC46 -DCHKUNDFLW -DGCC4 -DPARALLEL_DIAG -DDEBUG_PRINT  rt_tddft_input_tolerances.F
gfortran -c  -m32 -march=pentium4 -mtune=pentium4 -g -O2 -g -fno-aggressive-loop-optimizations -g -O0  -I. -I../../include -I../../../ddscf -I/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/src/include -I/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/src/tools/install/include -DLINUX -DGFORTRAN -DGCC46 -DCHKUNDFLW -DGCC4 -DPARALLEL_DIAG -DDEBUG_PRINT  rt_tddft_input_visualization.F
gfortran -c  -m32 -march=pentium4 -mtune=pentium4 -g -O2 -g -fno-aggressive-loop-optimizations -g -O0  -I. -I../../include -I../../../ddscf -I/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/src/include -I/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/src/tools/install/include -DLINUX -DGFORTRAN -DGCC46 -DCHKUNDFLW -DGCC4 -DPARALLEL_DIAG -DDEBUG_PRINT  rt_tddft_input.F
Got lock on /scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/lib/LINUX/libnwdft.lock
ar r /scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/lib/LINUX/libnwdft.a rt_tddft_input_put_defaults.o rt_tddft_input_field.o rt_tddft_input_print.o rt_tddft_input_excite.o rt_tddft_input_tolerances.o rt_tddft_input_visualization.o rt_tddft_input.o
ranlib /scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/lib/LINUX/libnwdft.a
Making all in init
make[3]: *** No rule to make target '/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/lib/LINUX/libnwdft.a(rt_tddft_input.o)', needed by '/scratch/mock/Nwchem-dev.revision26704-src.2015-01-19/lib/LINUX/libnwdft.a'.  Stop.
../../config/makelib.h:224: recipe for target 'subdirs' failed
make[2]: *** [subdirs] Error 1
../config/makelib.h:224: recipe for target 'subdirs' failed
make[1]: *** [subdirs] Error 1
GNUmakefile:111: recipe for target 'libraries' failed
make: *** [libraries] Error 1

Forum Vet
Marcin
the root cause of the problem is that the ar command currently shipped with Fedora Rawhide is busted (GNU ar version 2.25-6.fc23)
Please try the following

ar tv $NWCHEM_TOP/lib/LINUX64/libddscf.a

This will show you all the object with the Unix epoch timestamp. (Dec 31 16:00 1969)

If you replace ar 2.25-6.fc23 with -- for example -- with ar 2.25-6.fc23 from binutils-x86_64-linux-gnu.x86_64, the compilation works fine again.

It might be time for a bug report, right?

Cheers, Edo

Forum Vet
By the way,
I don't see any reason for the following patch
https://pkgs.fedoraproject.org/repo/pkgs/nwchem/Makefile_gcc4x8x9.patch
The makefile structure for LINUX64 already detects gcc-4.9 (it's using $(GNUMINOR) -ge 8 and 9 is greater than 8 ...)

Forum Vet
Bug report filed

https://bugzilla.redhat.com/show_bug.cgi?id=1195883

Gets Around
Thanks for the bug report, and you are right about the gcc4\* patch.

Forum Vet
Got an update on the bugzilla entry.
Because of this, I had to introduce a new env. variable
USE_ARUR
to get the "new and improved" ar behavior that uses the -rU options.
It's not a great solution, but it fixes the problem.

Patch at
http://nwchemgit.github.io/images/Makefileh_use_arur.patch.gz

To compile with this switch, please type

make USE_ARUR=y

Gets Around
Works for me. I include this patch in the RPMS of nwchem 6.5.26243 for Fedora >= 22 and RHEL => 7.


Forum >> NWChem's corner >> Compiling NWChem