Error in installing exciting using either gfortran or ifort

Hi everyone, I’m trying to install the latest “exciting fluorine” on my campus supercomputer server. I followed the instructions on Download and Compile exciting - exciting, but got stuck at the last step

$ make smp

I first tried to compile with Intel ifort,

$ cp build/platforms/make.inc.ifort build/make.inc
$ make smp

which ends up with the following error msg:

make[3]: Entering directory `/nfs-share/home/1600011754/exciting/external/Lbfgsb.3.0'
ar -rc liblbfgs.a lbfgsb.o linpack.o timer.o
make[3]: Leaving directory `/nfs-share/home/1600011754/exciting/external/Lbfgsb.3.0'
cp ../../external/Lbfgsb.3.0/liblbfgs.a ./
perl ../../build/utilities/versionstamp.pl
readline() on closed filehandle $HEADREF at ../../build/utilities/versionstamp.pl line 14.
readline() on closed filehandle $REFS at ../../build/utilities/versionstamp.pl line 41.
../../build/utilities/mkmf -t ./template -f -m Makefile.mkmf\
         -p exciting ../../src/math ../../src/testframework ../../src/ ../../src/simplified_input ../../src/lapack_wrappers ../../src/lapack_wrappers/f95_interfaces ../../src/lapack_wrappers/multiplication ../../src/lapack_wrappers/decomposition ../../src/lapack_wrappers/diagonalization ../../src/lapack_wrappers/utils ../../src/lapack_wrappers/tensor_contraction ../../src/char_utils ../../src/writers ../../src/structure ../../src/src_advanced/ ../../src/constants ../../src/src_eigensystem/ ../../src/errors_warnings ../../src/char_utils ../../src/src_fermisurfdx/ ../../src/src_gw/ ../../src/src_gw/src_vxc ../../src/src_gw/src_tests ../../src/src_hybrids/ ../../src/input ../../src/src_inputparser/ ../../src/src_LDAU/ ../../src/src_lib/ ../../src/src_lib/bessel ../../src/math ../../src/src_mixing/ ../../src/src_mpi/ ../../src/src_mpi/routines/ ../../src/src_mpi/serial/ ../../src/src_optics/ ../../src/src_phonon/ ../../src/src_raman/ ../../src/src_rdmft/ ../../src/src_stm/ ../../src/src_sym/ ../../src/testframework ../../src/src_vdW/ ../../src/src_wannier ../../src/src_xc/ ../../src/src_xml/ ../../src/src_xs/ ../../src/src_xs/modtetra ../../src/src_xs/src_rttddft ../../src/wavefunctions ../../src/sirius ../../src/read ../../src/potential ../../src/file_io ../../src/matrix_elements ../../src/dfpt ../../external/libXC/src/libxc.f90 ../../external/libXC/src/libxc_funcs.f90 ../../src/mainxml/\
         && make -f Makefile.mkmf exciting
.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... Makefile.mkmf is ready.
make[3]: Entering directory `/nfs-share/home/1600011754/exciting/build/smp'
ifort   -O3 -ip -unroll -scalar_rep  -cpp -DXS -DISO -DLIBXC -DIFORT -DFFTW -DMKL -qopenmp -DUSEOMP -Ifinclude -I"/nfs-share/software/intel/2017.1/compilers_and_libraries_2017.1.132/linux/mkl/include" -I"/nfs-share/software/intel/2017.1/compilers_and_libraries_2017.1.132/linux/mkl/include/intel64/lp64"  -c   ../../src/file_io/block_data_file.f90
../../src/file_io/block_data_file.f90(79): error #8304: In an intrinsic assignment statement, variable shall not be polymorphic.   [TYPE_DUMMY]
      this%type_dummy = type_dummy
-----------^
compilation aborted for ../../src/file_io/block_data_file.f90 (code 1)
make[3]: *** [block_data_file.o] Error 1
make[3]: Leaving directory `/nfs-share/home/1600011754/exciting/build/smp'
make[2]: *** [bin] Error 2
make[2]: Leaving directory `/nfs-share/home/1600011754/exciting/build/smp'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/nfs-share/home/1600011754/exciting/build/smp'
make: *** [smp] Error 2

while I also tried using gfortran:

$ cp build/platforms/make.inc.gfortran build/make.inc
$ make smp

which also fails, giving the following message:

make[3]: Leaving directory `/nfs-share/home/1600011754/exciting/external/Lbfgsb.3.0'
cp ../../external/Lbfgsb.3.0/liblbfgs.a ./
perl ../../build/utilities/versionstamp.pl
readline() on closed filehandle $HEADREF at ../../build/utilities/versionstamp.pl line 14.
readline() on closed filehandle $REFS at ../../build/utilities/versionstamp.pl line 41.
../../build/utilities/mkmf -t ./template -f -m Makefile.mkmf\
         -p exciting ../../src/math ../../src/testframework ../../src/ ../../src/simplified_input ../../src/lapack_wrappers ../../src/lapack_wrappers/f95_interfaces ../../src/lapack_wrappers/multiplication ../../src/lapack_wrappers/decomposition ../../src/lapack_wrappers/diagonalization ../../src/lapack_wrappers/utils ../../src/lapack_wrappers/tensor_contraction ../../src/char_utils ../../src/writers ../../src/structure ../../src/src_advanced/ ../../src/constants ../../src/src_eigensystem/ ../../src/errors_warnings ../../src/char_utils ../../src/src_fermisurfdx/ ../../src/src_gw/ ../../src/src_gw/src_vxc ../../src/src_gw/src_tests ../../src/src_hybrids/ ../../src/input ../../src/src_inputparser/ ../../src/src_LDAU/ ../../src/src_lib/ ../../src/src_lib/bessel ../../src/math ../../src/src_mixing/ ../../src/src_mpi/ ../../src/src_mpi/routines/ ../../src/src_mpi/serial/ ../../src/src_optics/ ../../src/src_phonon/ ../../src/src_raman/ ../../src/src_rdmft/ ../../src/src_stm/ ../../src/src_sym/ ../../src/testframework ../../src/src_vdW/ ../../src/src_wannier ../../src/src_xc/ ../../src/src_xml/ ../../src/src_xs/ ../../src/src_xs/modtetra ../../src/src_xs/src_rttddft ../../src/wavefunctions ../../src/sirius ../../src/read ../../src/potential ../../src/file_io ../../src/matrix_elements ../../src/dfpt ../../external/libXC/src/libxc.f90 ../../external/libXC/src/libxc_funcs.f90 ../../src/mainxml/\
         && make -f Makefile.mkmf exciting
.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... Makefile.mkmf is ready.
make[3]: Entering directory `/nfs-share/home/1600011754/exciting/build/smp'
gfortran   -O3 -march=native -ffree-line-length-0  -cpp -DXS -DISO -DLIBXC -fopenmp -DUSEOMP -Ifinclude   -c    ../../src/file_io/block_data_file.f90
../../src/file_io/block_data_file.f90:3.6:

  use precision, only: dp
      1
Fatal Error: File 'precision.mod' opened at (1) is not a GNU Fortran module file
make[3]: *** [block_data_file.o] Error 1
make[3]: Leaving directory `/nfs-share/home/1600011754/exciting/build/smp'
make[2]: *** [bin] Error 2
make[2]: Leaving directory `/nfs-share/home/1600011754/exciting/build/smp'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/nfs-share/home/1600011754/exciting/build/smp'
make: *** [smp] Error 2

the ifort and gfortran versions are:

$ ifort --version
ifort (IFORT) 17.0.1 20161005
Copyright (C) 1985-2016 Intel Corporation.  All rights reserved.

$ gfortran --version
GNU Fortran (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
Copyright (C) 2015 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

I know little about Fortran and I’m not sure how I can solve these problems. Can anyone kindly help me? Thanks in advance!

Hi TaoYu,

Your ifort version is no longer supported by exciting. Check the INSTALL for a list of supported compilers:

Compiler Support
------------------

exciting requires an F2008-compliant compiler. exciting is known to compile with:

* Intel ifort: 2019, 2021
  
* GCC gfortran: 8, 9, 10, 12
  

Compliant but not tested:

* Intel: 2022

* GCC: 11

Youre GCC version definitely isn’t supported, version 4 is archaic. I’m assuming you’re on a cluster and not running linux on a desktop. But the GCC compilation actually failed because you forgot to make clean:

Fatal Error: File 'precision.mod' opened at (1) is not a GNU Fortran module

You can’t build part of the code with one compiler and part of the code with another.

Hope this clarifies the problems.
Cheers,
Alex

Hi Abuccheri,

Thank you so much! Yes I’m on a cluster. The compilers are indeed archaic. I’ll contact the supercomputer admin for further support. Thank you!