VASP6 with D4 issue on Cray systems

Questions regarding the compilation of VASP on various platforms: hardware, compilers and libraries, etc.


Moderators: Global Moderator, Moderator

Post Reply
Message
Author
oliver_conquest
Newbie
Newbie
Posts: 11
Joined: Wed Dec 04, 2019 7:05 am

VASP6 with D4 issue on Cray systems

#1 Post by oliver_conquest » Tue Dec 19, 2023 7:02 am

Greetings!

I am attempting to install VASP6.4.1 with the DFT-D4 extension on a Cray EX system (AMD Milan architecture) but I am getting the following error:

Code: Select all

/usr/bin/ld: /home/oconquest/dftd4/build/lib64/libdftd4.a(rational.f90.o): undefined reference to symbol 'GOMP_loop_maybe_nonmonotonic_runtime_next@@GOMP_5.0'
/usr/bin/ld: /opt/cray/pe/gcc-libs/libgomp.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [makefile:132: vasp] Error 1
make[2]: Leaving directory '/home/oconquest/vasp.6.4.1-Custom/build/std'
cp: cannot stat 'vasp': No such file or directory
make[1]: *** [makefile:129: all] Error 1
make[1]: Leaving directory '/home/oconquest/vasp.6.4.1-Custom/build/std'
make: *** [makefile:17: std] Error 2
I am able to install the DFT-D4 package with cmake using the same Fortran compiler I use to compile VASP and it passes all the tests.
In order for VASP to recognize the DFT-D4 installation I append the pkgconfig folder to PKG_CONFIG_PATH.
I am using the following modules: GCC/12.2.0, craype/2.7.20 (wrapper module with Fortran compiler), openblas/0.3.21, netlib-scalapack/2.2.0, hdf5/1.12.2-api-v112 and fftw/3.3.10

I think the issue is due to either the GCC version or some linking issue.
Any assistance/insight into the issue is greatly appreciated :)

Here is my make.include file:

Code: Select all

CPP_OPTIONS = -DHOST=\"LinuxGNU\" \
              -DMPI -DMPI_BLOCK=8000 -Duse_collective \
              -DscaLAPACK \
              -DCACHE_SIZE=4000 \
              -Davoidalloc \
              -Dvasp6 \
              -Duse_bse_te \
              -Dtbdyn \
              -Dfock_dblbuf \
              -Dsol_compat

CPP         = gcc -E -C -w $*$(FUFFIX) >$*$(SUFFIX) $(CPP_OPTIONS)

FC          = ftn
FCL         = ftn

FREE        = -ffree-form -ffree-line-length-none

FFLAGS      = -w -ffpe-summary=none

OFLAG       = -O2
OFLAG_IN    = $(OFLAG)
DEBUG       = -O0

OBJECTS     = fftmpiw.o fftmpi_map.o fftw3d.o fft3dlib.o
OBJECTS_O1 += fftw3d.o fftmpi.o fftmpiw.o
OBJECTS_O2 += fft3dlib.o

# For what used to be vasp.5.lib
CPP_LIB     = $(CPP)
FC_LIB      = $(FC)
CC_LIB      = gcc
CFLAGS_LIB  = -O
FFLAGS_LIB  = -O1
FREE_LIB    = $(FREE)

OBJECTS_LIB = linpack_double.o

# For the parser library
CXX_PARS    = g++
LLIBS       = -lstdc++

##
## Customize as of this point! Of course you may change the preceding
## part of this file as well if you like, but it should rarely be
## necessary ...
##

# When compiling on the target machine itself, change this to the
# relevant target when cross-compiling for another architecture
VASP_TARGET_CPU ?= -march=znver3
FFLAGS     += $(VASP_TARGET_CPU)

# For gcc-10 and higher (comment out for older versions)
FFLAGS     += -fallow-argument-mismatch

# BLAS and LAPACK (mandatory)
OPENBLAS_ROOT ?= /software/setonix/2023.08/software/linux-sles15-zen3/gcc-12.2.0/openblas-0.3.21-af6tvcws5twsg2tyw6oxo3q2jxwnwooc
BLASPACK    = -L$(OPENBLAS_ROOT)/lib -lopenblas

# scaLAPACK (mandatory)
SCALAPACK_ROOT ?= /software/setonix/2023.08/software/linux-sles15-zen3/gcc-12.2.0/netlib-scalapack-2.2.0-f5zvd7dyet3th5tiizuig75hbqwshnte
SCALAPACK   = -L$(SCALAPACK_ROOT)/lib -lscalapack

LLIBS      += $(SCALAPACK) $(BLASPACK)

# FFTW (mandatory)
FFTW_ROOT  ?= /software/setonix/2023.08/software/linux-sles15-zen3/gcc-12.2.0/fftw-3.3.10-o2l6h6k4aujjws3btuuc2uvll7tr25k5
LLIBS      += -L$(FFTW_ROOT)/lib -lfftw3
INCS       += -I$(FFTW_ROOT)/include

# HDF5-support (optional but strongly recommended)
CPP_OPTIONS+= -DVASP_HDF5
HDF5_ROOT  ?= /software/setonix/2023.08/software/linux-sles15-zen3/gcc-12.2.0/hdf5-1.12.2-oaojh265x56ohdfcct3yyojx7beb5rqp
LLIBS      += -L$(HDF5_ROOT)/lib -lhdf5_fortran
INCS       += -I$(HDF5_ROOT)/include

#DFT-D4 for the D4 dispersion correction
CPP_OPTIONS += -DDFTD4
LLIBS       += $(shell pkg-config --libs dftd4)
INCS        += $(shell pkg-config --cflags dftd4)

# For the VASP-2-Wannier90 interface (optional)
#CPP_OPTIONS    += -DVASP2WANNIER90
#WANNIER90_ROOT ?= /path/to/your/wannier90/installation
#LLIBS          += -L$(WANNIER90_ROOT)/lib -lwannier

pedro_melo
Global Moderator
Global Moderator
Posts: 132
Joined: Thu Nov 03, 2022 1:03 pm

Re: VASP6 with D4 issue on Cray systems

#2 Post by pedro_melo » Tue Dec 19, 2023 6:37 pm

Dear oliver_conquest,

A colleague of mine was able to install VASP with support for DFT D4. I think that the relevant flags in his makefile.include that might help you are the following

# For the dftd4 interface (optional)
CPP_OPTIONS += -DDFTD4
LLIBS += -L/home/user/dftd4/_build -ldftd4
LLIBS += -L/home/user/dftd4/_build/_deps/mctc-lib-build/ -lmctc-lib
LLIBS += -L/home/user/dftd4/_build/_deps/multicharge-build/ -lmulticharge
INCS += -I/home/user/dftd4/_build/include

Could you try recompiling VASP with the appropriate replacements in the lines above and let me know how it went?

Kind regards,
Pedro Melo

oliver_conquest
Newbie
Newbie
Posts: 11
Joined: Wed Dec 04, 2019 7:05 am

Re: VASP6 with D4 issue on Cray systems

#3 Post by oliver_conquest » Wed Dec 20, 2023 12:38 am

Dear Pedro,

I attempted to recompile VASP with those flags but it returned the same error. The error has something to do with the GCC GNU compiler library.
I will attempt to use a different version of GCC to see if this solves the issue.

Here is my error this time around:

Code: Select all

-Llib -ldmy -Lparser -lparser -lstdc++ -L/software/setonix/2023.08/software/linux-sles15-zen3/gcc-12.2.0/netlib-scalapack-2.2.0-f5zvd7dyet3th5tiizuig75hbqwshnte/lib -lscalapack -L/software/setonix/2023.08/software/linux-sles15-zen3/gcc-12.2.0/openblas-0.3.21-af6tvcws5twsg2tyw6oxo3q2jxwnwooc/lib -lopenblas -L/software/setonix/2023.08/software/linux-sles15-zen3/gcc-12.2.0/fftw-3.3.10-o2l6h6k4aujjws3btuuc2uvll7tr25k5/lib -lfftw3 -L/software/setonix/2023.08/software/linux-sles15-zen3/gcc-12.2.0/hdf5-1.12.2-oaojh265x56ohdfcct3yyojx7beb5rqp/lib -lhdf5_fortran -L/home/oconquest/dftd4/_build -ldftd4 -L/home/oconquest/dftd4/_build/_deps/mctc-lib-build/ -lmctc-lib -L/home/oconquest/dftd4/_build/_deps/multicharge-build/ -lmulticharge 
/usr/bin/ld: /home/oconquest/dftd4/_build/libdftd4.a(rational.f90.o): undefined reference to symbol 'GOMP_loop_maybe_nonmonotonic_runtime_next@@GOMP_5.0'
/usr/bin/ld: /opt/cray/pe/gcc-libs/libgomp.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [makefile:132: vasp] Error 1
make[2]: Leaving directory '/home/oconquest/vasp.6.4.1-Custom/build/std'
cp: cannot stat 'vasp': No such file or directory
make[1]: *** [makefile:129: all] Error 1
make[1]: Leaving directory '/home/oconquest/vasp.6.4.1-Custom/build/std'
make: *** [makefile:17: std] Error 2
Cheers,
Ollie

oliver_conquest
Newbie
Newbie
Posts: 11
Joined: Wed Dec 04, 2019 7:05 am

Re: VASP6 with D4 issue on Cray systems

#4 Post by oliver_conquest » Wed Dec 20, 2023 9:19 am

Dear Pedro,

Many thanks for your help!
I managed to solve the issue, it was because I was not correctly linking to openmp. Including -D_OPENMP, -fopenmp and -lfftw3_omp in the makefile solved the problem.

Here is the makefile.include file for anyone else having a similar issue:

Code: Select all

CPP_OPTIONS = -DHOST=\"LinuxGNU\" \
              -DMPI -DMPI_BLOCK=8000 -Duse_collective \
              -DscaLAPACK \
              -DCACHE_SIZE=4000 \
              -Davoidalloc \
              -Dvasp6 \
              -Duse_bse_te \
              -Dtbdyn \
              -Dfock_dblbuf \
              -D_OPENMP \
              -Dsol_compat

CPP         = gcc -E -C -w $*$(FUFFIX) >$*$(SUFFIX) $(CPP_OPTIONS)

FC          = ftn -fopenmp
FCL         = $(FC)

FREE        = -ffree-form -ffree-line-length-none

FFLAGS      = -w -ffpe-summary=none

OFLAG       = -O2
OFLAG_IN    = $(OFLAG)
DEBUG       = -O0

OBJECTS     = fftmpiw.o fftmpi_map.o fftw3d.o fft3dlib.o
OBJECTS_O1 += fftw3d.o fftmpi.o fftmpiw.o
OBJECTS_O2 += fft3dlib.o

# For what used to be vasp.5.lib
CPP_LIB     = $(CPP)
FC_LIB      = $(FC)
CC_LIB      = gcc
CFLAGS_LIB  = -O
FFLAGS_LIB  = -O1
FREE_LIB    = $(FREE)

OBJECTS_LIB = linpack_double.o

# For the parser library
CXX_PARS    = g++
LLIBS       = -lstdc++

##
## Customize as of this point! Of course you may change the preceding
## part of this file as well if you like, but it should rarely be
## necessary ...
##

# When compiling on the target machine itself, change this to the
# relevant target when cross-compiling for another architecture
VASP_TARGET_CPU ?= -march=znver3
FFLAGS     += $(VASP_TARGET_CPU)

# For gcc-10 and higher (comment out for older versions)
FFLAGS     += -fallow-argument-mismatch

# BLAS and LAPACK (mandatory)
OPENBLAS_ROOT ?= /software/setonix/2023.08/software/linux-sles15-zen3/gcc-12.2.0/openblas-0.3.21-af6tvcws5twsg2tyw6oxo3q2jxwnwooc
BLASPACK    = -L$(OPENBLAS_ROOT)/lib -lopenblas

# scaLAPACK (mandatory)
SCALAPACK_ROOT ?= /software/setonix/2023.08/software/linux-sles15-zen3/gcc-12.2.0/netlib-scalapack-2.2.0-f5zvd7dyet3th5tiizuig75hbqwshnte
SCALAPACK   = -L$(SCALAPACK_ROOT)/lib -lscalapack

LLIBS      += $(SCALAPACK) $(BLASPACK)

# FFTW (mandatory)
FFTW_ROOT  ?= /software/setonix/2023.08/software/linux-sles15-zen3/gcc-12.2.0/fftw-3.3.10-o2l6h6k4aujjws3btuuc2uvll7tr25k5
LLIBS      += -L$(FFTW_ROOT)/lib -lfftw3 -lfftw3_omp
INCS       += -I$(FFTW_ROOT)/include

# HDF5-support (optional but strongly recommended)
CPP_OPTIONS+= -DVASP_HDF5
HDF5_ROOT  ?= /software/setonix/2023.08/software/linux-sles15-zen3/gcc-12.2.0/hdf5-1.12.2-oaojh265x56ohdfcct3yyojx7beb5rqp
LLIBS      += -L$(HDF5_ROOT)/lib -lhdf5_fortran
INCS       += -I$(HDF5_ROOT)/include

# For the dftd4 interface (optional)
CPP_OPTIONS += -DDFTD4
DFTD4_ROOT  ?= /home/oconquest/dftd4/build
LLIBS += -L$(DFTD4_ROOT)/lib64 -ldftd4 -lmulticharge -lmctc-lib -lmstore
INCS += -I$(DFTD4_ROOT)/include \
	-I$(DFTD4_ROOT)/include/dftd4/GNU-12.2.0 \
	-I$(DFTD4_ROOT)/include/mctc-lib/GNU-12.2.0 \
	-I$(DFTD4_ROOT)/include/mstore/GNU-12.2.0 \
	-I$(DFTD4_ROOT)/include/multicharge/GNU-12.2.0

# For the VASP-2-Wannier90 interface (optional)
#CPP_OPTIONS    += -DVASP2WANNIER90
#WANNIER90_ROOT ?= /path/to/your/wannier90/installation
#LLIBS          += -L$(WANNIER90_ROOT)/lib -lwannier

Post Reply