diff --git a/INSTALL.md b/INSTALL.md index 2057999f62..b57d88b829 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -175,10 +175,11 @@ required. ### 2h. LIBXSMM (optional, improved performance for matrix multiplication) -- A library for matrix operations and deep learning primitives: . +- A library for matrix operations and deep learning primitives: + . - Add `-D__LIBXSMM` to enable it, with suitable include and library paths, e.g., `FCFLAGS += -I${LIBXSMM_DIR}/include -D__LIBXSMM` and - `LIBS += -L${LIBXSMM_DIR}/lib -lxsmmf -lxsmm -ldl` + `LIBS += -L${LIBXSMM_DIR}/lib -lxsmmf -lxsmmext -lxsmm -ldl` - LIBSMM is not used if LIBXSMM is enabled. ### 2i. CUDA (optional, improved performance on GPU systems) diff --git a/arch/Darwin-gnu-arm64.psmp b/arch/Darwin-gnu-arm64.psmp index b655190dda..9e234bbe2a 100644 --- a/arch/Darwin-gnu-arm64.psmp +++ b/arch/Darwin-gnu-arm64.psmp @@ -9,7 +9,7 @@ # Ensure the links in /opt/homebrew/bin to the gcc version # and "brew unlink openmpi" (or mpich) if installed. # -# Last update: 12.09.2024 +# Last update: 13.09.2024 # # \ if [[ "${0}" == "${BASH_SOURCE}" ]]; then \ @@ -43,7 +43,7 @@ ./install_cp2k_toolchain.sh --install-all -j${maxtasks} --no-arch-files --target-cpu=${target_cpu} \ --with-cmake=$(brew --prefix cmake) --with-elpa=no --with-fftw=$(brew --prefix fftw) --with-gcc=system \ --with-gsl=$(brew --prefix gsl) --with-hdf5=$(brew --prefix hdf5) --with-libxc=$(brew --prefix libxc) \ - --with-libxsmm=no --with-openblas=$(brew --prefix openblas) --with-${mpi_implementation} \ + --with-openblas=$(brew --prefix openblas) --with-${mpi_implementation} \ --with-pexsi=no --with-quip=no; \ source ./install/setup; \ cd ../..; \ @@ -183,6 +183,17 @@ ifneq ($(USE_SPGLIB),) LIBS += $(SPGLIB_LIB)/libsymspg.a endif +ifneq ($(USE_LIBXSMM),) + USE_LIBXSMM := $(strip $(USE_LIBXSMM)) + LIBXSMM_INC := $(INSTALL_PATH)/libxsmm-$(USE_LIBXSMM)/include + LIBXSMM_LIB := $(INSTALL_PATH)/libxsmm-$(USE_LIBXSMM)/lib + CFLAGS += -I$(LIBXSMM_INC) + DFLAGS += -D__LIBXSMM + LIBS += $(LIBXSMM_LIB)/libxsmmf.a + LIBS += $(LIBXSMM_LIB)/libxsmmext.a + LIBS += $(LIBXSMM_LIB)/libxsmm.a +endif + ifneq ($(USE_SIRIUS),) USE_SIRIUS := $(strip $(USE_SIRIUS)) USE_GSL := ${GSL_VER} diff --git a/arch/Darwin-gnu-arm64.ssmp b/arch/Darwin-gnu-arm64.ssmp index 0982066121..b1bfa0cbed 100644 --- a/arch/Darwin-gnu-arm64.ssmp +++ b/arch/Darwin-gnu-arm64.ssmp @@ -8,7 +8,7 @@ # Usage: Source this arch file and then run make as instructed. # Ensure the links in /opt/homebrew/bin to the gcc version. # -# Last update: 06.09.2024 +# Last update: 13.09.2024 # # \ if [[ "${0}" == "${BASH_SOURCE}" ]]; then \ @@ -37,7 +37,7 @@ fi; \ ./install_cp2k_toolchain.sh -j${maxtasks} --mpi-mode=no --no-arch-files --target-cpu=${target_cpu} \ --with-cmake=$(brew --prefix cmake) --with-fftw=$(brew --prefix fftw) --with-gcc=system \ - --with-libxc=$(brew --prefix libxc) --with-libxsmm=no --with-openblas=$(brew --prefix openblas); \ + --with-libxc=$(brew --prefix libxc) --with-openblas=$(brew --prefix openblas); \ source ./install/setup; \ cd ../..; \ echo; \ @@ -161,6 +161,17 @@ ifneq ($(USE_SPGLIB),) LIBS += $(SPGLIB_LIB)/libsymspg.a endif +ifneq ($(USE_LIBXSMM),) + USE_LIBXSMM := $(strip $(USE_LIBXSMM)) + LIBXSMM_INC := $(INSTALL_PATH)/libxsmm-$(USE_LIBXSMM)/include + LIBXSMM_LIB := $(INSTALL_PATH)/libxsmm-$(USE_LIBXSMM)/lib + CFLAGS += -I$(LIBXSMM_INC) + DFLAGS += -D__LIBXSMM + LIBS += $(LIBXSMM_LIB)/libxsmmf.a + LIBS += $(LIBXSMM_LIB)/libxsmmext.a + LIBS += $(LIBXSMM_LIB)/libxsmm.a +endif + FFTW_HOME := $(shell brew --prefix fftw) CFLAGS += -I$(FFTW_HOME)/include DFLAGS += -D__FFTW3 diff --git a/tools/toolchain/README.md b/tools/toolchain/README.md index 876b9454ae..0ec612ac71 100644 --- a/tools/toolchain/README.md +++ b/tools/toolchain/README.md @@ -108,7 +108,7 @@ proprietary software packages, like e.g. MKL, these have to be installed separat | libvori | LGPL-3 | Yes | | libvdwxc | [GPL](https://gitlab.com/libvdwxc/libvdwxc/blob/master/LICENSE) | Yes | | libxc | [MPL](https://gitlab.com/libxc/libxc/blob/master/COPYING) | Yes | -| libxsmm | [BSD 3-Clause](https://github.com/hfp/libxsmm/blob/master/LICENSE.md) | Yes | +| libxsmm | [BSD 3-Clause](https://github.com/libxsmm/libxsmm/blob/master/LICENSE.md) | Yes | | mpich | [MPICH](https://github.com/pmodels/mpich/blob/master/COPYRIGHT) | [Yes](https://enterprise.dejacode.com/licenses/public/mpich/#license-conditions) | | openblas | [BSD 3-Clause](https://github.com/xianyi/OpenBLAS/blob/develop/LICENSE) | Yes | | openmpi | [BSD 3-Clause](https://github.com/open-mpi/ompi/blob/master/LICENSE) | Yes | diff --git a/tools/toolchain/scripts/stage4/install_libxsmm.sh b/tools/toolchain/scripts/stage4/install_libxsmm.sh index 9c61576244..888da8b2b3 100755 --- a/tools/toolchain/scripts/stage4/install_libxsmm.sh +++ b/tools/toolchain/scripts/stage4/install_libxsmm.sh @@ -6,8 +6,8 @@ [ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0 SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")/.." && pwd -P)" -libxsmm_ver="3edfb7100cec3322bac9ae4eafea3b3838654ced" -libxsmm_sha256="8ab0a9a60bbbd0efce30f9b40875cbe70d17246a2c7fd6ce5efaaa9a80ea6644" +libxsmm_ver="f7cbb551da7d3ebe82e8c94e5d2cdc4670df0528" +libxsmm_sha256="e458ee3c10bc2b1896b2032853e375684c583b3e5eeec7a6404c3c0811e62467" source "${SCRIPT_DIR}"/common_vars.sh source "${SCRIPT_DIR}"/tool_kit.sh source "${SCRIPT_DIR}"/signal_trap.sh