diff options
Diffstat (limited to 'academic/cblas/patches/cmake-piecewise.diff')
-rw-r--r-- | academic/cblas/patches/cmake-piecewise.diff | 246 |
1 files changed, 115 insertions, 131 deletions
diff --git a/academic/cblas/patches/cmake-piecewise.diff b/academic/cblas/patches/cmake-piecewise.diff index 378acc8769..37cde2acaa 100644 --- a/academic/cblas/patches/cmake-piecewise.diff +++ b/academic/cblas/patches/cmake-piecewise.diff @@ -2,69 +2,37 @@ diff --git a/CBLAS/CMakeLists.txt b/CBLAS/CMakeLists.txt --- a/CBLAS/CMakeLists.txt +++ b/CBLAS/CMakeLists.txt @@ -1,8 +1,6 @@ - message(STATUS "CBLAS enable") + message(STATUS "CBLAS enabled") enable_language(C) -set(LAPACK_INSTALL_EXPORT_NAME ${CBLASLIB}-targets) - # Create a header file cblas.h for the routines called in my C programs - include(FortranCInterface) - ## Ensure that the fortran compiler and c compiler specified are compatible -@@ -45,54 +43,8 @@ - add_subdirectory(examples) - endif() - --if(NOT BLAS_FOUND) -- set(ALL_TARGETS ${ALL_TARGETS} ${BLASLIB}) --endif() -- --# Export cblas targets from the --# install tree, if any. --set(_cblas_config_install_guard_target "") --if(ALL_TARGETS) -- install(EXPORT ${CBLASLIB}-targets -- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CBLASLIB}-${LAPACK_VERSION} -- COMPONENT Development -- ) -- # Choose one of the cblas targets to use as a guard for -- # cblas-config.cmake to load targets from the install tree. -- list(GET ALL_TARGETS 0 _cblas_config_install_guard_target) --endif() -- --# Export cblas targets from the build tree, if any. --set(_cblas_config_build_guard_target "") --if(ALL_TARGETS) -- export(TARGETS ${ALL_TARGETS} FILE ${CBLASLIB}-targets.cmake) -- -- # Choose one of the cblas targets to use as a guard -- # for cblas-config.cmake to load targets from the build tree. -- list(GET ALL_TARGETS 0 _cblas_config_build_guard_target) --endif() + include(CheckLanguage) + check_language(Fortran) +@@ -54,22 +52,3 @@ + DESTINATION ${PKG_CONFIG_DIR} + COMPONENT Development + ) - -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-version.cmake.in - ${LAPACK_BINARY_DIR}/${CBLASLIB}-config-version.cmake @ONLY) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-build.cmake.in - ${LAPACK_BINARY_DIR}/${CBLASLIB}-config.cmake @ONLY) - -- - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cblas.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${CBLASLIB}.pc @ONLY) - install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/${CBLASLIB}.pc - DESTINATION ${PKG_CONFIG_DIR} - ) -- -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-install.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${CBLASLIB}-config.cmake @ONLY) -install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${CBLASLIB}-config.cmake - ${LAPACK_BINARY_DIR}/${CBLASLIB}-config-version.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CBLASLIB}-${LAPACK_VERSION} +- COMPONENT Development - ) - --#install(EXPORT ${CBLASLIB}-targets --# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CBLASLIB}-${LAPACK_VERSION} --# COMPONENT Development --# ) +-install(EXPORT ${CBLASLIB}-targets +- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CBLASLIB}-${LAPACK_VERSION} +- COMPONENT Development +- ) diff --git a/CBLAS/cmake/cblas-config-build.cmake.in b/CBLAS/cmake/cblas-config-build.cmake.in deleted file mode 100644 --- a/CBLAS/cmake/cblas-config-build.cmake.in @@ -88,15 +56,12 @@ diff --git a/CBLAS/cmake/cblas-config-install.cmake.in b/CBLAS/cmake/cblas-confi deleted file mode 100644 --- a/CBLAS/cmake/cblas-config-install.cmake.in +++ /dev/null -@@ -1,23 +0,0 @@ +@@ -1,19 +0,0 @@ -# Compute locations from <prefix>/@{LIBRARY_DIR@/cmake/lapacke-<v>/<self>.cmake -get_filename_component(_CBLAS_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) --get_filename_component(_CBLAS_PREFIX "${_CBLAS_SELF_DIR}" PATH) --get_filename_component(_CBLAS_PREFIX "${_CBLAS_PREFIX}" PATH) --get_filename_component(_CBLAS_PREFIX "${_CBLAS_PREFIX}" PATH) - -# Load the LAPACK package with which we were built. --set(LAPACK_DIR "${_CBLAS_PREFIX}/@CMAKE_INSTALL_LIBDIR@/cmake/@LAPACKLIB@-@LAPACK_VERSION@") +-set(LAPACK_DIR "@CMAKE_INSTALL_FULL_LIBDIR@/cmake/@LAPACKLIB@-@LAPACK_VERSION@") -find_package(LAPACK NO_MODULE) - -# Load lapacke targets from the install tree. @@ -105,12 +70,11 @@ deleted file mode 100644 -endif() - -# Report lapacke header search locations. --set(CBLAS_INCLUDE_DIRS ${_CBLAS_PREFIX}/include) +-set(CBLAS_INCLUDE_DIRS @CMAKE_INSTALL_FULL_INCLUDEDIR@) - -# Report lapacke libraries. -set(CBLAS_LIBRARIES @CBLASLIB@) - --unset(_CBLAS_PREFIX) -unset(_CBLAS_SELF_DIR) diff --git a/CBLAS/cmake/cblas-config-version.cmake.in b/CBLAS/cmake/cblas-config-version.cmake.in deleted file mode 100644 @@ -128,15 +92,15 @@ deleted file mode 100644 diff --git a/CBLAS/src/CMakeLists.txt b/CBLAS/src/CMakeLists.txt --- a/CBLAS/src/CMakeLists.txt +++ b/CBLAS/src/CMakeLists.txt -@@ -123,9 +123,5 @@ +@@ -172,9 +172,5 @@ if(HAS_ATTRIBUTE_WEAK_SUPPORT) target_compile_definitions(${CBLASLIB} PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT) endif() -target_include_directories(${CBLASLIB} PUBLIC -- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include> +- $<BUILD_INTERFACE:${LAPACK_BINARY_DIR}/include> - $<INSTALL_INTERFACE:include> -) - target_link_libraries(${CBLASLIB} PRIVATE ${BLAS_LIBRARIES}) + target_link_libraries(${CBLASLIB} PUBLIC ${BLAS_LIBRARIES}) lapack_install_library(${CBLASLIB}) diff --git a/CMAKE/lapack-config-build.cmake.in b/CMAKE/lapack-config-build.cmake.in deleted file mode 100644 @@ -184,8 +148,8 @@ deleted file mode 100644 diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -160,11 +160,8 @@ - +@@ -155,11 +155,8 @@ + endif() # -------------------------------------------------- -set(LAPACK_INSTALL_EXPORT_NAME ${LAPACKLIB}-targets) @@ -196,30 +160,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT RuntimeLibraries -@@ -204,21 +201,6 @@ - include(CheckLAPACKCompilerFlags) - CheckLAPACKCompilerFlags() +@@ -218,8 +215,9 @@ --# -------------------------------------------------- --# Check second function -- --include(CheckTimeFunction) --set(NONE ${TIME_FUNC}) --CHECK_TIME_FUNCTION(NONE TIME_FUNC) --CHECK_TIME_FUNCTION(INT_CPU_TIME TIME_FUNC) --CHECK_TIME_FUNCTION(EXT_ETIME TIME_FUNC) --CHECK_TIME_FUNCTION(EXT_ETIME_ TIME_FUNC) --CHECK_TIME_FUNCTION(INT_ETIME TIME_FUNC) --message(STATUS "--> Will use second_${TIME_FUNC}.f and dsecnd_${TIME_FUNC}.f as timing function.") -- --set(SECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/second_${TIME_FUNC}.f) --set(DSECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/dsecnd_${TIME_FUNC}.f) -- - # deprecated LAPACK and LAPACKE routines - option(BUILD_DEPRECATED "Build deprecated routines" OFF) - message(STATUS "Build deprecated routines: ${BUILD_DEPRECATED}") -@@ -242,8 +224,9 @@ - endif() # -------------------------------------------------- -# Subdirectories that need to be processed @@ -229,7 +171,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt # Check the usage of the user provided BLAS libraries if(BLAS_LIBRARIES) -@@ -254,113 +237,108 @@ +@@ -230,59 +228,41 @@ if(BLAS_FOUND) message(STATUS "--> BLAS supplied by user is WORKING, will use ${BLAS_LIBRARIES}.") else() @@ -300,21 +242,28 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt # Check the usage of the user provided or automatically found LAPACK libraries if(LAPACK_LIBRARIES) - include(CheckFortranFunctionExists) - set(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES}) - # Check if new routine of 3.4.0 is in LAPACK_LIBRARIES -- CHECK_FORTRAN_FUNCTION_EXISTS("dgeqrt" LATESTLAPACK_FOUND) -+ CHECK_FORTRAN_FUNCTION_EXISTS("dgeqrt" LAPACK_FOUND) - unset(CMAKE_REQUIRED_LIBRARIES) -- if(LATESTLAPACK_FOUND) -+ if(LAPACK_FOUND) - message(STATUS "--> LAPACK supplied by user is WORKING, will use ${LAPACK_LIBRARIES}.") +@@ -293,27 +273,28 @@ + include(CheckFortranFunctionExists) + set(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES}) + # Check if new routine of 3.4.0 is in LAPACK_LIBRARIES +- CHECK_FORTRAN_FUNCTION_EXISTS("dgeqrt" LATESTLAPACK_FOUND) ++ CHECK_FORTRAN_FUNCTION_EXISTS("dgeqrt" LAPACK_FOUND) + unset(CMAKE_REQUIRED_LIBRARIES) +- if(LATESTLAPACK_FOUND) ++ if(LAPACK_FOUND) + message(STATUS "--> LAPACK supplied by user is WORKING, will use ${LAPACK_LIBRARIES}.") + else() +- message(ERROR "--> LAPACK supplied by user is not WORKING or is older than LAPACK 3.4.0, CANNOT USE ${LAPACK_LIBRARIES}.") +- message(ERROR "--> Will use REFERENCE LAPACK (by default)") +- message(ERROR "--> Or Correct your LAPACK_LIBRARIES entry ") +- message(ERROR "--> Or Consider checking USE_OPTIMIZED_LAPACK") ++ message(SEND_ERROR "--> LAPACK supplied by user is NOT WORKING or is older than LAPACK 3.4.0, cannot use ${LAPACK_LIBRARIES}.") + endif() else() -- message(ERROR "--> LAPACK supplied by user is not WORKING or is older than LAPACK 3.4.0, CANNOT USE ${LAPACK_LIBRARIES}.") -- message(ERROR "--> Will use REFERENCE LAPACK (by default)") -- message(ERROR "--> Or Correct your LAPACK_LIBRARIES entry ") -- message(ERROR "--> Or Consider checking USE_OPTIMIZED_LAPACK") -+ message(SEND_ERROR "--> LAPACK supplied by user is NOT WORKING or is older than LAPACK 3.4.0, cannot use ${LAPACK_LIBRARIES}.") + message(STATUS "--> LAPACK supplied by user is ${LAPACK_LIBRARIES}.") + message(STATUS "--> CMake couldn't find a Fortran compiler, so it cannot check if the provided LAPACK library works.") +- set(LATESTLAPACK_FOUND TRUE) ++ set(LAPACK_FOUND TRUE) endif() -endif() @@ -330,20 +279,12 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt + set(LAPACK_FOUND TRUE) + + set(NEED_BLAS TRUE) -+ -+ # Check second function -+ include(CheckTimeFunction) -+ set(NONE ${TIME_FUNC}) -+ CHECK_TIME_FUNCTION(NONE TIME_FUNC) -+ CHECK_TIME_FUNCTION(INT_CPU_TIME TIME_FUNC) -+ CHECK_TIME_FUNCTION(EXT_ETIME TIME_FUNC) -+ CHECK_TIME_FUNCTION(EXT_ETIME_ TIME_FUNC) -+ CHECK_TIME_FUNCTION(INT_ETIME TIME_FUNC) -+ message(STATUS "--> Will use second_${TIME_FUNC}.f and dsecnd_${TIME_FUNC}.f as timing function.") -+ -+ set(SECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/second_${TIME_FUNC}.f) -+ set(DSECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/dsecnd_${TIME_FUNC}.f) -+ + + enable_language(Fortran) + +@@ -336,67 +317,38 @@ + set(DSECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/dsecnd_${TIME_FUNC}.f) + add_subdirectory(SRC) -else() - set(CMAKE_EXE_LINKER_FLAGS @@ -381,11 +322,37 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt option(LAPACKE_WITH_TMG "Build LAPACKE with tmglib routines" OFF) if(LAPACKE_WITH_TMG) - set(LAPACKE ON) +-endif() +- +-# TMGLIB +-# Cache export target +-set(LAPACK_INSTALL_EXPORT_NAME_CACHE ${LAPACK_INSTALL_EXPORT_NAME}) +-if(BUILD_TESTING OR LAPACKE_WITH_TMG) +- enable_language(Fortran) +- if(LATESTLAPACK_FOUND AND LAPACKE_WITH_TMG) +- set(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES}) +- # Check if dlatms (part of tmg) is found +- include(CheckFortranFunctionExists) +- CHECK_FORTRAN_FUNCTION_EXISTS("dlatms" LAPACK_WITH_TMGLIB_FOUND) +- unset(CMAKE_REQUIRED_LIBRARIES) +- if(NOT LAPACK_WITH_TMGLIB_FOUND) +- # Build and install TMG as part of LAPACKE targets (as opposed to LAPACK +- # targets) +- set(LAPACK_INSTALL_EXPORT_NAME ${LAPACKELIB}-targets) +- endif() +- endif() +- add_subdirectory(TESTING/MATGEN) + set(BUILD_LAPACKE ON) endif() - if(BUILD_TESTING OR LAPACKE_WITH_TMG) #already included, avoid double inclusion - add_subdirectory(TESTING/MATGEN) - endif() +-# Reset export target +-set(LAPACK_INSTALL_EXPORT_NAME ${LAPACK_INSTALL_EXPORT_NAME_CACHE}) +-unset(LAPACK_INSTALL_EXPORT_NAME_CACHE) +- + +-#------------------------------------- +-# LAPACKE + # Include lapack.h and lapacke_mangling.h even if LAPACKE is not built + add_subdirectory(LAPACKE/include) -if(LAPACKE) +if(BUILD_LAPACKE) @@ -393,7 +360,11 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt add_subdirectory(LAPACKE) endif() -@@ -414,111 +392,16 @@ +- + #------------------------------------- + # BLAS++ / LAPACK++ + option(BLAS++ "Build BLAS++" OFF) +@@ -446,111 +398,16 @@ ExternalProject_Add_StepDependencies(lapackpp build blaspp ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}) endif() @@ -411,7 +382,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -set(CPACK_PACKAGE_INSTALL_DIRECTORY "LAPACK") -if(WIN32 AND NOT UNIX) - # There is a bug in NSI that does not handle full unix paths properly. Make -- # sure there is at least one set of four (4) backlasshes. +- # sure there is at least one set of four (4) backslashes. - set(CPACK_NSIS_HELP_LINK "http:\\\\\\\\http://icl.cs.utk.edu/lapack-forum") - set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.netlib.org/lapack") - set(CPACK_NSIS_CONTACT "lapack@eecs.utk.edu") @@ -437,10 +408,6 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt - set(ALL_TARGETS ${ALL_TARGETS} ${LAPACKLIB}) -endif() - --if(BUILD_TESTING OR LAPACKE_WITH_TMG) -- set(ALL_TARGETS ${ALL_TARGETS} ${TMGLIB}) --endif() -- -# Export lapack targets, not including lapacke, from the -# install tree, if any. -set(_lapack_config_install_guard_target "") @@ -463,6 +430,10 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -# Include lapacke in targets exported from the build tree. -if(LAPACKE) - set(ALL_TARGETS ${ALL_TARGETS} ${LAPACKELIB}) +-endif() +- +-if(NOT LAPACK_WITH_TMGLIB_FOUND AND LAPACKE_WITH_TMG) +- set(ALL_TARGETS ${ALL_TARGETS} ${TMGLIB}) +# Neither user specified or optimized BLAS libraries can be used +if(NEED_BLAS AND NOT BLAS_FOUND) + message(FATAL_ERROR "--> No BLAS library found. Specify BLAS_LIBRARIES or enable USE_OPTIMIZED_BLAS or BUILD_BLAS.") @@ -515,20 +486,20 @@ diff --git a/LAPACKE/CMakeLists.txt b/LAPACKE/CMakeLists.txt --- a/LAPACKE/CMakeLists.txt +++ b/LAPACKE/CMakeLists.txt @@ -1,8 +1,6 @@ - message(STATUS "LAPACKE enable") + message(STATUS "LAPACKE enabled") enable_language(C) -set(LAPACK_INSTALL_EXPORT_NAME ${LAPACKELIB}-targets) - - # Create a header file lapacke_mangling.h for the routines called in my C programs - include(FortranCInterface) - ## Ensure that the fortran compiler and c compiler specified are compatible -@@ -79,14 +77,6 @@ + include_directories(include ${LAPACK_BINARY_DIR}/include) + add_subdirectory(src) + add_subdirectory(utils) +@@ -74,14 +72,6 @@ VERSION ${LAPACK_VERSION} SOVERSION ${LAPACK_MAJOR_VERSION} ) -target_include_directories(${LAPACKELIB} PUBLIC -- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> +- $<BUILD_INTERFACE:${LAPACK_BINARY_DIR}/include> - $<INSTALL_INTERFACE:include> -) -if(WIN32 AND NOT UNIX) @@ -538,7 +509,7 @@ diff --git a/LAPACKE/CMakeLists.txt b/LAPACKE/CMakeLists.txt if(LAPACKE_WITH_TMG) target_link_libraries(${LAPACKELIB} PRIVATE ${TMGLIB}) -@@ -111,22 +101,3 @@ +@@ -106,22 +96,3 @@ DESTINATION ${PKG_CONFIG_DIR} COMPONENT Development ) @@ -587,15 +558,12 @@ diff --git a/LAPACKE/cmake/lapacke-config-install.cmake.in b/LAPACKE/cmake/lapac deleted file mode 100644 --- a/LAPACKE/cmake/lapacke-config-install.cmake.in +++ /dev/null -@@ -1,26 +0,0 @@ +@@ -1,22 +0,0 @@ -# Compute locations from <prefix>/@{LIBRARY_DIR@/cmake/lapacke-<v>/<self>.cmake -get_filename_component(_LAPACKE_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) --get_filename_component(_LAPACKE_PREFIX "${_LAPACKE_SELF_DIR}" PATH) --get_filename_component(_LAPACKE_PREFIX "${_LAPACKE_PREFIX}" PATH) --get_filename_component(_LAPACKE_PREFIX "${_LAPACKE_PREFIX}" PATH) - -# Load the LAPACK package with which we were built. --set(LAPACK_DIR "${_LAPACKE_PREFIX}/@CMAKE_INSTALL_LIBDIR@/cmake/@LAPACK@-@LAPACK_VERSION@") +-set(LAPACK_DIR "@CMAKE_INSTALL_FULL_LIBDIR@/cmake/@LAPACKLIB@-@LAPACK_VERSION@") -find_package(LAPACK NO_MODULE) - -# Load lapacke targets from the install tree. @@ -607,12 +575,11 @@ deleted file mode 100644 -set(LAPACKE_Fortran_COMPILER_ID ${LAPACK_Fortran_COMPILER_ID}) - -# Report lapacke header search locations. --set(LAPACKE_INCLUDE_DIRS ${_LAPACKE_PREFIX}/include) +-set(LAPACKE_INCLUDE_DIRS @CMAKE_INSTALL_FULL_INCLUDEDIR@) - -# Report lapacke libraries. -set(LAPACKE_LIBRARIES @LAPACKELIB@ ${LAPACK_LIBRARIES}) - --unset(_LAPACKE_PREFIX) -unset(_LAPACKE_SELF_DIR) diff --git a/LAPACKE/cmake/lapacke-config-version.cmake.in b/LAPACKE/cmake/lapacke-config-version.cmake.in deleted file mode 100644 @@ -627,3 +594,20 @@ deleted file mode 100644 - endif() -endif() - +diff --git a/LAPACKE/include/CMakeLists.txt b/LAPACKE/include/CMakeLists.txt +--- a/LAPACKE/include/CMakeLists.txt ++++ b/LAPACKE/include/CMakeLists.txt +@@ -1,5 +1,5 @@ + set(LAPACKE_INCLUDE lapack.h) +-IF(LAPACKE) ++IF(BUILD_LAPACKE) + list(APPEND LAPACKE_INCLUDE lapacke.h lapacke_config.h lapacke_utils.h) + endif() + +@@ -23,4 +23,4 @@ + message(WARNING "Reverting to pre-defined include/lapacke_mangling.h") + configure_file(lapacke_mangling_with_flags.h.in + ${LAPACK_BINARY_DIR}/include/lapacke_mangling.h) +-endif() +\ No newline at end of file ++endif() |