From 936328ae8bfb7a52e5d540a1fed99115a8131827 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 29 Dec 2023 08:32:52 +0100 Subject: [PATCH] re-enabled support for older CMake --- CMakeLists.txt | 2 +- cmake/Compiler-GNU.cmake | 2 ++ cmake/Compiler-Intel.cmake | 2 ++ cmake/Compiler-IntelLLVM.cmake | 2 ++ cmake/Compiler-LLVMFlang.cmake | 2 +- 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a8e551373..787117524 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ else() endif() add_definitions("-D${DAMASK_SOLVER}") -set(CMAKE_Fortran_PREPROCESS "ON") +set(CMAKE_Fortran_PREPROCESS "ON") # works only for CMake >= 3.18 # EXPERIMENTAL: This might help to detect HDF5 and FFTW3 in the future if PETSc is not aware of them set(ENV{PKG_CONFIG_PATH} "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/externalpackages:$ENV{PKG_CONFIG_PATH}") diff --git a/cmake/Compiler-GNU.cmake b/cmake/Compiler-GNU.cmake index 61ec2143b..43ed64af2 100644 --- a/cmake/Compiler-GNU.cmake +++ b/cmake/Compiler-GNU.cmake @@ -19,6 +19,8 @@ set (STANDARD_CHECK "-std=f2018 -pedantic-errors" ) #------------------------------------------------------------------------------------------------ # Fine tuning compilation options +set (COMPILE_FLAGS "${COMPILE_FLAGS} -cpp") # preprocessor, needed for CMake < 3.18 + set (COMPILE_FLAGS "${COMPILE_FLAGS} -fPIE") # position independent code diff --git a/cmake/Compiler-Intel.cmake b/cmake/Compiler-Intel.cmake index 59ba6d74d..d5e2dff7d 100644 --- a/cmake/Compiler-Intel.cmake +++ b/cmake/Compiler-Intel.cmake @@ -22,6 +22,8 @@ set (LINKER_FLAGS "${LINKER_FLAGS} -shared-intel") #------------------------------------------------------------------------------------------------ # Fine tuning compilation options +set (COMPILE_FLAGS "${COMPILE_FLAGS} -fpp") # preprocessor, needed for CMake < 3.18 + set (COMPILE_FLAGS "${COMPILE_FLAGS} -no-ftz") # disable flush underflow to zero, will be set if -O[1,2,3] diff --git a/cmake/Compiler-IntelLLVM.cmake b/cmake/Compiler-IntelLLVM.cmake index 3749b925f..079574c4b 100644 --- a/cmake/Compiler-IntelLLVM.cmake +++ b/cmake/Compiler-IntelLLVM.cmake @@ -24,6 +24,8 @@ set (LINKER_FLAGS "${LINKER_FLAGS} -shared-intel -fc=ifx") #------------------------------------------------------------------------------------------------ # Fine tuning compilation options +set (COMPILE_FLAGS "${COMPILE_FLAGS} -fpp") # preprocessor, needed for CMake < 3.18 + set (COMPILE_FLAGS "${COMPILE_FLAGS} -no-ftz") # disable flush underflow to zero, will be set if -O[1,2,3] diff --git a/cmake/Compiler-LLVMFlang.cmake b/cmake/Compiler-LLVMFlang.cmake index b28df7027..f6be61b45 100644 --- a/cmake/Compiler-LLVMFlang.cmake +++ b/cmake/Compiler-LLVMFlang.cmake @@ -9,4 +9,4 @@ set (STANDARD_CHECK "-std=f2018 -pedantic" ) #------------------------------------------------------------------------------------------------ # Fine tuning compilation options - +set (COMPILE_FLAGS "${COMPILE_FLAGS} -cpp") # preprocessor, needed for CMake < 3.18