LIBXC 4.0 support for CP2K-5.1 (Patch)

Andreas Glöss andreas... at gmail.com
Tue Feb 6 16:46:58 UTC 2018


Dear CP2K users and developers,

Since we got several requests for LIBXC-4.0 support for the current release 
of CP2K (5.1), a patch has been prepared (Thanks to Axel Kohlmeyer).
You can fetch the patch directly from here:

https://www.cp2k.org/static/downloads/patches/patch_cp2k-5.1_libxc-4.0.4-support.diff

To apply the patch follow this procedure:

   - Download and compile LIBXC-4.0 (see eg.: 
   http://octopus-code.org/wiki/Libxc_4.0.4)
   - Checkout CP2K-5.1: 
   svn checkout -r 18095 http://svn.code.sf.net/p/cp2k/code/branches/cp2k-5_1-branch/cp2k 
   cp2k-5.1
   - Change directory: 
   cd cp2k-5.1
   - Get patch: 
   wget https:
   //www.cp2k.org/static/downloads/patches/patch_cp2k-5.1_libxc-4.0.4-support.diff
   - Apply patch: 
   patch -p 0 < patch_cp2k-5.1_libxc-4.0.4-support.diff
   - Adapt your ARCH-file:
      - Change the DFLAGS, eg. 
      DFLAGS += -D__LIBXC 
      - Change LIBXCs include directory in CFLAGS and FCFLAGS, eg. 
      CFLAGS += -I'/my_local_libxc4_installation/include'
      - Change LIBXCs library directory in LDFLAGS, eg. 
      LDFLAGS += -L'/my_local_libxc4_installation/lib'
      Note, on some architectures this directory is called lib64.
      - Change LIBXCs interface in LIBS, eg. 
      LIBS += -lxcf03 -lxc
      
      - Compile as usual ...

Please note that this patch comes with some features and drawbacks listed 
below.

Features:

   - &LIBXC section is repeatable.
   - Only one functional per &LIBXC section.
   - Optional PARAMETERS and SCALE keywords are private to the functional - 
   formerly they could have been mixed.
   - A lot of bug-fixes and new functionals.

Drawbacks:

   - New input is not backward compatible.


To visualize the input changes, here is one example (first old, followed by 
new syntax):

&XC_FUNCTIONAL
  &LIBXC
    FUNCTIONAL XC_GGA_X_PBE XC_GGA_C_PBE
  &END LIBXC
&END XC_FUNCTIONAL

&XC_FUNCTIONAL
  &LIBXC
    FUNCTIONAL XC_GGA_X_PBE
  &END LIBXC
  &LIBXC
    FUNCTIONAL XC_GGA_C_PBE
  &END LIBXC
&END XC_FUNCTIONAL 


Best regards and hope this is useful to others,
Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20180206/5226f0c8/attachment.htm>


More information about the CP2K-user mailing list