Change CMAKE_BUILD_TYPE for SIRIUS

SIRIUS_DBG and SIRIUS_OPT are not really considered by CMake and rather the CMAKE_BUILD_TYPE matters.
The CMAKE_BUILD_TYPEs "Release" and "RelWithDebInfo" employ -O3/-O2, but already -O2 makes the SIRIUS
build quite memory and time intensive. We are primarily interested here in testing SIRIUS with CP2K
and thus use CMAKE_BUILD_TYPE "Debug" for testing.
This commit is contained in:
Matthias Krack 2023-03-03 11:11:23 +01:00
parent 69bb5539cc
commit 7fb402190f

View file

@ -83,8 +83,19 @@ case "$with_sirius" in
fi
if [ "$ARCH" = "x86_64" ]; then
SIRIUS_OPT="-O3 -DNDEBUG -mtune=native -ftree-loop-vectorize ${MATH_CFLAGS}"
SIRIUS_DBG="-O2 -g -mtune=native -ftree-loop-vectorize ${MATH_CFLAGS}"
if [ "${with_intel}" != "__DONTUSE__" ]; then
SIRIUS_OPT="-DNDEBUG -O2 -g ${MATH_CFLAGS}"
SIRIUS_DBG="-O1 -g ${MATH_CFLAGS}"
# SIRIUS_DBG and SIRIUS_OPT are not really considered by CMake and rather the CMAKE_BUILD_TYPE matters.
# The CMAKE_BUILD_TYPEs "Release" and "RelWithDebInfo" employ -O3/-O2, but already -O2 makes the SIRIUS
# build quite memory and time intensive. We are primarily interested here in testing SIRIUS with CP2K
# and thus use CMAKE_BUILD_TYPE "Debug" for testing. Switch the lines below for production.
# EXTRA_CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_FLAGS= ${EXTRA_CMAKE_FLAGS}"
EXTRA_CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS= ${EXTRA_CMAKE_FLAGS}"
else
SIRIUS_OPT="-O3 -DNDEBUG -mtune=native -ftree-loop-vectorize ${MATH_CFLAGS}"
SIRIUS_DBG="-O2 -g -mtune=native -ftree-loop-vectorize ${MATH_CFLAGS}"
fi
fi
pkg_install_dir="${INSTALLDIR}/sirius-${sirius_ver}"