mirror of
https://github.com/nwchemgit/nwchem.git
synced 2026-07-28 14:15:30 -04:00
detect size of libxc np
This commit is contained in:
parent
5c0b38a519
commit
13e0f41858
3 changed files with 27 additions and 4 deletions
|
|
@ -13,10 +13,13 @@ LIBRARY = libnwdft.a
|
|||
LIB_INCLUDES = -I../include
|
||||
ifdef USE_LIBXC
|
||||
LIB_DEFINES += -DXC_MAJOR_VERSION=$(shell grep XC_MAJOR_VERSION ../../libext/libxc/install/include/xc_version.h |cut -d " " -f 3)
|
||||
LIB_DEFINES += -DLIBXC_NP_SIZE=$(shell ./libxc_findsizenp.sh ../../libext/libxc/install/include)
|
||||
LIB_INCLUDES += -I../../libext/libxc/install/include
|
||||
endif
|
||||
ifdef LIBXC_INCLUDE
|
||||
LIB_DEFINES += -DXC_MAJOR_VERSION=$(shell grep XC_MAJOR_VERSION $(LIBXC_INCLUDE)/xc_version.h |cut -d " " -f 3)
|
||||
LIB_DEFINES += -DXC_MAJOR_VERSION=$(shell grep XC_MAJOR_VE
|
||||
RSION $(LIBXC_INCLUDE)/xc_version.h |cut -d " " -f 3)
|
||||
LIB_DEFINES += -DLIBXC_NP_SIZE=$(shell ./libxc_findsizenp.sh $(LIBXC_INCLUDE))
|
||||
LIB_INCLUDES += -I$(LIBXC_INCLUDE)
|
||||
endif
|
||||
LIB_INCLUDES += -I.
|
||||
|
|
|
|||
18
src/nwdft/libxc/libxc_findsizenp.sh
Executable file
18
src/nwdft/libxc/libxc_findsizenp.sh
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
npstring=$(egrep np "$1"/xc.h|head -1)
|
||||
np_array=($npstring)
|
||||
count=-1
|
||||
sizenp_string=' '
|
||||
for substring in "${np_array[@]}"; do
|
||||
[[ $substring == "np," ]] && sizenp_string=${np_array[$count]} && break
|
||||
((++count))
|
||||
done
|
||||
if [[ "$sizenp_string" == 'int' ]]; then
|
||||
size_np=4
|
||||
elif [[ "$sizenp_string" == 'size_t' ]]; then
|
||||
size_np=8
|
||||
else
|
||||
echo "unexpected sizenp_string $sizenp_string"
|
||||
exit 1
|
||||
fi
|
||||
echo $size_np
|
||||
|
|
@ -63,10 +63,12 @@
|
|||
logical gga,mgga,dolap
|
||||
logical,external :: nwchem_libxc_family
|
||||
|
||||
#if XC_MAJOR_VERSION > 5
|
||||
#if LIBXC_NP_SIZE == 4
|
||||
integer*4 nqs
|
||||
#elif LIBXC_NP_SIZE == 8
|
||||
integer(c_size_t) :: nqs
|
||||
#else
|
||||
integer*4 :: nqs
|
||||
#elif
|
||||
#error "unexpected value for LIBXC_NP_SIZE"
|
||||
#endif
|
||||
#ifdef USE_LIBXC
|
||||
type(xc_f03_func_t) :: xcfunc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue