Skip to content

Commit

Permalink
Turn HDF5 library to a general dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrack committed Aug 28, 2023
1 parent 967ffb2 commit e49da1f
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 81 deletions.
25 changes: 16 additions & 9 deletions arch/CRAY-XC40-gnu.psmp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
#
# CP2K arch file for Cray-XC40 (Piz Daint, CSCS, multi-core partition)
#
# Tested with: GNU 11.2.0, Cray-MPICH 7.7.18, Cray-libsci 20.09.1, Cray-FFTW 3.3.8.10,
# COSMA 2.6.6, ELPA 2023.05.001, LIBINT 2.6.0, LIBPEXSI 1.2.0,
# LIBXC 6.2.2, LIBVORI 220621, LIBXSMM 1.17, PLUMED 2.8.2,
# Tested with: GNU 11.2.0, Cray-MPICH 7.7.18,
# Cray-libsci 20.09.1, Cray-FFTW 3.3.8.10,
# COSMA 2.6.6, ELPA 2023.05.001, HDF5 1.12.0,
# LIBINT 2.6.0, LIBPEXSI 1.2.0, LIBXC 6.2.2,
# LIBVORI 220621, LIBXSMM 1.17, PLUMED 2.8.2,
# SIRIUS 7.4.3, SPGLIB 1.16.2
#
# Usage: Source this arch file and then run make as instructed.
# A full toolchain installation is performed as default.
# Replace or adapt the "module add" commands below if needed.
#
# Last update: 09.08.2023
# Last update: 28.08.2023
#
# \
if [ "${0}" = "${BASH_SOURCE}" ]; then \
Expand Down Expand Up @@ -66,6 +68,7 @@
DO_CHECKS := no
USE_COSMA := 2.6.6
USE_ELPA := 2023.05.001
USE_HDF5 := 1.12.0
USE_LIBINT := 2.6.0
USE_LIBPEXSI := 1.2.0
USE_LIBVORI := 220621
Expand All @@ -79,7 +82,6 @@ USE_SPGLIB := 1.16.2
LIBVDWXC_VER := 0.4.0
SPFFT_VER := 1.0.6
SPLA_VER := 1.5.5
HDF5_VER := 1.12.0
# Only needed for LIBPEXSI
SCOTCH_VER := 6.0.0
SUPERLU_VER := 6.1.0
Expand Down Expand Up @@ -207,8 +209,6 @@ endif

ifneq ($(USE_SIRIUS),)
USE_SIRIUS := $(strip $(USE_SIRIUS))
HDF5_VER := $(strip $(HDF5_VER))
HDF5_LIB := $(INSTALL_PATH)/hdf5-$(HDF5_VER)/lib
LIBVDWXC_VER := $(strip $(LIBVDWXC_VER))
LIBVDWXC_INC := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/include
LIBVDWXC_LIB := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/lib
Expand All @@ -224,7 +224,6 @@ ifneq ($(USE_SIRIUS),)
CFLAGS += -I$(SPFFT_INC)
CFLAGS += -I$(SPLA_INC)
CFLAGS += -I$(SIRIUS_INC)
DFLAGS += -D__HDF5
DFLAGS += -D__LIBVDWXC
DFLAGS += -D__SPFFT
DFLAGS += -D__SPLA
Expand All @@ -233,7 +232,6 @@ ifneq ($(USE_SIRIUS),)
LIBS += $(SPLA_LIB)/libspla.a
LIBS += $(SPFFT_LIB)/libspfft.a
LIBS += $(LIBVDWXC_LIB)/libvdwxc.a
LIBS += $(HDF5_LIB)/libhdf5.a
endif

ifneq ($(USE_COSMA),)
Expand All @@ -256,6 +254,15 @@ ifneq ($(USE_GSL),)
LIBS += $(GSL_LIB)/libgsl.a
endif

ifneq ($(USE_HDF5),)
USE_HDF5 := $(strip $(USE_HDF5))
HDF5_INC := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/include
HDF5_LIB := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/lib
CFLAGS += -I$(HDF5_INC)
DFLAGS += -D__HDF5
LIBS += $(HDF5_LIB)/libhdf5.a
endif

CFLAGS += $(DFLAGS)

FCFLAGS := $(CFLAGS)
Expand Down
26 changes: 16 additions & 10 deletions arch/CRAY-XC50-gnu.psmp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
#
# CP2K arch file for Cray-XC50 (Piz Daint, CSCS, GPU partition)
#
# Tested with: GNU 9.3.0, Cray-MPICH 7.7.18, Cray-libsci 20.09.1, Cray-FFTW 3.3.8.10,
# COSMA 2.6.6, ELPA 2023.05.001, LIBINT 2.6.0, LIBPEXSI 1.2.0,
# LIBXC 6.2.2, LIBVORI 220621, LIBXSMM 1.17, PLUMED 2.8.2,
# SIRIUS 7.4.3, SPGLIB 1.16.2
# Tested with: GNU 9.3.0, Cray-MPICH 7.7.18, Cray-libsci 20.09.1,
# Cray-FFTW 3.3.8.10, COSMA 2.6.6, ELPA 2023.05.001,
# HDF5 1.12.0, LIBINT 2.6.0, LIBPEXSI 1.2.0,
# LIBXC 6.2.2, LIBVORI 220621, LIBXSMM 1.17,
# PLUMED 2.8.2, SIRIUS 7.4.3, SPGLIB 1.16.2
#
# Usage: Source this arch file and then run make as instructed.
# A full toolchain installation is performed as default.
# Replace or adapt the "module add" commands below if needed.
#
# Last update: 21.06.2023
# Last update: 28.08.2023
#
# \
if [ "${0}" = "${BASH_SOURCE}" ]; then \
Expand Down Expand Up @@ -69,6 +70,7 @@ DO_CHECKS := no
USE_ACC := yes
USE_COSMA := 2.6.6
USE_ELPA := 2023.05.001
USE_HDF5 := 1.12.0
USE_LIBINT := 2.6.0
USE_LIBPEXSI := 1.2.0
USE_LIBVORI := 220621
Expand All @@ -82,7 +84,6 @@ USE_SPGLIB := 1.16.2
LIBVDWXC_VER := 0.4.0
SPFFT_VER := 1.0.6
SPLA_VER := 1.5.5
HDF5_VER := 1.12.0
# Only needed for LIBPEXSI
SCOTCH_VER := 6.0.0
SUPERLU_VER := 6.1.0
Expand Down Expand Up @@ -225,8 +226,6 @@ endif

ifneq ($(USE_SIRIUS),)
USE_SIRIUS := $(strip $(USE_SIRIUS))
HDF5_VER := $(strip $(HDF5_VER))
HDF5_LIB := $(INSTALL_PATH)/hdf5-$(HDF5_VER)/lib
LIBVDWXC_VER := $(strip $(LIBVDWXC_VER))
LIBVDWXC_INC := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/include
LIBVDWXC_LIB := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/lib
Expand All @@ -250,7 +249,6 @@ ifneq ($(USE_SIRIUS),)
CFLAGS += -I$(SPFFT_INC)
CFLAGS += -I$(SPLA_INC)
CFLAGS += -I$(SIRIUS_INC)
DFLAGS += -D__HDF5
DFLAGS += -D__LIBVDWXC
DFLAGS += -D__SPFFT
DFLAGS += -D__SPLA
Expand All @@ -259,7 +257,6 @@ ifneq ($(USE_SIRIUS),)
LIBS += $(SPLA_LIB)/libspla.a
LIBS += $(SPFFT_LIB)/libspfft.a
LIBS += $(LIBVDWXC_LIB)/libvdwxc.a
LIBS += $(HDF5_LIB)/libhdf5.a
endif

ifneq ($(USE_COSMA),)
Expand All @@ -286,6 +283,15 @@ ifneq ($(USE_GSL),)
LIBS += $(GSL_LIB)/libgsl.a
endif

ifneq ($(USE_HDF5),)
USE_HDF5 := $(strip $(USE_HDF5))
HDF5_INC := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/include
HDF5_LIB := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/lib
CFLAGS += -I$(HDF5_INC)
DFLAGS += -D__HDF5
LIBS += $(HDF5_LIB)/libhdf5.a
endif

CFLAGS += $(DFLAGS)

CXXFLAGS := $(CFLAGS) -std=c++11
Expand Down
33 changes: 22 additions & 11 deletions arch/Darwin-gnu-arm64.psmp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
# (https://www.cp2k.org/howto:compile_on_macos)
#
# Tested with: GNU 12.3.0, MPICH 4.0.3,
# ScaLAPACK 2.2.1, OpenBLAS 0.3.23, FFTW 3.3.10, LIBINT 2.6.0,
# LIBXC 6.2.2, SPGLIB 1.16.2, PLUMED 2.8.2,
# LIBVORI 220621, GSL 2.7, COSMA 2.6.6, SIRIUS 7.4.3
# on an Apple M1 (macOS Ventura 13.1)
# ScaLAPACK 2.2.1, OpenBLAS 0.3.23,
# FFTW 3.3.10, HDF5 1.12.0,
# LIBINT 2.6.0, LIBXC 6.2.2,
# SPGLIB 1.16.2, PLUMED 2.8.2,
# LIBVORI 220621, GSL 2.7,
# COSMA 2.6.6, SIRIUS 7.4.3
# on an Apple M1 (macOS Ventura 13.5.1)
#
# Usage: Source this arch file and then run make as instructed.
#
# Last update: 21.06.2023
# Last update: 28.08.2023
#
# \
if [[ "${0}" == "${BASH_SOURCE}" ]]; then \
Expand Down Expand Up @@ -59,6 +62,7 @@ SHARED := no
TARGET_CPU := native
USE_COSMA := 2.6.6
USE_FFTW := 3.3.10
USE_HDF5 := 1.12.0
USE_LIBINT := 2.6.0
USE_LIBVORI := 220621
USE_LIBXC := 6.2.2
Expand Down Expand Up @@ -189,13 +193,10 @@ endif

ifneq ($(USE_SIRIUS),)
USE_GSL := 2.7
HDF5_VER := 1.12.0
LIBVDWXC_VER := 0.4.0
SPFFT_VER := 1.0.6
SPLA_VER := 1.5.5
USE_SIRIUS := $(strip $(USE_SIRIUS))
HDF5_VER := $(strip $(HDF5_VER))
HDF5_LIB := $(INSTALL_PATH)/hdf5-$(HDF5_VER)/lib
LIBVDWXC_VER := $(strip $(LIBVDWXC_VER))
LIBVDWXC_INC := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/include
LIBVDWXC_LIB := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/lib
Expand All @@ -211,7 +212,6 @@ ifneq ($(USE_SIRIUS),)
CFLAGS += -I$(SPFFT_INC)
CFLAGS += -I$(SPLA_INC)
CFLAGS += -I$(SIRIUS_INC)
DFLAGS += -D__HDF5
DFLAGS += -D__LIBVDWXC
DFLAGS += -D__SPFFT
DFLAGS += -D__SPLA
Expand All @@ -221,13 +221,11 @@ ifneq ($(USE_SIRIUS),)
LIBS += -Wl,-rpath,$(SPLA_LIB) -L$(SPLA_LIB) -lspla
LIBS += -Wl,-rpath,$(SPFFT_LIB) -L$(SPFFT_LIB) -lspfft
LIBS += -Wl,-rpath,$(LIBVDWXC_LIB) -L$(LIBVDWXC_LIB) -lvdwxc
LIBS += -Wl,-rpath,$(HDF5_LIB) -L$(HDF5_LIB) -lhdf5
else
LIBS += $(SIRIUS_LIB)/libsirius.a
LIBS += $(SPLA_LIB)/libspla.a
LIBS += $(SPFFT_LIB)/libspfft.a
LIBS += $(LIBVDWXC_LIB)/libvdwxc.a
LIBS += $(HDF5_LIB)/libhdf5.a
endif
endif

Expand Down Expand Up @@ -295,6 +293,19 @@ ifneq ($(USE_GSL),)
endif
endif

ifneq ($(USE_HDF5),)
USE_HDF5 := $(strip $(USE_HDF5))
HDF5_INC := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/include
HDF5_LIB := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/lib
CFLAGS += -I$(HDF5_INC)
DFLAGS += -D__HDF5
ifeq ($(SHARED), yes)
LIBS += -Wl,-rpath,$(HDF5_LIB) -L$(HDF5_LIB) -lhdf5
else
LIBS += $(HDF5_LIB)/libhdf5.a
endif
endif

CFLAGS += $(DFLAGS)

FCFLAGS := $(CFLAGS) $(FCFLAGS_DEBUG) $(WFLAGS)
Expand Down
34 changes: 23 additions & 11 deletions arch/JURECA-cpu.psmp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@
#
# CP2K arch file for JURECA at FZ Juelich (2 AMD EPYC 7742 CPUs per node)
#
# Tested with: GNU 11.3.0, ParaStationMPI, ScaLAPACK 2.2.1, OpenBLAS 0.3.23,
# FFTW 3.3.10, COSMA 2.6.6, ELPA 2023.05.001, LIBINT 2.6.0,
# LIBPEXSI 1.2.0, LIBXC 6.2.2, LIBVORI 220621, LIBXSMM 1.17,
# PLUMED 2.8.2, SIRIUS 7.4.3, SPGLIB 1.16.2
# Tested with: GNU 11.3.0, ParaStationMPI,
# ScaLAPACK 2.2.1, OpenBLAS 0.3.23,
# FFTW 3.3.10, COSMA 2.6.6,
# ELPA 2023.05.001, HDF5 1.12.0,
# LIBINT 2.6.0, LIBPEXSI 1.2.0,
# LIBXC 6.2.2, LIBVORI 220621,
# LIBXSMM 1.17, PLUMED 2.8.2,
# SIRIUS 7.4.3, SPGLIB 1.16.2
#
# Usage: Source this arch file and then run make as instructed.
# A full toolchain installation is performed as default.
# Replace or adapt the "module add" commands below if needed.
#
# Last update: 09.08.2023
# Last update: 28.08.2023
#
# \
if [ "${0}" = "${BASH_SOURCE}" ]; then \
Expand Down Expand Up @@ -53,6 +57,7 @@ USE_ACC := no
USE_COSMA := 2.6.6
USE_ELPA := 2023.05.001
USE_FFTW := 3.3.10
USE_HDF5 := 1.12.0
USE_LIBINT := 2.6.0
USE_LIBPEXSI := 1.2.0
USE_LIBTORCH := 1.12.1
Expand All @@ -69,7 +74,6 @@ USE_SPGLIB := 1.16.2
LIBVDWXC_VER := 0.4.0
SPFFT_VER := 1.0.6
SPLA_VER := 1.5.5
HDF5_VER := 1.12.0
# Only needed for LIBPEXSI
SCOTCH_VER := 6.0.0
SUPERLU_VER := 6.1.0
Expand Down Expand Up @@ -277,8 +281,6 @@ endif

ifneq ($(USE_SIRIUS),)
USE_SIRIUS := $(strip $(USE_SIRIUS))
HDF5_VER := $(strip $(HDF5_VER))
HDF5_LIB := $(INSTALL_PATH)/hdf5-$(HDF5_VER)/lib
LIBVDWXC_VER := $(strip $(LIBVDWXC_VER))
LIBVDWXC_INC := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/include
LIBVDWXC_LIB := $(INSTALL_PATH)/libvdwxc-$(LIBVDWXC_VER)/lib
Expand All @@ -302,7 +304,6 @@ ifneq ($(USE_SIRIUS),)
CFLAGS += -I$(SPFFT_INC)
CFLAGS += -I$(SPLA_INC)
CFLAGS += -I$(SIRIUS_INC)
DFLAGS += -D__HDF5
DFLAGS += -D__LIBVDWXC
DFLAGS += -D__SPFFT
DFLAGS += -D__SPLA
Expand All @@ -312,13 +313,11 @@ ifneq ($(USE_SIRIUS),)
LIBS += -Wl,-rpath=$(SPLA_LIB) -L$(SPLA_LIB) -lspla
LIBS += -Wl,-rpath=$(SPFFT_LIB) -L$(SPFFT_LIB) -lspfft
LIBS += -Wl,-rpath=$(LIBVDWXC_LIB) -L$(LIBVDWXC_LIB) -lvdwxc
LIBS += -Wl,-rpath=$(HDF5_LIB) -L$(HDF5_LIB) -lhdf5
else
LIBS += $(SIRIUS_LIB)/libsirius.a
LIBS += $(SPLA_LIB)/libspla.a
LIBS += $(SPFFT_LIB)/libspfft.a
LIBS += $(LIBVDWXC_LIB)/libvdwxc.a
LIBS += $(HDF5_LIB)/libhdf5.a
endif
endif

Expand Down Expand Up @@ -383,6 +382,19 @@ ifneq ($(USE_GSL),)
endif
endif

ifneq ($(USE_HDF5),)
USE_HDF5 := $(strip $(USE_HDF5))
HDF5_INC := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/include
HDF5_LIB := $(INSTALL_PATH)/hdf5-$(USE_HDF5)/lib
CFLAGS += -I$(HDF5_INC)
DFLAGS += -D__HDF5
ifeq ($(SHARED), yes)
LIBS += -Wl,-rpath,$(HDF5_LIB) -L$(HDF5_LIB) -lhdf5
else
LIBS += $(HDF5_LIB)/libhdf5.a
endif
endif

ifneq ($(USE_OPENBLAS),)
USE_OPENBLAS := $(strip $(USE_OPENBLAS))
OPENBLAS_INC := $(INSTALL_PATH)/openblas-$(USE_OPENBLAS)/include
Expand Down

0 comments on commit e49da1f

Please sign in to comment.