diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fed9cd..73ca74d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Deprecated +## [4.18.0] - 2025-05-13 + +### Fixed + +- Fixed issue with f2py detection where f2py was still being test compiled even if a user specified `-DUSE_F2PY:BOOL=OFF` + +### Changed + +- Make `proc_description` a `CACHE` variable + ## [4.17.0] - 2025-05-06 ### Added diff --git a/compiler/esma_compiler.cmake b/compiler/esma_compiler.cmake index 4886374..91fb553 100644 --- a/compiler/esma_compiler.cmake +++ b/compiler/esma_compiler.cmake @@ -3,6 +3,7 @@ ## Print out the processor description cmake_host_system_information(RESULT proc_description QUERY PROCESSOR_DESCRIPTION) message(STATUS "Processor description: ${proc_description}") +set(proc_description "${proc_description}" CACHE INTERNAL "Processor description") ## Checks for Fortran support list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/checks") diff --git a/python/esma_python.cmake b/python/esma_python.cmake index 0427346..ac4391e 100644 --- a/python/esma_python.cmake +++ b/python/esma_python.cmake @@ -4,11 +4,25 @@ # The new policy needed for f2py3 and Meson is 3.24 cmake_minimum_required(VERSION 3.24) +# Note f2py (-> distutils) does seem to support nagfor as an fcompiler, but +# testing with it did not work. For now, just don't do any f2py if using NAG +if (CMAKE_Fortran_COMPILER_ID MATCHES "NAG") + option(USE_F2PY "Turn on F2PY builds" OFF) +else () + option(USE_F2PY "Turn on F2PY builds" ON) +endif () + # Find Python set(Python_FIND_STRATEGY LOCATION) set(Python_FIND_UNVERSIONED_NAMES FIRST) set(Python_FIND_FRAMEWORK LAST) find_package(Python COMPONENTS Interpreter) +list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/f2py") +include (esma_find_python_module) +include (esma_check_python_module) +if (USE_F2PY) + include (esma_add_f2py_module) +endif () # Find Python2 set(Python2_FIND_STRATEGY LOCATION) @@ -18,7 +32,9 @@ find_package(Python2 COMPONENTS Interpreter) list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/f2py2") include (esma_find_python2_module) include (esma_check_python2_module) -include (esma_add_f2py2_module) +if (USE_F2PY) + include (esma_add_f2py2_module) +endif () # Find Python3 set(Python3_FIND_STRATEGY LOCATION) @@ -28,12 +44,7 @@ find_package(Python3 COMPONENTS Interpreter) list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/f2py3") include (esma_find_python3_module) include (esma_check_python3_module) -include (esma_add_f2py3_module) - -# Note f2py (-> distutils) does seem to support nagfor as an fcompiler, but -# testing with it did not work. For now, just don't do any f2py if using NAG -if (CMAKE_Fortran_COMPILER_ID MATCHES "NAG") - option(USE_F2PY "Turn on F2PY builds" OFF) -else () - option(USE_F2PY "Turn on F2PY builds" ON) +if (USE_F2PY) + include (esma_add_f2py3_module) endif () +