<div dir="ltr">Hi Andreas,<br><br>I think this post is very useful, especially for someone want to use some newest functionals in libxc.<br><br>I have a problem when compiling cp2k following your guide. Please see the error below.<br><br>mpifort -O0 -xHost -pc64 -unroll -heap-arrays 64  -I/home/chp071/Codes/install-libint-1.1.4/bin/include -I/home/chp071/Codes/install-libxc-4.0.4/include -L/home/chp071/lib -L/opt/intel/composer_xe_2013_sp1.2.144/mkl/lib/intel64 -L/home/chp071/Codes/install-libint-1.1.4/bin/lib -L/home/chp071/Codes/install-libxc-4.0.4/lib -L/home/chp071/Codes/cp2k-5.1/lib/Linux-ia64-intel_xc404/popt -o /home/chp071/Codes/cp2k-5.1/exe/Linux-ia64-intel_xc404/cp2k.popt cp2k.o  -lcp2kstart -lcp2kmc -lcp2kswarm -lcp2kmotion -lcp2kthermostat -lcp2kemd -lcp2ktmc -lcp2kmain -ldbcsrarnoldi -ldbcsrx -lcp2kshg_int -lcp2keri_mme -lcp2kminimax -lcp2khfxbase -lcp2ksubsys -lcp2kxc -lcp2kao -lcp2kinput -lcp2kpw -lcp2kfft -lcp2kdbcsr_tensor -ldbcsr -ldbcsrmm -ldbcsrops -ldbcsrbblock -ldbcsrbdist -ldbcsrbase -ldbcsrdata -lmicsmm -lclsmm -lcp2kacc -lcp2kaccmic -lcp2kaccopencl -lcp2kfm -lcp2kcommon -lcp2kmpiwrap -lcp2kgrid -lcp2kbase /opt/fftw/3.3.4/intel/openmpi_ib/lib/libfftw3.a /opt/intel/composer_xe_2013_sp1.2.144/mkl/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group /opt/intel/composer_xe_2013_sp1.2.144/mkl/lib/intel64/libmkl_intel_lp64.a /opt/intel/composer_xe_2013_sp1.2.144/mkl/lib/intel64/libmkl_core.a /opt/intel/composer_xe_2013_sp1.2.144/mkl/lib/intel64/libmkl_sequential.a -Wl,--end-group /opt/intel/composer_xe_2013_sp1.2.144/mkl/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread /home/chp071/Codes/install-libint-1.1.4/bin/lib/libderiv.a /home/chp071/Codes/install-libint-1.1.4/bin/lib/libint.a /home/chp071/Codes/install-libxc-4.0.4/lib/libxcf90.a /home/chp071/Codes/install-libxc-4.0.4/lib/libxc.a<br>ipo: warning #11060: /home/chp071/Codes/cp2k-5.1/lib/Linux-ia64-intel_xc404/popt/libmicsmm.a is an archive, but has no symbols (this can happen if ar is used where xiar is needed)<br>ipo: warning #11060: /home/chp071/Codes/cp2k-5.1/lib/Linux-ia64-intel_xc404/popt/libclsmm.a is an archive, but has no symbols (this can happen if ar is used where xiar is needed)<br>ipo: warning #11060: /home/chp071/Codes/cp2k-5.1/lib/Linux-ia64-intel_xc404/popt/libcp2kaccmic.a is an archive, but has no symbols (this can happen if ar is used where xiar is needed)<br>ipo: warning #11060: /home/chp071/Codes/cp2k-5.1/lib/Linux-ia64-intel_xc404/popt/libcp2kaccopencl.a is an archive, but has no symbols (this can happen if ar is used where xiar is needed)<br>/home/chp071/Codes/cp2k-5.1/lib/Linux-ia64-intel_xc404/popt/libcp2kxc.a(xc_libxc.o): In function `xc_libxc_mp_libxc_lda_info_':<br>xc_libxc.f90:(.text+0x2ad): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_init_'<br>xc_libxc.f90:(.text+0x2c6): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_get_info_'<br>xc_libxc.f90:(.text+0x2f5): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_name_'<br>xc_libxc.f90:(.text+0x325): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_kind_'<br>xc_libxc.f90:(.text+0x8da): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_family_'<br>xc_libxc.f90:(.text+0xb15): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_family_'<br>xc_libxc.f90:(.text+0xcc5): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_end_'<br>/home/chp071/Codes/cp2k-5.1/lib/Linux-ia64-intel_xc404/popt/libcp2kxc.a(xc_libxc.o): In function `xc_libxc_mp_libxc_lsd_info_':<br>xc_libxc.f90:(.text+0xf77): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_init_'<br>xc_libxc.f90:(.text+0xf90): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_get_info_'<br>xc_libxc.f90:(.text+0xfbf): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_name_'<br>xc_libxc.f90:(.text+0xfef): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_kind_'<br>xc_libxc.f90:(.text+0x15a4): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_family_'<br>xc_libxc.f90:(.text+0x17fe): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_family_'<br>xc_libxc.f90:(.text+0x19ae): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_end_'<br>/home/chp071/Codes/cp2k-5.1/lib/Linux-ia64-intel_xc404/popt/libcp2kxc.a(xc_libxc.o): In function `xc_libxc_mp_libxc_lda_eval_':<br>xc_libxc.f90:(.text+0x1ee8): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_init_'<br>xc_libxc.f90:(.text+0x1f01): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_get_info_'<br>xc_libxc.f90:(.text+0x2739): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_family_'<br>xc_libxc.f90:(.text+0x2e0b): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_family_'<br>xc_libxc.f90:(.text+0x32b2): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_family_'<br>xc_libxc.f90:(.text+0x3b32): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_end_'<br>/home/chp071/Codes/cp2k-5.1/lib/Linux-ia64-intel_xc404/popt/libcp2kxc.a(xc_libxc.o): In function `xc_libxc_mp_libxc_lsd_eval_':<br>xc_libxc.f90:(.text+0x40c4): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_init_'<br>xc_libxc.f90:(.text+0x40dd): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_get_info_'<br>xc_libxc.f90:(.text+0x512e): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_family_'<br>xc_libxc.f90:(.text+0x5e66): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_family_'<br>xc_libxc.f90:(.text+0x6d37): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_family_'<br>xc_libxc.f90:(.text+0x8493): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_end_'<br>/home/chp071/Codes/cp2k-5.1/lib/Linux-ia64-intel_xc404/popt/libcp2kxc.a(xc_libxc.o): In function `xc_libxc_mp_libxc_lda_calc_':<br>xc_libxc.f90:(.text+0x85b3): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_init_'<br>xc_libxc.f90:(.text+0x85cc): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_get_info_'<br>xc_libxc.f90:(.text+0x8616): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_family_'<br>xc_libxc.f90:(.text+0x8700): undefined reference to `xc_f03_lib_m_mp_xc_f03_lda_exc_'<br>xc_libxc.f90:(.text+0x8848): undefined reference to `xc_f03_lib_m_mp_xc_f03_lda_vxc_'<br>xc_libxc.f90:(.text+0x8988): undefined reference to `xc_f03_lib_m_mp_xc_f03_lda_exc_vxc_'<br>xc_libxc.f90:(.text+0x8b26): undefined reference to `xc_f03_lib_m_mp_xc_f03_lda_fxc_'<br>xc_libxc.f90:(.text+0x8c60): undefined reference to `xc_f03_lib_m_mp_xc_f03_lda_exc_vxc_'<br>xc_libxc.f90:(.text+0x8c9e): undefined reference to `xc_f03_lib_m_mp_xc_f03_lda_fxc_'<br>xc_libxc.f90:(.text+0x8e8c): undefined reference to `xc_f03_lib_m_mp_xc_f03_lda_kxc_'<br>xc_libxc.f90:(.text+0x8fed): undefined reference to `xc_f03_lib_m_mp_xc_f03_lda_'<br>xc_libxc.f90:(.text+0x92c0): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_exc_'<br>xc_libxc.f90:(.text+0x94b2): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_vxc_'<br>xc_libxc.f90:(.text+0x970e): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_vxc_'<br>xc_libxc.f90:(.text+0x97dd): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_exc_vxc_'<br>xc_libxc.f90:(.text+0x9ab3): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_vxc_'<br>xc_libxc.f90:(.text+0x9b30): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_fxc_'<br>xc_libxc.f90:(.text+0x9bb6): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_exc_vxc_'<br>xc_libxc.f90:(.text+0x9c37): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_fxc_'<br>xc_libxc.f90:(.text+0x9f17): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_vxc_'<br>xc_libxc.f90:(.text+0x9f94): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_fxc_'<br>xc_libxc.f90:(.text+0xa067): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_exc_vxc_'<br>xc_libxc.f90:(.text+0xa0e8): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_fxc_'<br>xc_libxc.f90:(.text+0xa603): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_exc_'<br>xc_libxc.f90:(.text+0xa91f): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_vxc_'<br>xc_libxc.f90:(.text+0xad45): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_vxc_'<br>xc_libxc.f90:(.text+0xae4d): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_exc_vxc_'<br>xc_libxc.f90:(.text+0xb2dd): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_vxc_'<br>xc_libxc.f90:(.text+0xb3cf): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_fxc_'<br>xc_libxc.f90:(.text+0xb502): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_'<br>xc_libxc.f90:(.text+0xbb87): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_vxc_'<br>xc_libxc.f90:(.text+0xbc79): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_fxc_'<br>xc_libxc.f90:(.text+0xbdf9): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_'<br>xc_libxc.f90:(.text+0xc544): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_end_'<br>/home/chp071/Codes/cp2k-5.1/lib/Linux-ia64-intel_xc404/popt/libcp2kxc.a(xc_libxc.o): In function `xc_libxc_mp_libxc_lsd_calc_':<br>xc_libxc.f90:(.text+0xc607): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_init_'<br>xc_libxc.f90:(.text+0xc620): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_get_info_'<br>xc_libxc.f90:(.text+0xc66a): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_family_'<br>xc_libxc.f90:(.text+0xc7d9): undefined reference to `xc_f03_lib_m_mp_xc_f03_lda_exc_'<br>xc_libxc.f90:(.text+0xc9a6): undefined reference to `xc_f03_lib_m_mp_xc_f03_lda_vxc_'<br>xc_libxc.f90:(.text+0xcbbd): undefined reference to `xc_f03_lib_m_mp_xc_f03_lda_exc_vxc_'<br>xc_libxc.f90:(.text+0xce32): undefined reference to `xc_f03_lib_m_mp_xc_f03_lda_fxc_'<br>xc_libxc.f90:(.text+0xd0ad): undefined reference to `xc_f03_lib_m_mp_xc_f03_lda_exc_vxc_'<br>xc_libxc.f90:(.text+0xd0da): undefined reference to `xc_f03_lib_m_mp_xc_f03_lda_fxc_'<br>xc_libxc.f90:(.text+0xd45b): undefined reference to `xc_f03_lib_m_mp_xc_f03_lda_kxc_'<br>xc_libxc.f90:(.text+0xd761): undefined reference to `xc_f03_lib_m_mp_xc_f03_lda_'<br>xc_libxc.f90:(.text+0xdd84): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_exc_'<br>xc_libxc.f90:(.text+0xe098): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_vxc_'<br>xc_libxc.f90:(.text+0xe556): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_vxc_'<br>xc_libxc.f90:(.text+0xe614): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_exc_vxc_'<br>xc_libxc.f90:(.text+0xeb4c): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_vxc_'<br>xc_libxc.f90:(.text+0xebb8): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_fxc_'<br>xc_libxc.f90:(.text+0xec2d): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_exc_vxc_'<br>xc_libxc.f90:(.text+0xec9d): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_fxc_'<br>xc_libxc.f90:(.text+0xf7cb): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_vxc_'<br>xc_libxc.f90:(.text+0xf837): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_fxc_'<br>xc_libxc.f90:(.text+0xf8f9): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_exc_vxc_'<br>xc_libxc.f90:(.text+0xf969): undefined reference to `xc_f03_lib_m_mp_xc_f03_gga_fxc_'<br>xc_libxc.f90:(.text+0x10901): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_exc_'<br>xc_libxc.f90:(.text+0x10e00): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_vxc_'<br>xc_libxc.f90:(.text+0x115f9): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_vxc_'<br>xc_libxc.f90:(.text+0x116df): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_exc_vxc_'<br>xc_libxc.f90:(.text+0x11f42): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_vxc_'<br>xc_libxc.f90:(.text+0x12012): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_fxc_'<br>xc_libxc.f90:(.text+0x12123): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_'<br>xc_libxc.f90:(.text+0x13ac3): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_vxc_'<br>xc_libxc.f90:(.text+0x13b93): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_fxc_'<br>xc_libxc.f90:(.text+0x13cf1): undefined reference to `xc_f03_lib_m_mp_xc_f03_mgga_'<br>xc_libxc.f90:(.text+0x15770): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_end_'<br>/home/chp071/Codes/cp2k-5.1/lib/Linux-ia64-intel_xc404/popt/libcp2kxc.a(xc_libxc_wrap.o): In function `xc_libxc_wrap_mp_xc_libxc_wrap_info_refs_':<br>xc_libxc_wrap.f90:(.text+0xb5): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_references_'<br>xc_libxc_wrap.f90:(.text+0xe4): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_reference_get_ref_'<br>xc_libxc_wrap.f90:(.text+0x144): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_reference_get_doi_'<br>xc_libxc_wrap.f90:(.text+0x58a): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_n_ext_params_'<br>xc_libxc_wrap.f90:(.text+0x773): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_ext_params_description_'<br>/home/chp071/Codes/cp2k-5.1/lib/Linux-ia64-intel_xc404/popt/libcp2kxc.a(xc_libxc_wrap.o): In function `xc_libxc_wrap_mp_xc_libxc_wrap_functional_get_number_':<br>xc_libxc_wrap.f90:(.text+0xea0): undefined reference to `xc_f03_lib_m_mp_xc_f03_functional_get_number_'<br>xc_libxc_wrap.f90:(.text+0xf01): undefined reference to `xc_f03_lib_m_mp_xc_f03_functional_get_number_'<br>/home/chp071/Codes/cp2k-5.1/lib/Linux-ia64-intel_xc404/popt/libcp2kxc.a(xc_libxc_wrap.o): In function `xc_libxc_wrap_mp_xc_libxc_wrap_needs_laplace_':<br>xc_libxc_wrap.f90:(.text+0x1129): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_init_'<br>xc_libxc_wrap.f90:(.text+0x113c): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_get_info_'<br>xc_libxc_wrap.f90:(.text+0x1150): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_flags_'<br>xc_libxc_wrap.f90:(.text+0x1179): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_end_'<br>/home/chp071/Codes/cp2k-5.1/lib/Linux-ia64-intel_xc404/popt/libcp2kxc.a(xc_libxc_wrap.o): In function `xc_libxc_wrap_mp_xc_libxc_wrap_functional_set_params_':<br>xc_libxc_wrap.f90:(.text+0x11fb): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_n_ext_params_'<br>xc_libxc_wrap.f90:(.text+0x139e): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_set_ext_params_'<br>xc_libxc_wrap.f90:(.text+0x160d): undefined reference to `xc_f03_lib_m_mp_xc_f03_func_info_get_flags_'<br>make[3]: *** [/home/chp071/Codes/cp2k-5.1/exe/Linux-ia64-intel_xc404/cp2k.popt] Error 1<br>make[2]: *** [all] Error 2<br>make[1]: *** [popt] Error 2<br>make: *** [all] Error 2<br><br>It seems to me that there was  a linking issue with the libxc, but I couldn't figure out the problem. Could you please help me with this problem?<br>Below is my arch file:<br><br>LIBXC = /home/chp071/Codes/install-libxc-4.0.4<br>LIBINT = /home/chp071/Codes/install-libint-1.1.4/<br>FFTW3 = /opt/fftw/3.3.4/intel/openmpi_ib<br>MKLROOT = /opt/intel/composer_xe_2013_sp1.2.144/mkl<br>INTEL_INC=$(MKLROOT)/include<br><br><br>CC       = icc<br>CPP      = /lib/cpp<br><br>FC       = mpifort -FR<br>FC_fixed = mpifort -FI<br>LD       = mpifort<br><br>AR       = /usr/bin/ar -r<br><br><br><br>DFLAGS   = -D__INTEL -D__FFTSG -D__parallel -D__BLACS -D__SCALAPACK -D__LIBINT -D__LIBXC<br><br>CPPFLAGS = -C $(DFLAGS) -P -traditional -I$(LIBXC)/include<br>FCFLAGS  = -O0 -xHost -pc64 -unroll -heap-arrays 64  -I$(LIBINT)/include -I$(LIBXC)/include<br><br>LDFLAGS  = $(FCFLAGS) -L$(HOME)/lib -L$(MKLROOT)/lib/intel64 -L$(LIBINT)/lib -L$(LIBXC)/lib<br>LDFLAGS_C  = $(FCFLAGS) -L$(HOME)/lib -L$(MKLROOT)/lib/intel64 -nofor_main -L$(LIBINT)/lib -L$(LIBXC)/lib<br><br>FCFLAGS2 = $(DFLAGS) -O0 -heap-arrays 64 -fpp -free<br><br>LIBS     = $(FFTW3)/lib/libfftw3.a \<br>           $(MKLROOT)/lib/intel64/libmkl_scalapack_lp64.a \<br>           -Wl,--start-group $(MKLROOT)/lib/intel64/libmkl_intel_lp64.a \<br>           $(MKLROOT)/lib/intel64/libmkl_core.a \<br>           $(MKLROOT)/lib/intel64/libmkl_sequential.a \<br>           -Wl,--end-group \<br>           $(MKLROOT)/lib/intel64/libmkl_blacs_intelmpi_lp64.a \<br>           -lpthread\<br>           $(LIBINT)/lib/libderiv.a\<br>           $(LIBINT)/lib/libint.a\<br>           $(LIBXC)/lib/libxcf90.a\<br>           $(LIBXC)/lib/libxc.a<br><br>OBJECTS_ARCHITECTURE = machine_intel.o<br><br>hfx_screening_methods.o: hfx_screening_methods.F<br>        $(FC) -c $(FCFLAGS2) $<<br><br><br>Thanks,<br>Huy<br><br>On Tuesday, February 6, 2018 at 8:46:58 AM UTC-8, Andreas Glöss wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr">Dear CP2K users and developers,<div><br></div><div>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).</div><div>You can fetch the patch directly from here:</div><div><br></div><div><a href="https://www.cp2k.org/static/downloads/patches/patch_cp2k-5.1_libxc-4.0.4-support.diff" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.cp2k.org%2Fstatic%2Fdownloads%2Fpatches%2Fpatch_cp2k-5.1_libxc-4.0.4-support.diff\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHpWEnHACoFVeWlbANr1LjBWjsN7A';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.cp2k.org%2Fstatic%2Fdownloads%2Fpatches%2Fpatch_cp2k-5.1_libxc-4.0.4-support.diff\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHpWEnHACoFVeWlbANr1LjBWjsN7A';return true;">https://www.cp2k.org/static/<wbr>downloads/patches/patch_cp2k-<wbr>5.1_libxc-4.0.4-support.diff</a><br></div><div><br></div><div>To apply the patch follow this procedure:</div><div><ul><li>Download and compile LIBXC-4.0 (see eg.: <a href="http://octopus-code.org/wiki/Libxc_4.0.4" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Foctopus-code.org%2Fwiki%2FLibxc_4.0.4\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNESrgLEAOTzpevnMPQI3dwGiPE1fA';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Foctopus-code.org%2Fwiki%2FLibxc_4.0.4\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNESrgLEAOTzpevnMPQI3dwGiPE1fA';return true;">http://octopus-code.org/wiki/<wbr>Libxc_4.0.4</a>)</li><li>Checkout CP2K-5.1: <font face="courier new, monospace"><div style="background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code><div><span style="color:#000">svn checkout </span><span style="color:#660">-</span><span style="color:#000">r </span><span style="background-color:rgb(255,255,255);color:rgb(0,0,0)"><span style="color:#066">18095</span><span style="color:#000"> </span></span><span style="color:#000">http</span><span style="color:#660">:</span><span style="color:#800">//<a href="http://svn.code.sf.net/p/cp2k/code/branches/cp2k-5_1-branch/cp2k" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fsvn.code.sf.net%2Fp%2Fcp2k%2Fcode%2Fbranches%2Fcp2k-5_1-branch%2Fcp2k\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHcikCpCzTKS8Aoe-iHuW-WDhrU7Q';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fsvn.code.sf.net%2Fp%2Fcp2k%2Fcode%2Fbranches%2Fcp2k-5_1-branch%2Fcp2k\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHcikCpCzTKS8Aoe-iHuW-WDhrU7Q';return true;">svn.code.sf.net/p/cp2k/<wbr>code/branches/cp2k-5_1-branch/<wbr>cp2k</a> cp2k-5.1</span></div></code></div></font></li><li>Change directory: <font face="courier new, monospace"><div style="background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code><div><span style="color:#000">cd cp2k</span><span style="color:#660">-</span><span style="color:#066">5.1</span></div></code></div></font></li><li>Get patch: <div style="background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code><div><span style="color:#000">wget https</span><span style="color:#660">:</span><span style="color:#800">//<a href="http://www.cp2k.org/static/downloads/patches/patch_cp2k-5.1_libxc-4.0.4-support.diff" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.cp2k.org%2Fstatic%2Fdownloads%2Fpatches%2Fpatch_cp2k-5.1_libxc-4.0.4-support.diff\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFWbGvYhhPcUg9caz2RrksYLHdqPg';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.cp2k.org%2Fstatic%2Fdownloads%2Fpatches%2Fpatch_cp2k-5.1_libxc-4.0.4-support.diff\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFWbGvYhhPcUg9caz2RrksYLHdqPg';return true;">www.cp2k.org/static/<wbr>downloads/patches/patch_cp2k-<wbr>5.1_libxc-4.0.4-support.diff</a></span></div></code></div></li><li><font face="arial, sans-serif">Apply patch: </font><div style="font-family:"courier new",monospace;background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code><div><span style="color:#000">patch </span><span style="color:#660">-</span><span style="color:#000">p </span><span style="color:#066">0</span><span style="color:#000"> </span><span style="color:#660"><</span><span style="color:#000"> patch_cp2k</span><span style="color:#660">-</span><span style="color:#066">5.1</span><span style="color:#000">_libxc</span><span style="color:#660">-</span><span style="color:#066">4.0</span><span style="color:#660">.</span><span style="color:#066">4</span><span style="color:#660">-</span><span style="color:#000">sup<wbr>port</span><span style="color:#660">.</span><span style="color:#000">diff</span></div></code></div></li><li>Adapt your ARCH-file:</li><ul><li>Change the <font face="courier new, monospace">DFLAGS</font>, eg. <font face="courier new, monospace"><div style="background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code><div><span style="color:#000">DFLAGS </span><span style="color:#660">+=</span><span style="color:#000"> </span><span style="color:#660">-</span><span style="color:#000">D__LIBXC</span><span style="background-color:white;font-family:Arial,Helvetica,sans-serif"><span style="color:#000"> </span></span></div></code></div></font></li><li>Change LIBXCs include directory in <font face="courier new, monospace">CFLAGS</font> and <font face="courier new, monospace">FCFLAGS</font>, eg. <font face="courier new, monospace"><div style="background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code><div><span style="color:#000">CFLAGS </span><span style="color:#660">+=</span><span style="color:#000"> </span><span style="color:#660">-</span><span style="color:#000">I</span><span style="color:#080">'/my_local_libxc4_<wbr>installation/include'</span></div></code></div></font></li><li>Change LIBXCs library directory in <font face="courier new, monospace">LDFLAGS</font>, eg. <font face="courier new, monospace"><div style="background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code><div><span style="color:#000">LDFLAGS </span><span style="color:#660">+=</span><span style="color:#000"> </span><span style="color:#660">-</span><span style="color:#000">L</span><span style="color:#080">'/my_local_libxc4_<wbr>installation/lib'</span></div></code></div></font>Note, on some architectures this directory is called <font face="courier new, monospace">lib64</font>.</li><li>Change LIBXCs interface in <font face="courier new, monospace">LIBS</font>, eg. <font face="courier new, monospace"><div style="background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code><div><span style="color:#000">LIBS </span><span style="color:#660">+=</span><span style="color:#000"> </span><span style="color:#660">-</span><span style="color:#000">lxcf03 </span><span style="color:#660">-</span><span style="color:#000">lxc</span></div></code></div><br></font></li></ul><li>Compile as usual ...</li></ul>Please note that this patch comes with some features and drawbacks listed below.</div><div><br></div><div>Features:</div><div><ul><li><font face="courier new, monospace">&LIBXC</font> section is repeatable.</li><li>Only one functional per <font face="courier new, monospace">&LIBXC</font> section.</li><li>Optional <font face="courier new, monospace">PARAMETERS</font> and <font face="courier new, monospace">SCALE</font> keywords are private to the functional - formerly they could have been mixed.</li><li>A lot of bug-fixes and new functionals.</li></ul>Drawbacks:</div><div><ul><li>New input is not backward compatible.</li></ul><br></div><div>To visualize the input changes, here is one example (first old, followed by new syntax):</div><div><br></div><div style="background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code><div><span style="color:#660">&</span><span style="color:#000">XC_FUNCTIONAL<br>  </span><span style="color:#660">&</span><span style="color:#000">LIBXC<br>    FUNCTIONAL XC_GGA_X_PBE XC_GGA_C_PBE<br>  </span><span style="color:#660">&</span><span style="color:#008">END</span><span style="color:#000"> LIBXC<br></span><span style="color:#660">&</span><span style="color:#008">END</span><span style="color:#000"> XC_FUNCTIONAL</span></div></code></div><div><br></div><div style="background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><code><div><span style="color:#660">&</span><span style="color:#000">XC_FUNCTIONAL<br>  </span><span style="color:#660">&</span><span style="color:#000">LIBXC<br>    FUNCTIONAL XC_GGA_X_PBE<br>  </span><span style="color:#660">&</span><span style="color:#008">END</span><span style="color:#000"> LIBXC<br>  </span><span style="color:#660">&</span><span style="color:#000">LIBXC<br>    FUNCTIONAL XC_GGA_C_PBE<br>  </span><span style="color:#660">&</span><span style="color:#008">END</span><span style="color:#000"> LIBXC<br></span><span style="color:#660">&</span><span style="color:#008">END</span><span style="color:#000"> XC_FUNCTIONAL <br></span></div></code></div><div><br><br></div><div>Best regards and hope this is useful to others,</div><div>Andreas</div></div></blockquote></div>