From 40d916fa052938aa30a02c7ee4ec8b959c26ca34 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Thu, 17 Sep 2020 09:51:56 -0600 Subject: [PATCH 1/2] [BugFix] fix for intel build fail #546 Incorrect CMake flag was specified --- modules/nwtc-library/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nwtc-library/CMakeLists.txt b/modules/nwtc-library/CMakeLists.txt index a32fbc3832..fde58d3282 100644 --- a/modules/nwtc-library/CMakeLists.txt +++ b/modules/nwtc-library/CMakeLists.txt @@ -67,9 +67,9 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) set_source_files_properties(src/NetLib/slatec/dqk61.f PROPERTIES COMPILE_FLAGS "/assume:recursion") set_source_files_properties(src/NetLib/slatec/qk61.f PROPERTIES COMPILE_FLAGS "/assume:recursion") else() - set_source_files_properties(src/NetLib/slatec/NWTC_SLATEC.f90 PROPERTIES COMPILE_FLAGS "-assume recursion") - set_source_files_properties(src/NetLib/slatec/dqk61.f PROPERTIES COMPILE_FLAGS "-assume recursion") - set_source_files_properties(src/NetLib/slatec/qk61.f PROPERTIES COMPILE_FLAGS "-assume recursion") + set_source_files_properties(src/NetLib/slatec/NWTC_SLATEC.f90 PROPERTIES COMPILE_FLAGS "-recursive") + set_source_files_properties(src/NetLib/slatec/dqk61.f PROPERTIES COMPILE_FLAGS "-recursive") + set_source_files_properties(src/NetLib/slatec/qk61.f PROPERTIES COMPILE_FLAGS "-recursive") endif() endif() endif() From 0323d671b95a40d4a20367a99c18df88df5d505d Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Fri, 18 Sep 2020 11:48:15 -0600 Subject: [PATCH 2/2] [BugFix] intel compiler version logic check for assume:recursion flags --- modules/nwtc-library/CMakeLists.txt | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/modules/nwtc-library/CMakeLists.txt b/modules/nwtc-library/CMakeLists.txt index fde58d3282..9ca55914a7 100644 --- a/modules/nwtc-library/CMakeLists.txt +++ b/modules/nwtc-library/CMakeLists.txt @@ -62,14 +62,27 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) set_source_files_properties(src/NetLib/slatec/dqk61.f PROPERTIES COMPILE_FLAGS -frecursive) set_source_files_properties(src/NetLib/slatec/qk61.f PROPERTIES COMPILE_FLAGS -frecursive) elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel") - if (WIN32) - set_source_files_properties(src/NetLib/slatec/NWTC_SLATEC.f90 PROPERTIES COMPILE_FLAGS "/assume:recursion") - set_source_files_properties(src/NetLib/slatec/dqk61.f PROPERTIES COMPILE_FLAGS "/assume:recursion") - set_source_files_properties(src/NetLib/slatec/qk61.f PROPERTIES COMPILE_FLAGS "/assume:recursion") - else() - set_source_files_properties(src/NetLib/slatec/NWTC_SLATEC.f90 PROPERTIES COMPILE_FLAGS "-recursive") - set_source_files_properties(src/NetLib/slatec/dqk61.f PROPERTIES COMPILE_FLAGS "-recursive") - set_source_files_properties(src/NetLib/slatec/qk61.f PROPERTIES COMPILE_FLAGS "-recursive") + if("${CMAKE_Fortran_COMPILER_VERSION}" VERSION_LESS "19") + if (WIN32) + set_source_files_properties(src/NetLib/slatec/NWTC_SLATEC.f90 PROPERTIES COMPILE_FLAGS "/recursive") + set_source_files_properties(src/NetLib/slatec/dqk61.f PROPERTIES COMPILE_FLAGS "/recursive") + set_source_files_properties(src/NetLib/slatec/qk61.f PROPERTIES COMPILE_FLAGS "/recursive") + else() + set_source_files_properties(src/NetLib/slatec/NWTC_SLATEC.f90 PROPERTIES COMPILE_FLAGS "-recursive") + set_source_files_properties(src/NetLib/slatec/dqk61.f PROPERTIES COMPILE_FLAGS "-recursive") + set_source_files_properties(src/NetLib/slatec/qk61.f PROPERTIES COMPILE_FLAGS "-recursive") + endif() + else() # The above syntax will be deprecated after version 20. This is supported from version 19 onwards + # see: https://software.intel.com/content/www/us/en/develop/documentation/fortran-compiler-developer-guide-and-reference/top/compiler-reference/compiler-options/compiler-option-details/floating-point-options/recursive.html + if (WIN32) + set_source_files_properties(src/NetLib/slatec/NWTC_SLATEC.f90 PROPERTIES COMPILE_FLAGS "/assume:recursion") + set_source_files_properties(src/NetLib/slatec/dqk61.f PROPERTIES COMPILE_FLAGS "/assume:recursion") + set_source_files_properties(src/NetLib/slatec/qk61.f PROPERTIES COMPILE_FLAGS "/assume:recursion") + else() + set_source_files_properties(src/NetLib/slatec/NWTC_SLATEC.f90 PROPERTIES COMPILE_FLAGS "-assume recursion") + set_source_files_properties(src/NetLib/slatec/dqk61.f PROPERTIES COMPILE_FLAGS "-assume recursion") + set_source_files_properties(src/NetLib/slatec/qk61.f PROPERTIES COMPILE_FLAGS "-assume recursion") + endif() endif() endif() endif()