Compilation error exciting_oxygen on Ubuntu

Hello everyone,

I am trying to compile exciting_oxygen on my mac, using parallels.
On my parallels desktop I have Ubuntu 20.04.1 LTS and this is where I am trying to install exciting_oxygen. I have followed the steps on the exciting website for compilation, however when I type in make smp I get the following error:

make[3]: Entering directory ‘/home/parallels/Documents/EXCITING/exciting_oxygen/exciting/build/smp’
Makefile.mkmf:3905: warning: overriding recipe for target ‘version.inc’
Makefile.mkmf:2631: warning: ignoring old recipe for target ‘version.inc’
gfortran -O3 -march=native -ffree-line-length-0 -cpp -DXS -DISO -DLIBXC -fopenmp -DUSEOMP -Ifinclude -c …/…/src/errors_warnings/trace.F90
gfortran -O3 -march=native -ffree-line-length-0 -cpp -DXS -DISO -DLIBXC -fopenmp -DUSEOMP -Ifinclude -c …/…/src/src_mpi/modmpi.F90
gfortran -O3 -march=native -ffree-line-length-0 -cpp -DXS -DISO -DLIBXC -fopenmp -DUSEOMP -Ifinclude -c …/…/src/constants/unit_conversion.f90
gfortran -O3 -march=native -ffree-line-length-0 -cpp -DXS -DISO -DLIBXC -fopenmp -DUSEOMP -Ifinclude -c …/…/src/mod_APW_LO.F90
…/…/src/mod_APW_LO.F90:87:10:

87 | Use modinput
| 1
Fatal Error: Cannot open module file ‘modinput.mod’ for reading at (1): No such file or directory
compilation terminated.
make[3]: *** [Makefile.mkmf:962: mod_APW_LO.o] Error 1
make[3]: Leaving directory ‘/home/parallels/Documents/EXCITING/exciting_oxygen/exciting/build/smp’
make[2]: *** […/Make.common:59: bin] Error 2
make[2]: Leaving directory ‘/home/parallels/Documents/EXCITING/exciting_oxygen/exciting/build/smp’
make[1]: *** [Makefile:11: all] Error 2
make[1]: Leaving directory ‘/home/parallels/Documents/EXCITING/exciting_oxygen/exciting/build/smp’
make: *** [Makefile:23: smp] Error 2

and then the compilation stops. Using the gfortran --version command I see that I get GNU Fortran (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
as the version of gfortran that I am using.
Any help with the compilation will be highly appreciated.

Kind regards,
Louis Maduro

Hi Louis,

modinput is auto-generated from the schema using xsltproc. Can you check you have xsltproc installed?

You can see the expected files (modinput is in inputmodules.f90) in Make.common:

GeneratedFiles = ../../src/src_inputparser/inputmodules.f90 ../../src/src_inputparser/speciesmodules.f90
...
xsltproc ../../xml/schematofortran.xsl   ../../xml/excitinginput.xsd > ../../src/src_inputparser/inputmodules.f90

If you’re still having problems, I’m currently working on a docker build for Ubuntu. I should have some more insight in a couple of weeks.

More to the point, a) you don’t need to use Parallels, exciting is compilable on mac and b) a virtual machine will be very slow. You’re much better off using docker. We provide several base Dockerfiles in
build/utilities/docker

Cheers,
Alex

Dear Alex,

Thanks for the fast reply. I checked and indeed xsltproc was not installed. I used sudo apt install to install xsltproc and then tried to recompile, however I get the same error.

Concerning compilation on mac:
I followed the steps and tried to compile using make serial, however I got the following error:

checking for which C type corresponds to Fortran integer… configure: error: in `/Home/Documents/EXCITING/exciting/src/libXC’:

configure: error: C program failed to find the C type of a Fortran integer

See `config.log’ for more details

make[2]: *** [lib/libxc.a] Error 1

make[1]: *** [all] Error 2

make: *** [serial] Error 2

The make.inc file has the following lines:

FCC = gcc
CPP = gfortran
FCCPP = gfortran
F90 = gfortran
F77 = $(F90)
F90_OPTS = -O3 -fopenmp -DUSEOMP -ffree-line-length-0
F77_OPTS = $(F90_OPTS)
CPP_ON_OPTS = -cpp -DXS -DISO -DLIBXC
LIB_ARP = libarpack.a
# uncomment this line in case you want to use external LAPACK/BLAS library
#export USE_SYS_LAPACK=true
LIB_LPK = -L./ -llapack -lblas
LIB_FFT = fftlib.a
LIB_BZINT = libbzint.a

LIBS = $(LIB_ARP) $(LIB_LPK) $(LIB_FFT) $(LIB_BZINT)

F90_DEBUGOPTS = -g -fbounds-check -fbacktrace -Wall
F77_DEBUGOPTS = $(F90_DEBUGOPTS)

#Ignore if you don't have MPI or smplibs

MPIF90 = mpif90
MPIF90_OPTS = $(F90_OPTS) $(CPP_ON_OPTS) -DMPI -DMPIRHO -DMPISEC
F77MT = $(F77)
F90MT = $(F90)
SMP_LIBS = $(LIBS)
SMPF90_OPTS = -fopenmp $(F90_OPTS)
SMPF77_OPTS = $(SMPF90_OPTS)

BUILDMPI=false
BUILDSMP=false
BUILDMPI = false

Again, thanks for the help.
Kind regards,
Louis

Hi Luigi,

W.r.t. compiling on Ubuntu. A couple of group members had exactly the same problem. The hacky way of solving it is to scrap the exciting folder and clone it again, then try building (having installed xsltproc first). I guess something is persisting even after make clean. Let me know if this works.

W.r.t. building on mac, it does not look like you’ve looked at the document or existing make.inc for Mac. I’m guessing the problem is FCCPP=gfortran. Replace with FCCPP=cpp. This is specified in the make.inc: # Required for compilation of LibXC. Maybe I should make that more explicit that LibXC must be compiled with the C preprocessor.

More generally, you should specify which Mac OS you’re on. But in general, I can’t provide support for multiple Mac OS’s as I do not have a means of testing builds on them. Sorry about that.

Cheers,
Alex

Hi Alex,

W.r.t. Ubuntu: using your suggestion of scrapping the directory and using a new folder (with xsltproc already installed) has led to succesful compilation of the code, thank you for the advice!

W.r.t. compilation on mac: I am now using MacOS Monterey 12.4. I tried doing the same thing with the mac compilation(deleting the folder and trying to compile in a new folder) with the make.inc template for mac gfortran ( the command “gfortran --version” gives “GNU Fortran (Homebrew GCC 11.2.0) 11.2.0” ). However, now the error is something else.
The error now given is

gfortran -O3 -fopenmp -DUSEOMP -ffree-line-length-0 -c …/…/src/LAPACK/zgelss.f
…/…/src/LAPACK/zgelss.f:485:40:

288 | CALL ZGEBRD( MM, N, A, LDA, S, DUM(1), DUM(1),
| 2

485 | CALL ZGEBRD( MM, N, A, LDA, S, RWORK( IE ), WORK( ITAUQ ),
| 1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/COMPLEX(8)).
…/…/src/LAPACK/zgelss.f:587:51:

288 | CALL ZGEBRD( MM, N, A, LDA, S, DUM(1), DUM(1),
| 2

587 | CALL ZGEBRD( M, M, WORK( IL ), LDWORK, S, RWORK( IE ),
| 1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/COMPLEX(8)).
…/…/src/LAPACK/zgelss.f:682:39:

288 | CALL ZGEBRD( MM, N, A, LDA, S, DUM(1), DUM(1),
| 2

682 | CALL ZGEBRD( M, N, A, LDA, S, RWORK( IE ), WORK( ITAUQ ),
| 1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/COMPLEX(8)).
make[3]: *** [zgelss.o] Error 1
make[2]: *** [liblapack.a] Error 2
make[1]: *** [all] Error 2
make: *** [serial] Error 2

I understand the build problem, it seems that trying to compile other DFT codes (such as WIEN2k) also prove to be problematic on macs.

Kind regards,
Luigi

This is nothing to do with Mac, and is indeed documented in the README, the gfortran template and build/platforms/os_mac/README.md

At the time of writing, GCC 11 didn’t exist. I need to update it to say

GCC 10 and above

# Example make.inc file for GCC
#
# NOTE: If compiling with GCC 10 append F90_OPTS and F90_DEBUGOPTS with:
# -fallow-argument-mismatch
# See here for more details: https://gcc.gnu.org/gcc-10/porting_to.html

Note, this should also be applied to the F77 flags.

With that said, I can’t test with GCC 11 with MacOS Monterey 12.4 so if you run into problems I haven’t seen, I can’t help.

Cheers,
Alex

Hi everyone,
I am also facing problem while compiling the exciting oxygen file in ubantu. I have gone through all the processes that are suggested above, but I am still facing the error. If someone could guide me how to proceed ahead, I will be extremely grateful. The error and make.inc file are as follows:

make[3]: Entering directory '/home/tutorials/exciting/build/serial'
gfortran -O3 -march=native -ffree-line-length-0 -cpp -DXS -DISO -DLIBXC -I./finclude   -c	../../src/fftlib/cfftnd.f90
../../src/fftlib/cfftnd.f90:573:72:

  573 |      call cmf2kf ( lot, ido, l1, na, c, jump, inc, ch, 1, lot, wa(iw) )
      |                                                                       1

Error: Type mismatch in argument ‘cc’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:575:72:

  575 |      call cmf2kf ( lot, ido, l1, na, ch, 1, lot, c, jump, inc, wa(iw) )
      |                                                                       1

Error: Type mismatch in argument ‘ch’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:577:72:

  577 |      call cmf3kf ( lot, ido, l1, na, c, jump, inc, ch, 1, lot, wa(iw) )
      |                                                                       1

Error: Type mismatch in argument ‘cc’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:579:72:

  579 |      call cmf3kf ( lot, ido, l1, na, ch, 1, lot, c, jump, inc, wa(iw) )
      |                                                                       1

Error: Type mismatch in argument ‘ch’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:581:72:

  581 |      call cmf4kf ( lot, ido, l1, na, c, jump, inc, ch, 1, lot, wa(iw) )
      |                                                                       1

Error: Type mismatch in argument ‘cc’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:583:72:

  583 |      call cmf4kf ( lot, ido, l1, na, ch, 1, lot, c, jump, inc, wa(iw) )
      |                                                                       1

Error: Type mismatch in argument ‘ch’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:585:72:

  585 |      call cmf5kf ( lot, ido, l1, na, c, jump, inc, ch, 1, lot, wa(iw) )
      |                                                                       1

Error: Type mismatch in argument ‘cc’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:587:72:

  587 |      call cmf5kf ( lot, ido, l1, na, ch, 1, lot, c, jump, inc, wa(iw) )
      |                                                                       1

Error: Type mismatch in argument ‘ch’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:590:24:

  590 |         1, lot, wa(iw) )
      |                        1
Error: Type mismatch in argument ‘cc’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:593:27:

  593 |         jump, inc, wa(iw) )
      |                           1
Error: Type mismatch in argument ‘ch’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:470:72:

  470 |      call cmf2kb ( lot, ido, l1, na, c, jump, inc, ch, 1, lot, wa(iw) )
      |                                                                       1

Error: Type mismatch in argument ‘cc’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:472:72:

  472 |      call cmf2kb ( lot, ido, l1, na, ch, 1, lot, c, jump, inc, wa(iw) )
      |                                                                       1

Error: Type mismatch in argument ‘ch’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:474:72:

  474 |      call cmf3kb ( lot, ido, l1, na, c, jump, inc, ch, 1, lot, wa(iw) )
      |                                                                       1

Error: Type mismatch in argument ‘cc’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:476:72:

  476 |      call cmf3kb ( lot, ido, l1, na, ch, 1, lot, c, jump, inc, wa(iw) )
      |                                                                       1

Error: Type mismatch in argument ‘ch’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:478:72:

  478 |      call cmf4kb ( lot, ido, l1, na, c, jump, inc, ch, 1, lot, wa(iw) )
      |                                                                       1

Error: Type mismatch in argument ‘cc’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:480:72:

  480 |      call cmf4kb ( lot, ido, l1, na, ch, 1, lot, c, jump, inc, wa(iw) )
      |                                                                       1

Error: Type mismatch in argument ‘ch’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:482:72:

  482 |      call cmf5kb ( lot, ido, l1, na, c, jump, inc, ch, 1, lot, wa(iw) )
      |                                                                       1

Error: Type mismatch in argument ‘cc’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:484:72:

  484 |      call cmf5kb ( lot, ido, l1, na, ch, 1, lot, c, jump, inc, wa(iw) )
      |                                                                       1

Error: Type mismatch in argument ‘ch’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:487:24:

  487 |         1, lot, wa(iw) )
      |                        1
Error: Type mismatch in argument ‘cc’ at (1); passed COMPLEX(8) to REAL(8)
../../src/fftlib/cfftnd.f90:490:27:

  490 |         jump, inc, wa(iw) )
      |                           1
Error: Type mismatch in argument ‘ch’ at (1); passed COMPLEX(8) to REAL(8)
make[3]: *** [Makefile.fft:10: cfftnd.o] Error 1
make[3]: Leaving directory '/home/tutorials/exciting/build/serial'
make[2]: *** [../Make.common:159: fftlib.a] Error 2
make[2]: Leaving directory '/home/tutorials/exciting/build/serial'
make[1]: *** [Makefile:3: all] Error 2
make[1]: Leaving directory '/home/tutorials/exciting/build/serial'
make: *** [Makefile:20: serial] Error 2
The make.inc files is :

# Example make.inc file for GCC
#
# NOTE: If compiling with GCC 10 append F90_OPTS and F90_DEBUGOPTS with: 
#  -fallow-argument-mismatch
# See here for more details: https://gcc.gnu.org/gcc-10/porting_to.html

# Compiler, flags and preprocessing variables
F90 = gfortran
F90_OPTS = -O3 -march=native -ffree-line-length-0
CPP_ON_OPTS = -cpp -DXS -DISO -DLIBXC
F77 = $(F90)
F77_OPTS = -O3
# Required for compilation of LibXC 
FCCPP = cpp

F90_DEBUGOPTS = -g -O0 -DUSE_ASSERT -fbounds-check -fbacktrace -Wall -Wextra -ffree-line-length-0 -fcheck=all -finit-integer=2147483647 -finit-real=snan \
-frecord-gcc-switches -finit-character=42 -finit-logical=true -ffpe-trap=invalid,zero,overflow -fdump-core -fstack-protector-all -pipe
# Unusable debug flags: -pedantic 
F77_DEBUGOPTS = $(F90_DEBUGOPTS)

# If compiling on mac, one may need to specify the location of the openMP header file.
# For example, if using Macports it may look like:
# INCL = -I/opt/local/lib/gcc10/gcc/x86_64-apple-darwin19/10.2.0/finclude/
INCL = 

# Libaries
LIB_ARP = libarpack.a
# Use native blas/lapack by default
export USE_SYS_LAPACK=true
LIB_LPK = -L./ -llapack -lblas
LIB_FFT = fftlib.a
LIB_BZINT = libbzint.a
LIBS = $(LIB_ARP) $(LIB_LPK) $(LIB_FFT) $(LIB_BZINT)

# SMP and MPI compilers, flags and preprocessing variables
MPIF90 = mpif90
MPIF90_OPTS = -DMPI
MPI_LIBS =

# To use Scalapack, include the preprocessing variable, provide the library path and library name 
#MPIF90_OPTS = -DMPI -DSCAL
#MPI_LIBS = -L/opt/local/lib/ -lscalapack

SMPF90_OPTS = -fopenmp -DUSEOMP
SMPF77_OPTS = $(SMPF90_OPTS)
SMP_LIBS = 

BUILDMPI = true
BUILDSMP = true
BUILDMPISMP = true

@Paritosh_Singh This thread has already answered the problem. It is also explicitly written in the make.inc file you’ve posted:

NOTE: If compiling with GCC 10 append F90_OPTS and F90_DEBUGOPTS with: 
  -fallow-argument-mismatch
 See here for more details: https://gcc.gnu.org/gcc-10/porting_to.html

Cheers,
Alex