Clarification Request on Configuring DFT-D4 Support in VASP.

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


Moderators: Global Moderator, Moderator

Post Reply
Message
Author
hszhao.cn@gmail.com
Full Member
Full Member
Posts: 187
Joined: Tue Oct 13, 2020 11:32 pm

Clarification Request on Configuring DFT-D4 Support in VASP.

#1 Post by hszhao.cn@gmail.com » Tue Feb 27, 2024 12:25 pm

Dear VASP Forum Members,

I am currently setting up VASP with support for the DFT-D4 and have encountered some discrepancies in the setup instructions that I hope to clarify with your expertise.

On the VASP Wiki, specifically in the section dedicated to optional DFT-D4 configuration, the instructions provided are as follows:

Code: Select all

CPP_OPTIONS += -DDFTD4
DFTD4_ROOT ?= /path/to/your/dft4/installation
LLIBS += -L$(DFTD4_ROOT)/build -ldftd4
INCS += -I$(DFTD4_ROOT)/libdftd4.a.p
Conversely, the DFTD4 GitHub repository suggests a somewhat different approach for incorporating DFT-D4 support into VASP:

Code: Select all

CPP_OPTIONS += -DDFTD4
LLIBS += $(shell pkg-config --libs dftd4)
INCS += $(shell pkg-config --cflags dftd4)
Upon further reflection, there might be a slight oversight in the VASP Wiki's instructions, assuming the build directory name correctly corresponds to the compilation directory. A presumed correction would look something like this:

Code: Select all

CPP_OPTIONS += -DDFTD4
DFTD4_ROOT ?= /path/to/your/dft4/installation
LLIBS += -L$(DFTD4_ROOT)/build -ldftd4
INCS += -I$(DFTD4_ROOT)/build/libdftd4.a.p
Moreover, it seems the manual setting method advised by the VASP Wiki may offer less portability compared to the DFTD4 GitHub repository's recommendation, which leverages pkg-config to ascertain the necessary paths and flags automatically.

Your expert guidance on this matter would be immensely appreciated. Thank you very much for your time and assistance. I eagerly await your informed perspectives.

Best regards,
Zhao

merzuk.kaltak
Administrator
Administrator
Posts: 282
Joined: Mon Sep 24, 2018 9:39 am

Re: Clarification Request on Configuring DFT-D4 Support in VASP.

#2 Post by merzuk.kaltak » Tue Feb 27, 2024 2:05 pm

Dear Zhao,

thank you for your post. The documentation has been outdated.
I have updated the entry for the most recent version of dftd4, i.e. version 3.6.0.
We recommend following lines in makefile.include:

Code: Select all

 
CPP_OPTIONS += -DDFTD4 
DFTD4_ROOT  ?= /path/to/your/dft4/installation
# version 3.6.0 built and installed with meson
LLIBS       += $(shell pkg-config --with-path=$(DFTD4_ROOT)/lib64/pkgconfig --libs dftd4)                                                                                                                                                  
INCS        += $(shell pkg-config --with-path=$(DFTD4_ROOT)/lib64/pkgconfig --cflags dftd4)    
# version 3.6.0 and loaded dftd4 module, i.e. PKG_CONFIG_PATH environment variable set correctly
#LLIBS       += $(shell pkg-config --libs dftd4)
#INCS        += $(shell pkg-config --cflags dftd4)

Post Reply