Skip to content

Commit

Permalink
Revised enabling MKL automatically.
Browse files Browse the repository at this point in the history
  • Loading branch information
hfp committed Aug 30, 2024
1 parent 2e3b82b commit 0c9cd4f
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions config/cp2k/Linux-x86-64-intelx.arch
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ EXTSHOME ?= $(CP2KHOME)/$(EXTSDIR)
EXTDBCSR ?= $(EXTSHOME)/dbcsr
DBCSRSRC ?= $(EXTDBCSR)/src
LEGACY ?= $(if $(wildcard $(EXTDBCSR)),0,1)
UNAME ?= $(shell uname 2>/dev/null)
UNAME ?= $(shell uname 2>/dev/null)
MNAME ?= $(shell uname -m 2>/dev/null)

ifeq (0,$(LEGACY))
IFLAGS += $(CP2KHOME)/$(OBJDIRNAME)/$(ARCH)/$(ONEVERSION)/exts/dbcsr
Expand Down Expand Up @@ -263,16 +264,18 @@ ifneq (0,$(BLAS))
endif

# enable MKL if available
ifeq (,$(strip $(MKLROOT)))
MKL_INCFILE := $(strip $(lastword $(sort $(wildcard /opt/intel/compilers_and_libraries_*/$(MKL_PLATFORM)/mkl/include/mkl.h))))
ifneq (,$(MKL_INCFILE))
MKLROOT := $(abspath $(dir $(MKL_INCFILE))/..)
ifneq (,$(filter x86_64,$(MNAME)))
ifeq (,$(strip $(MKLROOT)))
MKL_INCFILE := $(strip $(lastword $(sort $(wildcard /opt/intel/compilers_and_libraries_*/$(MKL_PLATFORM)/mkl/include/mkl.h))))
ifneq (,$(MKL_INCFILE))
MKLROOT := $(abspath $(dir $(MKL_INCFILE))/..)
endif
endif
endif
ifeq (,$(strip $(MKLROOT)))
MKL_INCFILE := $(strip $(wildcard /usr/include/mkl/mkl.h))
ifneq (,$(MKL_INCFILE))
MKLROOT := $(abspath $(dir $(MKL_INCFILE))/../..)
ifeq (,$(strip $(MKLROOT)))
MKL_INCFILE := $(strip $(wildcard /usr/include/mkl/mkl.h))
ifneq (,$(MKL_INCFILE))
MKLROOT := $(abspath $(dir $(MKL_INCFILE))/../..)
endif
endif
endif
ifeq (/,$(MKLROOT))
Expand Down

0 comments on commit 0c9cd4f

Please sign in to comment.