diff options
Diffstat (limited to 'academic/cblas/patches/cmake-piecewise.diff')
-rw-r--r-- | academic/cblas/patches/cmake-piecewise.diff | 209 |
1 files changed, 74 insertions, 135 deletions
diff --git a/academic/cblas/patches/cmake-piecewise.diff b/academic/cblas/patches/cmake-piecewise.diff index 7ea45fcfc943..37cde2acaa23 100644 --- a/academic/cblas/patches/cmake-piecewise.diff +++ b/academic/cblas/patches/cmake-piecewise.diff @@ -2,15 +2,15 @@ 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 -@@ -49,22 +47,3 @@ + include(CheckLanguage) + check_language(Fortran) +@@ -54,22 +52,3 @@ DESTINATION ${PKG_CONFIG_DIR} COMPONENT Development ) @@ -56,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. @@ -73,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 @@ -96,7 +92,7 @@ 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 -@@ -127,9 +127,5 @@ +@@ -172,9 +172,5 @@ if(HAS_ATTRIBUTE_WEAK_SUPPORT) target_compile_definitions(${CBLASLIB} PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT) endif() @@ -104,7 +100,7 @@ diff --git a/CBLAS/src/CMakeLists.txt b/CBLAS/src/CMakeLists.txt - $<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 @@ -152,18 +148,9 @@ deleted file mode 100644 diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -42,7 +42,7 @@ +@@ -155,11 +155,8 @@ endif() - # By default test Fortran compiler complex abs and complex division --option(TEST_FORTRAN_COMPILER "Test Fortran compiler complex abs and complex division" ON) -+option(TEST_FORTRAN_COMPILER "Test Fortran compiler complex abs and complex division" OFF) - if( TEST_FORTRAN_COMPILER ) - - add_executable( test_zcomplexabs ${LAPACK_SOURCE_DIR}/INSTALL/test_zcomplexabs.f ) -@@ -209,11 +209,8 @@ - - # -------------------------------------------------- -set(LAPACK_INSTALL_EXPORT_NAME ${LAPACKLIB}-targets) - @@ -173,29 +160,7 @@ 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 -@@ -253,21 +250,6 @@ - include(CheckLAPACKCompilerFlags) - CheckLAPACKCompilerFlags() - --# -------------------------------------------------- --# Check second function -- --include(CheckTimeFunction) --set(TIME_FUNC NONE) --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}") -@@ -292,8 +274,9 @@ +@@ -218,8 +215,9 @@ # -------------------------------------------------- @@ -206,7 +171,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt # Check the usage of the user provided BLAS libraries if(BLAS_LIBRARIES) -@@ -304,133 +287,109 @@ +@@ -230,59 +228,41 @@ if(BLAS_FOUND) message(STATUS "--> BLAS supplied by user is WORKING, will use ${BLAS_LIBRARIES}.") else() @@ -277,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() @@ -307,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(TIME_FUNC NONE) -+ 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 @@ -358,16 +322,17 @@ 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) -+ set(BUILD_LAPACKE ON) - endif() - +-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) @@ -377,20 +342,29 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt - endif() - endif() - add_subdirectory(TESTING/MATGEN) -+if(BUILD_LAPACKE) -+ set(NEED_LAPACK TRUE) ++ set(BUILD_LAPACKE ON) 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) - add_subdirectory(LAPACKE) +-if(LAPACKE) ++if(BUILD_LAPACKE) ++ set(NEED_LAPACK TRUE) + add_subdirectory(LAPACKE) + endif() - #------------------------------------- # BLAS++ / LAPACK++ option(BLAS++ "Build BLAS++" OFF) -@@ -480,111 +439,16 @@ +@@ -446,111 +398,16 @@ ExternalProject_Add_StepDependencies(lapackpp build blaspp ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}) endif() @@ -408,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") @@ -511,16 +485,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt diff --git a/LAPACKE/CMakeLists.txt b/LAPACKE/CMakeLists.txt --- a/LAPACKE/CMakeLists.txt +++ b/LAPACKE/CMakeLists.txt -@@ -14,7 +14,7 @@ - add_subdirectory(include) - - --if(NOT LAPACKE) -+if(NOT BUILD_LAPACKE) - return() - endif() - -@@ -22,8 +22,6 @@ +@@ -1,8 +1,6 @@ message(STATUS "LAPACKE enabled") enable_language(C) @@ -529,15 +494,7 @@ diff --git a/LAPACKE/CMakeLists.txt b/LAPACKE/CMakeLists.txt include_directories(include ${LAPACK_BINARY_DIR}/include) add_subdirectory(src) add_subdirectory(utils) -@@ -54,7 +52,6 @@ - message(STATUS "Build LAPACKE single precision complex: ${LAPACKE_BUILD_COMPLEX}") - message(STATUS "Build LAPACKE double precision complex: ${LAPACKE_BUILD_COMPLEX16}") - --append_subdir_files(LAPACKE_INCLUDE "include") - append_subdir_files(SOURCES "src") - if (LAPACKE_BUILD_SINGLE) - append_subdir_files(SOURCES_SINGLE "src") -@@ -95,14 +92,6 @@ +@@ -74,14 +72,6 @@ VERSION ${LAPACK_VERSION} SOVERSION ${LAPACK_MAJOR_VERSION} ) @@ -552,16 +509,7 @@ diff --git a/LAPACKE/CMakeLists.txt b/LAPACKE/CMakeLists.txt if(LAPACKE_WITH_TMG) target_link_libraries(${LAPACKELIB} PRIVATE ${TMGLIB}) -@@ -111,7 +100,7 @@ - - lapack_install_library(${LAPACKELIB}) - install( -- FILES ${LAPACKE_INCLUDE} ${LAPACK_BINARY_DIR}/include/lapacke_mangling.h -+ FILES ${LAPACK_BINARY_DIR}/include/lapacke_mangling.h - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - COMPONENT Development - ) -@@ -127,22 +116,3 @@ +@@ -106,22 +96,3 @@ DESTINATION ${PKG_CONFIG_DIR} COMPONENT Development ) @@ -610,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/@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. @@ -630,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 @@ -653,22 +597,17 @@ deleted file mode 100644 diff --git a/LAPACKE/include/CMakeLists.txt b/LAPACKE/include/CMakeLists.txt --- a/LAPACKE/include/CMakeLists.txt +++ b/LAPACKE/include/CMakeLists.txt -@@ -1,7 +1,13 @@ --set(LAPACKE_INCLUDE lapack.h) -- +@@ -1,5 +1,5 @@ + set(LAPACKE_INCLUDE lapack.h) -IF(LAPACKE) -- list(APPEND LAPACKE_INCLUDE lapacke.h lapacke_config.h lapacke_utils.h) -+set(LAPACKE_INCLUDE) -+if(BUILD_LAPACK) -+ list(APPEND LAPACKE_INCLUDE lapack.h) -+endif() -+if(BUILD_LAPACKE) -+ list(APPEND LAPACKE_INCLUDE lapacke.h lapacke_config.h lapacke_utils.h) ++IF(BUILD_LAPACKE) + list(APPEND LAPACKE_INCLUDE lapacke.h lapacke_config.h lapacke_utils.h) endif() --file(COPY ${LAPACKE_INCLUDE} DESTINATION ${LAPACK_BINARY_DIR}/include) -+install( -+ FILES ${LAPACKE_INCLUDE} -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} -+ COMPONENT Development -+ ) +@@ -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() |