mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-29 06:35:28 -04:00
Update arch file
This commit is contained in:
parent
689583f9aa
commit
53a226acd6
1 changed files with 48 additions and 129 deletions
|
|
@ -13,8 +13,10 @@
|
|||
# on an Apple M1 (macOS Sonoma 14.0)
|
||||
#
|
||||
# Usage: Source this arch file and then run make as instructed.
|
||||
# Ensure the links in /usr/local/bin to the lastest gcc version
|
||||
# and "brew unlink openmpi" (or mpich) if installed.
|
||||
#
|
||||
# Last update: 05.10.2023
|
||||
# Last update: 06.10.2023
|
||||
#
|
||||
# \
|
||||
if [[ "${0}" == "${BASH_SOURCE}" ]]; then \
|
||||
|
|
@ -29,8 +31,11 @@
|
|||
if $(command -v brew >/dev/null 2>&1); then \
|
||||
brew install cmake; \
|
||||
brew install coreutils; \
|
||||
brew install fftw; \
|
||||
brew install gcc; \
|
||||
brew install gsed; \
|
||||
brew install gsl; \
|
||||
brew install hdf5; \
|
||||
brew install openblas; \
|
||||
brew install pkg-config; \
|
||||
brew install wget; \
|
||||
|
|
@ -41,8 +46,10 @@
|
|||
return 1; \
|
||||
fi; \
|
||||
./install_cp2k_toolchain.sh --install-all -j${maxtasks} --no-arch-files --target-cpu=${target_cpu} \
|
||||
--with-cmake=system --with-gcc=system --with-${mpi_implementation} --with-elpa=no --with-libxsmm=no \
|
||||
--with-openblas=/opt/homebrew/Cellar/openblas/0.3.24 --with-pexsi=no --with-quip=no; \
|
||||
--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-pexsi=no --with-quip=no; \
|
||||
source ./install/setup; \
|
||||
cd ../..; \
|
||||
echo; \
|
||||
|
|
@ -61,15 +68,10 @@
|
|||
|
||||
# Set options
|
||||
DO_CHECKS := no
|
||||
SHARED := no
|
||||
TARGET_CPU := native
|
||||
USE_COSMA := 2.6.6
|
||||
USE_FFTW := 3.3.10
|
||||
USE_HDF5 := 1.14.2
|
||||
USE_LIBINT := 2.6.0
|
||||
USE_LIBVORI := 220621
|
||||
USE_LIBXC := 6.2.2
|
||||
USE_OPENBLAS := 0.3.24
|
||||
USE_PLUMED := 2.9.0
|
||||
USE_SCALAPACK := 2.2.1
|
||||
USE_SIRIUS := 7.4.3
|
||||
|
|
@ -94,15 +96,6 @@ DFLAGS += -D__NO_STATM_ACCESS
|
|||
|
||||
INSTALL_PATH := $(PWD)/tools/toolchain/install
|
||||
|
||||
ifeq ($(SHARED), yes)
|
||||
LD_SHARED := $(FC) -shared
|
||||
CFLAGS += -fPIC
|
||||
LDFLAGS := -Wl,--enable-new-dtags
|
||||
CP2K_LIB := $(PWD)/lib/$(ARCH)/$(ONEVERSION)
|
||||
LDFLAGS += -Wl,-rpath,$(CP2K_LIB)
|
||||
LDFLAGS += -Wl,-rpath,$(CP2K_LIB)/exts/dbcsr
|
||||
endif
|
||||
|
||||
# Settings for regression testing
|
||||
ifeq ($(DO_CHECKS), yes)
|
||||
DFLAGS += -D__CHECK_DIAG
|
||||
|
|
@ -135,37 +128,20 @@ ifneq ($(USE_PLUMED),)
|
|||
USE_PLUMED := $(strip $(USE_PLUMED))
|
||||
PLUMED_LIB := $(INSTALL_PATH)/plumed-$(USE_PLUMED)/lib
|
||||
DFLAGS += -D__PLUMED2
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(PLUMED_LIB) -L$(PLUMED_LIB) -lplumed -lplumedKernel
|
||||
else
|
||||
LIBS += $(PLUMED_LIB)/libplumed.a
|
||||
endif
|
||||
LIBS += $(PLUMED_LIB)/libplumed.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBVORI),)
|
||||
USE_LIBVORI := $(strip $(USE_LIBVORI))
|
||||
LIBVORI_LIB := $(INSTALL_PATH)/libvori-$(USE_LIBVORI)/lib
|
||||
DFLAGS += -D__LIBVORI
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(LIBVORI_LIB) -L$(LIBVORI_LIB) -lvori
|
||||
else
|
||||
LIBS += $(LIBVORI_LIB)/libvori.a
|
||||
endif
|
||||
LIBS += $(LIBVORI_LIB)/libvori.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBXC),)
|
||||
USE_LIBXC := $(strip $(USE_LIBXC))
|
||||
LIBXC_INC := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/include
|
||||
LIBXC_LIB := $(INSTALL_PATH)/libxc-$(USE_LIBXC)/lib
|
||||
CFLAGS += -I$(LIBXC_INC)
|
||||
DFLAGS += -D__LIBXC
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(LIBXC_LIB) -L$(LIBXC_LIB) -lxcf03 -lxc
|
||||
else
|
||||
LIBS += $(LIBXC_LIB)/libxcf03.a
|
||||
LIBS += $(LIBXC_LIB)/libxc.a
|
||||
endif
|
||||
endif
|
||||
LIBXC_HOME := $(shell brew --prefix libxc)
|
||||
CFLAGS += -I$(LIBXC_HOME)/include
|
||||
DFLAGS += -D__LIBXC
|
||||
LIBS += -Wl,-rpath,$(LIBXC_HOME)/lib -L$(LIBXC_HOME)/lib -lxcf03 -lxc
|
||||
|
||||
ifneq ($(USE_LIBINT),)
|
||||
USE_LIBINT := $(strip $(USE_LIBINT))
|
||||
|
|
@ -174,12 +150,8 @@ ifneq ($(USE_LIBINT),)
|
|||
LIBINT_LIB := $(INSTALL_PATH)/libint-v$(USE_LIBINT)-cp2k-lmax-$(LMAX)/lib
|
||||
CFLAGS += -I$(LIBINT_INC)
|
||||
DFLAGS += -D__LIBINT
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(LIBINT_LIB) -L$(LIBINT_LIB) -lint2
|
||||
else
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
endif
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
LIBS += $(LIBINT_LIB)/libint2.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SPGLIB),)
|
||||
|
|
@ -188,15 +160,10 @@ ifneq ($(USE_SPGLIB),)
|
|||
SPGLIB_LIB := $(INSTALL_PATH)/spglib-$(USE_SPGLIB)/lib
|
||||
CFLAGS += -I$(SPGLIB_INC)
|
||||
DFLAGS += -D__SPGLIB
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(SPGLIB_LIB) -L$(SPGLIB_LIB) -lsymspg
|
||||
else
|
||||
LIBS += $(SPGLIB_LIB)/libsymspg.a
|
||||
endif
|
||||
LIBS += $(SPGLIB_LIB)/libsymspg.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SIRIUS),)
|
||||
USE_GSL := 2.7
|
||||
LIBVDWXC_VER := 0.4.0
|
||||
SPFFT_VER := 1.0.6
|
||||
SPLA_VER := 1.5.5
|
||||
|
|
@ -220,33 +187,19 @@ ifneq ($(USE_SIRIUS),)
|
|||
DFLAGS += -D__SPFFT
|
||||
DFLAGS += -D__SPLA
|
||||
DFLAGS += -D__SIRIUS
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(SIRIUS_LIB) -L$(SIRIUS_LIB) -lsirius
|
||||
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
|
||||
else
|
||||
LIBS += $(SIRIUS_LIB)/libsirius.a
|
||||
LIBS += $(SPLA_LIB)/libspla.a
|
||||
LIBS += $(SPFFT_LIB)/libspfft.a
|
||||
LIBS += $(LIBVDWXC_LIB)/libvdwxc.a
|
||||
endif
|
||||
LIBS += $(SIRIUS_LIB)/libsirius.a
|
||||
LIBS += $(SPLA_LIB)/libspla.a
|
||||
LIBS += $(SPFFT_LIB)/libspfft.a
|
||||
LIBS += $(LIBVDWXC_LIB)/libvdwxc.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
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(HDF5_LIB) -L$(HDF5_LIB) -lhdf5_fortran -lhdf5_hl -lhdf5
|
||||
else
|
||||
LIBS += $(HDF5_LIB)/libhdf5_fortran.a
|
||||
LIBS += $(HDF5_LIB)/libhdf5_hl.a
|
||||
LIBS += $(HDF5_LIB)/libhdf5.a
|
||||
endif
|
||||
endif
|
||||
HDF5_HOME := $(shell brew --prefix hdf5)
|
||||
CFLAGS += -I$(HDF5_HOME)/include
|
||||
DFLAGS += -D__HDF5
|
||||
LIBS += $(HDF5_HOME)/lib/libhdf5_fortran.a
|
||||
LIBS += $(HDF5_HOME)/lib/libhdf5_hl.a
|
||||
LIBS += $(HDF5_HOME)/lib/libhdf5.a
|
||||
LIBS += $(shell brew --prefix libaec)/lib/libsz.a
|
||||
|
||||
ifneq ($(USE_COSMA),)
|
||||
USE_COSMA := $(strip $(USE_COSMA))
|
||||
|
|
@ -254,63 +207,29 @@ ifneq ($(USE_COSMA),)
|
|||
COSMA_LIB := $(INSTALL_PATH)/COSMA-$(USE_COSMA)/lib
|
||||
CFLAGS += -I$(COSMA_INC)
|
||||
DFLAGS += -D__COSMA
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(COSMA_LIB) -L$(COSMA_LIB) -lcosma_prefixed_pxgemm -lcosma -lcosta
|
||||
else
|
||||
LIBS += $(COSMA_LIB)/libcosma_prefixed_pxgemm.a
|
||||
LIBS += $(COSMA_LIB)/libcosma.a
|
||||
LIBS += $(COSMA_LIB)/libcosta.a
|
||||
endif
|
||||
LIBS += $(COSMA_LIB)/libcosma_prefixed_pxgemm.a
|
||||
LIBS += $(COSMA_LIB)/libcosma.a
|
||||
LIBS += $(COSMA_LIB)/libcosta.a
|
||||
endif
|
||||
|
||||
ifneq ($(USE_FFTW),)
|
||||
USE_FFTW := $(strip $(USE_FFTW))
|
||||
FFTW_INC := $(INSTALL_PATH)/fftw-$(USE_FFTW)/include
|
||||
FFTW_LIB := $(INSTALL_PATH)/fftw-$(USE_FFTW)/lib
|
||||
CFLAGS += -I$(FFTW_INC)
|
||||
DFLAGS += -D__FFTW3
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(FFTW_LIB) -L$(FFTW_LIB) -lfftw3_mpi -lfftw3_omp -lfftw3
|
||||
else
|
||||
LIBS += $(FFTW_LIB)/libfftw3_mpi.a
|
||||
LIBS += $(FFTW_LIB)/libfftw3_omp.a
|
||||
LIBS += $(FFTW_LIB)/libfftw3.a
|
||||
endif
|
||||
endif
|
||||
FFTW_HOME := $(shell brew --prefix fftw)
|
||||
CFLAGS += -I$(FFTW_HOME)/include
|
||||
DFLAGS += -D__FFTW3
|
||||
LIBS += $(FFTW_HOME)/lib/libfftw3_mpi.a
|
||||
LIBS += $(FFTW_HOME)/lib/libfftw3_omp.a
|
||||
LIBS += $(FFTW_HOME)/lib/libfftw3.a
|
||||
|
||||
ifneq ($(USE_SCALAPACK),)
|
||||
SCALAPACK_LIB := $(INSTALL_PATH)/scalapack-$(USE_SCALAPACK)/lib
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(SCALAPACK_LIB) -L$(SCALAPACK_LIB) -lscalapack
|
||||
else
|
||||
LIBS += $(SCALAPACK_LIB)/libscalapack.a
|
||||
endif
|
||||
endif
|
||||
USE_SCALAPACK := $(strip $(USE_SCALAPACK))
|
||||
LIBS += $(INSTALL_PATH)/scalapack-$(USE_SCALAPACK)/lib/libscalapack.a
|
||||
|
||||
ifneq ($(USE_OPENBLAS),)
|
||||
USE_OPENBLAS := $(strip $(USE_OPENBLAS))
|
||||
OPENBLAS_INC := /opt/homebrew/Cellar/openblas/$(USE_OPENBLAS)/include
|
||||
OPENBLAS_LIB := /opt/homebrew/Cellar/openblas/$(USE_OPENBLAS)/lib
|
||||
CFLAGS += -I$(OPENBLAS_INC)
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(OPENBLAS_LIB) -L$(OPENBLAS_LIB) -lopenblas
|
||||
else
|
||||
LIBS += $(OPENBLAS_LIB)/libopenblas.a
|
||||
endif
|
||||
endif
|
||||
GSL_HOME := $(shell brew --prefix gsl)
|
||||
CFLAGS += -I$(GSL_HOME)/include
|
||||
DFLAGS += -D__GSL
|
||||
LIBS += $(GSL_HOME)/lib/libgsl.a
|
||||
|
||||
ifneq ($(USE_GSL),)
|
||||
USE_GSL := $(strip $(USE_GSL))
|
||||
GSL_INC := $(INSTALL_PATH)/gsl-$(USE_GSL)/include
|
||||
GSL_LIB := $(INSTALL_PATH)/gsl-$(USE_GSL)/lib
|
||||
CFLAGS += -I$(GSL_INC)
|
||||
DFLAGS += -D__GSL
|
||||
ifeq ($(SHARED), yes)
|
||||
LIBS += -Wl,-rpath,$(GSL_LIB) -L$(GSL_LIB) -lgsl
|
||||
else
|
||||
LIBS += $(GSL_LIB)/libgsl.a -llapack
|
||||
endif
|
||||
endif
|
||||
OPENBLAS_HOME := $(shell brew --prefix openblas)
|
||||
CFLAGS += -I$(OPENBLAS_HOME)/include
|
||||
LIBS += $(OPENBLAS_HOME)/lib/libopenblas.a
|
||||
|
||||
CFLAGS += $(DFLAGS)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue