diff --git a/tools/toolchain/scripts/stage8/install_sirius.sh b/tools/toolchain/scripts/stage8/install_sirius.sh index aa93f90c0c..d227262946 100755 --- a/tools/toolchain/scripts/stage8/install_sirius.sh +++ b/tools/toolchain/scripts/stage8/install_sirius.sh @@ -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}"