-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LAPACK requires CMake 3.11 or newer #975
Labels
Comments
Suggested fix (will be PR'ed later) tested on Ubuntu 18.04 with CMake 3.10.2: diff --git a/BLAS/SRC/CMakeLists.txt b/BLAS/SRC/CMakeLists.txt
index 9df128eb5..d90198f37 100644
--- a/BLAS/SRC/CMakeLists.txt
+++ b/BLAS/SRC/CMakeLists.txt
@@ -124,9 +124,9 @@ if(BUILD_INDEX64_EXT_API)
#Add _64 suffix to all Fortran functions via macros
foreach(F IN LISTS SOURCES_64_F)
if(CMAKE_Fortran_COMPILER_ID STREQUAL "NAG")
- set(COPT_64_F -fpp)
+ set_source_files_properties(${F} PROPERTIES COMPILE_FLAGS "-fpp")
else()
- set(COPT_64_F -cpp)
+ set_source_files_properties(${F} PROPERTIES COMPILE_FLAGS "-cpp")
endif()
file(STRINGS ${F} ${F}.lst)
list(FILTER ${F}.lst INCLUDE REGEX "subroutine|SUBROUTINE|external|EXTERNAL|function|FUNCTION")
@@ -137,10 +137,10 @@ if(BUILD_INDEX64_EXT_API)
string(REGEX REPLACE "^[a-zA-Z0-9_ *]*(subroutine|SUBROUTINE|external|EXTERNAL|function|FUNCTION)[ ]*[*]?" "" FUNC ${FUNC})
string(REGEX REPLACE "[(][a-zA-Z0-9_, )]*$" "" FUNC ${FUNC})
string(STRIP ${FUNC} FUNC)
- list(APPEND COPT_64_F "-D${FUNC}=${FUNC}_64")
+ list(APPEND COPT_64_F "${FUNC}=${FUNC}_64")
endforeach()
list(REMOVE_DUPLICATES COPT_64_F)
- set_source_files_properties(${F} PROPERTIES COMPILE_OPTIONS "${COPT_64_F}")
+ set_source_files_properties(${F} PROPERTIES COMPILE_DEFINITIONS "${COPT_64_F}")
endforeach()
endif() |
christoph-conrads
added a commit
to christoph-conrads/lapack
that referenced
this issue
Jan 13, 2024
The COMPILE_OPTIONS property exists only from CMake 3.11 onwards. fixes Reference-LAPACK#975
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When building a BLAS shared library with
cmake -DBUILD_SHARED_LIBS=ON
with CMake releases before version 3.11, linking of the BLAS library will fail:The cause is an attempt to set the source file property
COMPILE_OPTIONS
:lapack/BLAS/SRC/CMakeLists.txt
Lines 140 to 143 in d7ea9c5
This property exists only from CMake 3.11 onwards and these compiler options would avoid the name clash.
There are two possible fixes:
COMPILE_FLAGS
andCOMPILE_DEFINITIONS
propertiesChecklist
The text was updated successfully, but these errors were encountered: