cmake-piecewise.diff 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. diff --git a/CBLAS/CMakeLists.txt b/CBLAS/CMakeLists.txt
  2. --- a/CBLAS/CMakeLists.txt
  3. +++ b/CBLAS/CMakeLists.txt
  4. @@ -1,8 +1,6 @@
  5. message(STATUS "CBLAS enable")
  6. enable_language(C)
  7. -set(LAPACK_INSTALL_EXPORT_NAME ${CBLASLIB}-targets)
  8. -
  9. # Create a header file cblas.h for the routines called in my C programs
  10. include(FortranCInterface)
  11. ## Ensure that the fortran compiler and c compiler specified are compatible
  12. @@ -51,22 +49,3 @@
  13. DESTINATION ${PKG_CONFIG_DIR}
  14. COMPONENT Development
  15. )
  16. -
  17. -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-version.cmake.in
  18. - ${LAPACK_BINARY_DIR}/${CBLASLIB}-config-version.cmake @ONLY)
  19. -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-build.cmake.in
  20. - ${LAPACK_BINARY_DIR}/${CBLASLIB}-config.cmake @ONLY)
  21. -
  22. -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-install.cmake.in
  23. - ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${CBLASLIB}-config.cmake @ONLY)
  24. -install(FILES
  25. - ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${CBLASLIB}-config.cmake
  26. - ${LAPACK_BINARY_DIR}/${CBLASLIB}-config-version.cmake
  27. - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CBLASLIB}-${LAPACK_VERSION}
  28. - COMPONENT Development
  29. - )
  30. -
  31. -install(EXPORT ${CBLASLIB}-targets
  32. - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CBLASLIB}-${LAPACK_VERSION}
  33. - COMPONENT Development
  34. - )
  35. diff --git a/CBLAS/cmake/cblas-config-build.cmake.in b/CBLAS/cmake/cblas-config-build.cmake.in
  36. deleted file mode 100644
  37. --- a/CBLAS/cmake/cblas-config-build.cmake.in
  38. +++ /dev/null
  39. @@ -1,14 +0,0 @@
  40. -# Load the LAPACK package with which we were built.
  41. -set(LAPACK_DIR "@LAPACK_BINARY_DIR@")
  42. -find_package(LAPACK NO_MODULE)
  43. -
  44. -# Load lapack targets from the build tree, including lapacke targets.
  45. -if(NOT TARGET lapacke)
  46. - include("@LAPACK_BINARY_DIR@/@LAPACKLIB@-targets.cmake")
  47. -endif()
  48. -
  49. -# Report cblas header search locations from build tree.
  50. -set(CBLAS_INCLUDE_DIRS "@LAPACK_BINARY_DIR@/include")
  51. -
  52. -# Report cblas libraries.
  53. -set(CBLAS_LIBRARIES @CBLASLIB@)
  54. diff --git a/CBLAS/cmake/cblas-config-install.cmake.in b/CBLAS/cmake/cblas-config-install.cmake.in
  55. deleted file mode 100644
  56. --- a/CBLAS/cmake/cblas-config-install.cmake.in
  57. +++ /dev/null
  58. @@ -1,23 +0,0 @@
  59. -# Compute locations from <prefix>/@{LIBRARY_DIR@/cmake/lapacke-<v>/<self>.cmake
  60. -get_filename_component(_CBLAS_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
  61. -get_filename_component(_CBLAS_PREFIX "${_CBLAS_SELF_DIR}" PATH)
  62. -get_filename_component(_CBLAS_PREFIX "${_CBLAS_PREFIX}" PATH)
  63. -get_filename_component(_CBLAS_PREFIX "${_CBLAS_PREFIX}" PATH)
  64. -
  65. -# Load the LAPACK package with which we were built.
  66. -set(LAPACK_DIR "${_CBLAS_PREFIX}/@CMAKE_INSTALL_LIBDIR@/cmake/@LAPACKLIB@-@LAPACK_VERSION@")
  67. -find_package(LAPACK NO_MODULE)
  68. -
  69. -# Load lapacke targets from the install tree.
  70. -if(NOT TARGET @CBLASLIB@)
  71. - include(${_CBLAS_SELF_DIR}/@CBLASLIB@-targets.cmake)
  72. -endif()
  73. -
  74. -# Report lapacke header search locations.
  75. -set(CBLAS_INCLUDE_DIRS ${_CBLAS_PREFIX}/include)
  76. -
  77. -# Report lapacke libraries.
  78. -set(CBLAS_LIBRARIES @CBLASLIB@)
  79. -
  80. -unset(_CBLAS_PREFIX)
  81. -unset(_CBLAS_SELF_DIR)
  82. diff --git a/CBLAS/cmake/cblas-config-version.cmake.in b/CBLAS/cmake/cblas-config-version.cmake.in
  83. deleted file mode 100644
  84. --- a/CBLAS/cmake/cblas-config-version.cmake.in
  85. +++ /dev/null
  86. @@ -1,8 +0,0 @@
  87. -set(PACKAGE_VERSION "@LAPACK_VERSION@")
  88. -if(NOT ${PACKAGE_FIND_VERSION} VERSION_GREATER ${PACKAGE_VERSION})
  89. - set(PACKAGE_VERSION_COMPATIBLE 1)
  90. - if(${PACKAGE_FIND_VERSION} VERSION_EQUAL ${PACKAGE_VERSION})
  91. - set(PACKAGE_VERSION_EXACT 1)
  92. - endif()
  93. -endif()
  94. -
  95. diff --git a/CBLAS/src/CMakeLists.txt b/CBLAS/src/CMakeLists.txt
  96. --- a/CBLAS/src/CMakeLists.txt
  97. +++ b/CBLAS/src/CMakeLists.txt
  98. @@ -123,9 +123,5 @@
  99. if(HAS_ATTRIBUTE_WEAK_SUPPORT)
  100. target_compile_definitions(${CBLASLIB} PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT)
  101. endif()
  102. -target_include_directories(${CBLASLIB} PUBLIC
  103. - $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
  104. - $<INSTALL_INTERFACE:include>
  105. -)
  106. target_link_libraries(${CBLASLIB} PRIVATE ${BLAS_LIBRARIES})
  107. lapack_install_library(${CBLASLIB})
  108. diff --git a/CMAKE/lapack-config-build.cmake.in b/CMAKE/lapack-config-build.cmake.in
  109. deleted file mode 100644
  110. --- a/CMAKE/lapack-config-build.cmake.in
  111. +++ /dev/null
  112. @@ -1,14 +0,0 @@
  113. -# Load lapack targets from the build tree if necessary.
  114. -set(_LAPACK_TARGET "@_lapack_config_build_guard_target@")
  115. -if(_LAPACK_TARGET AND NOT TARGET "${_LAPACK_TARGET}")
  116. - include("@LAPACK_BINARY_DIR@/@LAPACKLIB@-targets.cmake")
  117. -endif()
  118. -unset(_LAPACK_TARGET)
  119. -
  120. -# Hint for project building against lapack
  121. -set(LAPACK_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@")
  122. -
  123. -# Report the blas and lapack raw or imported libraries.
  124. -set(LAPACK_blas_LIBRARIES "@BLAS_LIBRARIES@")
  125. -set(LAPACK_lapack_LIBRARIES "@LAPACK_LIBRARIES@")
  126. -set(LAPACK_LIBRARIES ${LAPACK_blas_LIBRARIES} ${LAPACK_lapack_LIBRARIES})
  127. diff --git a/CMAKE/lapack-config-install.cmake.in b/CMAKE/lapack-config-install.cmake.in
  128. deleted file mode 100644
  129. --- a/CMAKE/lapack-config-install.cmake.in
  130. +++ /dev/null
  131. @@ -1,19 +0,0 @@
  132. -# Compute locations from <prefix>/lib/cmake/lapack-<v>/<self>.cmake
  133. -get_filename_component(_LAPACK_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
  134. -
  135. -# Load lapack targets from the install tree if necessary.
  136. -set(_LAPACK_TARGET "@_lapack_config_install_guard_target@")
  137. -if(_LAPACK_TARGET AND NOT TARGET "${_LAPACK_TARGET}")
  138. - include("${_LAPACK_SELF_DIR}/@LAPACKLIB@-targets.cmake")
  139. -endif()
  140. -unset(_LAPACK_TARGET)
  141. -
  142. -# Hint for project building against lapack
  143. -set(LAPACK_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@")
  144. -
  145. -# Report the blas and lapack raw or imported libraries.
  146. -set(LAPACK_blas_LIBRARIES "@BLAS_LIBRARIES@")
  147. -set(LAPACK_lapack_LIBRARIES "@LAPACK_LIBRARIES@")
  148. -set(LAPACK_LIBRARIES ${LAPACK_blas_LIBRARIES} ${LAPACK_lapack_LIBRARIES})
  149. -
  150. -unset(_LAPACK_SELF_DIR)
  151. diff --git a/CMakeLists.txt b/CMakeLists.txt
  152. --- a/CMakeLists.txt
  153. +++ b/CMakeLists.txt
  154. @@ -157,11 +157,8 @@
  155. # --------------------------------------------------
  156. -set(LAPACK_INSTALL_EXPORT_NAME ${LAPACKLIB}-targets)
  157. -
  158. macro(lapack_install_library lib)
  159. install(TARGETS ${lib}
  160. - EXPORT ${LAPACK_INSTALL_EXPORT_NAME}
  161. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
  162. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries
  163. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT RuntimeLibraries
  164. @@ -201,21 +198,6 @@
  165. include(CheckLAPACKCompilerFlags)
  166. CheckLAPACKCompilerFlags()
  167. -# --------------------------------------------------
  168. -# Check second function
  169. -
  170. -include(CheckTimeFunction)
  171. -set(NONE ${TIME_FUNC})
  172. -CHECK_TIME_FUNCTION(NONE TIME_FUNC)
  173. -CHECK_TIME_FUNCTION(INT_CPU_TIME TIME_FUNC)
  174. -CHECK_TIME_FUNCTION(EXT_ETIME TIME_FUNC)
  175. -CHECK_TIME_FUNCTION(EXT_ETIME_ TIME_FUNC)
  176. -CHECK_TIME_FUNCTION(INT_ETIME TIME_FUNC)
  177. -message(STATUS "--> Will use second_${TIME_FUNC}.f and dsecnd_${TIME_FUNC}.f as timing function.")
  178. -
  179. -set(SECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/second_${TIME_FUNC}.f)
  180. -set(DSECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/dsecnd_${TIME_FUNC}.f)
  181. -
  182. # deprecated LAPACK and LAPACKE routines
  183. option(BUILD_DEPRECATED "Build deprecated routines" OFF)
  184. message(STATUS "Build deprecated routines: ${BUILD_DEPRECATED}")
  185. @@ -239,8 +221,9 @@
  186. endif()
  187. # --------------------------------------------------
  188. -# Subdirectories that need to be processed
  189. +# BLAS
  190. option(USE_OPTIMIZED_BLAS "Whether or not to use an optimized BLAS library instead of included netlib BLAS" OFF)
  191. +option(BUILD_BLAS "Build BLAS" OFF)
  192. # Check the usage of the user provided BLAS libraries
  193. if(BLAS_LIBRARIES)
  194. @@ -251,131 +234,105 @@
  195. if(BLAS_FOUND)
  196. message(STATUS "--> BLAS supplied by user is WORKING, will use ${BLAS_LIBRARIES}.")
  197. else()
  198. - message(ERROR "--> BLAS supplied by user is not WORKING, CANNOT USE ${BLAS_LIBRARIES}.")
  199. - message(ERROR "--> Will use REFERENCE BLAS (by default)")
  200. - message(ERROR "--> Or Correct your BLAS_LIBRARIES entry ")
  201. - message(ERROR "--> Or Consider checking USE_OPTIMIZED_BLAS")
  202. + message(SEND_ERROR "--> BLAS supplied by user is NOT WORKING, cannot use ${BLAS_LIBRARIES}.")
  203. endif()
  204. # User did not provide a BLAS Library but specified to search for one
  205. elseif(USE_OPTIMIZED_BLAS)
  206. find_package(BLAS)
  207. -endif()
  208. -# Neither user specified or optimized BLAS libraries can be used
  209. -if(NOT BLAS_FOUND)
  210. - message(STATUS "Using supplied NETLIB BLAS implementation")
  211. - add_subdirectory(BLAS)
  212. +elseif(BUILD_BLAS)
  213. set(BLAS_LIBRARIES ${BLASLIB})
  214. -else()
  215. - set(CMAKE_EXE_LINKER_FLAGS
  216. - "${CMAKE_EXE_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
  217. - CACHE STRING "Linker flags for executables" FORCE)
  218. - set(CMAKE_MODULE_LINKER_FLAGS
  219. - "${CMAKE_MODULE_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
  220. - CACHE STRING "Linker flags for modules" FORCE)
  221. - set(CMAKE_SHARED_LINKER_FLAGS
  222. - "${CMAKE_SHARED_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
  223. - CACHE STRING "Linker flags for shared libs" FORCE)
  224. -endif()
  225. + set(BLAS_FOUND TRUE)
  226. + add_subdirectory(BLAS)
  227. +endif()
  228. # --------------------------------------------------
  229. # CBLAS
  230. -option(CBLAS "Build CBLAS" OFF)
  231. +option(BUILD_CBLAS "Build CBLAS" OFF)
  232. -if(CBLAS)
  233. +if(BUILD_CBLAS)
  234. + set(NEED_BLAS TRUE)
  235. add_subdirectory(CBLAS)
  236. endif()
  237. # --------------------------------------------------
  238. # XBLAS
  239. -
  240. option(USE_XBLAS "Build extended precision (needs XBLAS)" OFF)
  241. +
  242. if(USE_XBLAS)
  243. find_library(XBLAS_LIBRARY NAMES xblas)
  244. endif()
  245. -option(USE_OPTIMIZED_LAPACK "Whether or not to use an optimized LAPACK library instead of included netlib LAPACK" OFF)
  246. -
  247. # --------------------------------------------------
  248. # LAPACK
  249. -# User did not provide a LAPACK Library but specified to search for one
  250. -if(USE_OPTIMIZED_LAPACK)
  251. - find_package(LAPACK)
  252. -endif()
  253. +option(USE_OPTIMIZED_LAPACK "Whether or not to use an optimized LAPACK library instead of included netlib LAPACK" OFF)
  254. +option(BUILD_LAPACK "Build LAPACK" OFF)
  255. # Check the usage of the user provided or automatically found LAPACK libraries
  256. if(LAPACK_LIBRARIES)
  257. include(CheckFortranFunctionExists)
  258. set(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
  259. # Check if new routine of 3.4.0 is in LAPACK_LIBRARIES
  260. - CHECK_FORTRAN_FUNCTION_EXISTS("dgeqrt" LATESTLAPACK_FOUND)
  261. + CHECK_FORTRAN_FUNCTION_EXISTS("dgeqrt" LAPACK_FOUND)
  262. unset(CMAKE_REQUIRED_LIBRARIES)
  263. - if(LATESTLAPACK_FOUND)
  264. + if(LAPACK_FOUND)
  265. message(STATUS "--> LAPACK supplied by user is WORKING, will use ${LAPACK_LIBRARIES}.")
  266. else()
  267. - message(ERROR "--> LAPACK supplied by user is not WORKING or is older than LAPACK 3.4.0, CANNOT USE ${LAPACK_LIBRARIES}.")
  268. - message(ERROR "--> Will use REFERENCE LAPACK (by default)")
  269. - message(ERROR "--> Or Correct your LAPACK_LIBRARIES entry ")
  270. - message(ERROR "--> Or Consider checking USE_OPTIMIZED_LAPACK")
  271. + message(SEND_ERROR "--> LAPACK supplied by user is NOT WORKING or is older than LAPACK 3.4.0, cannot use ${LAPACK_LIBRARIES}.")
  272. endif()
  273. -endif()
  274. -# Neither user specified or optimized LAPACK libraries can be used
  275. -if(NOT LATESTLAPACK_FOUND)
  276. - message(STATUS "Using supplied NETLIB LAPACK implementation")
  277. +# User did not provide a LAPACK Library but specified to search for one
  278. +elseif(USE_OPTIMIZED_LAPACK)
  279. + find_package(LAPACK)
  280. +
  281. +elseif(BUILD_LAPACK)
  282. set(LAPACK_LIBRARIES ${LAPACKLIB})
  283. + set(LAPACK_FOUND TRUE)
  284. +
  285. + set(NEED_BLAS TRUE)
  286. +
  287. + # Check second function
  288. + include(CheckTimeFunction)
  289. + set(NONE ${TIME_FUNC})
  290. + CHECK_TIME_FUNCTION(NONE TIME_FUNC)
  291. + CHECK_TIME_FUNCTION(INT_CPU_TIME TIME_FUNC)
  292. + CHECK_TIME_FUNCTION(EXT_ETIME TIME_FUNC)
  293. + CHECK_TIME_FUNCTION(EXT_ETIME_ TIME_FUNC)
  294. + CHECK_TIME_FUNCTION(INT_ETIME TIME_FUNC)
  295. + message(STATUS "--> Will use second_${TIME_FUNC}.f and dsecnd_${TIME_FUNC}.f as timing function.")
  296. +
  297. + set(SECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/second_${TIME_FUNC}.f)
  298. + set(DSECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/dsecnd_${TIME_FUNC}.f)
  299. +
  300. add_subdirectory(SRC)
  301. -else()
  302. - set(CMAKE_EXE_LINKER_FLAGS
  303. - "${CMAKE_EXE_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}"
  304. - CACHE STRING "Linker flags for executables" FORCE)
  305. - set(CMAKE_MODULE_LINKER_FLAGS
  306. - "${CMAKE_MODULE_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}"
  307. - CACHE STRING "Linker flags for modules" FORCE)
  308. - set(CMAKE_SHARED_LINKER_FLAGS
  309. - "${CMAKE_SHARED_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}"
  310. - CACHE STRING "Linker flags for shared libs" FORCE)
  311. -endif()
  312. -if(BUILD_TESTING)
  313. - add_subdirectory(TESTING)
  314. + if(BUILD_TESTING)
  315. + add_subdirectory(TESTING)
  316. + endif()
  317. +
  318. + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lapack.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${LAPACKLIB}.pc @ONLY)
  319. + install(FILES
  320. + ${CMAKE_CURRENT_BINARY_DIR}/${LAPACKLIB}.pc
  321. + DESTINATION ${PKG_CONFIG_DIR}
  322. + COMPONENT Development
  323. + )
  324. endif()
  325. # --------------------------------------------------
  326. # LAPACKE
  327. -option(LAPACKE "Build LAPACKE" OFF)
  328. +option(BUILD_LAPACKE "Build LAPACKE" OFF)
  329. # LAPACKE has also the interface to some routines from tmglib,
  330. # if LAPACKE_WITH_TMG is selected, we need to add those routines to LAPACKE
  331. option(LAPACKE_WITH_TMG "Build LAPACKE with tmglib routines" OFF)
  332. if(LAPACKE_WITH_TMG)
  333. - set(LAPACKE ON)
  334. + set(BUILD_LAPACKE ON)
  335. endif()
  336. -# TMGLIB
  337. -# Cache export target
  338. -set(LAPACK_INSTALL_EXPORT_NAME_CACHE ${LAPACK_INSTALL_EXPORT_NAME})
  339. -if(BUILD_TESTING OR LAPACKE_WITH_TMG)
  340. - if(LATESTLAPACK_FOUND AND LAPACKE_WITH_TMG)
  341. - set(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
  342. - # Check if dlatms (part of tmg) is found
  343. - CHECK_FORTRAN_FUNCTION_EXISTS("dlatms" LAPACK_WITH_TMGLIB_FOUND)
  344. - unset(CMAKE_REQUIRED_LIBRARIES)
  345. - if(NOT LAPACK_WITH_TMGLIB_FOUND)
  346. - # Build and install TMG as part of LAPACKE targets (as opposed to LAPACK
  347. - # targets)
  348. - set(LAPACK_INSTALL_EXPORT_NAME ${LAPACKELIB}-targets)
  349. - endif()
  350. - endif()
  351. - add_subdirectory(TESTING/MATGEN)
  352. -endif()
  353. -# Reset export target
  354. -set(LAPACK_INSTALL_EXPORT_NAME ${LAPACK_INSTALL_EXPORT_NAME_CACHE})
  355. -unset(LAPACK_INSTALL_EXPORT_NAME_CACHE)
  356. -
  357. -if(LAPACKE)
  358. +if(BUILD_LAPACKE)
  359. + set(NEED_LAPACK TRUE)
  360. add_subdirectory(LAPACKE)
  361. endif()
  362. @@ -428,111 +385,16 @@
  363. ExternalProject_Add_StepDependencies(lapackpp build blaspp ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
  364. endif()
  365. -# --------------------------------------------------
  366. -# CPACK Packaging
  367. -
  368. -set(CPACK_PACKAGE_NAME "LAPACK")
  369. -set(CPACK_PACKAGE_VENDOR "University of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd")
  370. -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LAPACK- Linear Algebra Package")
  371. -set(CPACK_PACKAGE_VERSION_MAJOR ${LAPACK_MAJOR_VERSION})
  372. -set(CPACK_PACKAGE_VERSION_MINOR ${LAPACK_MINOR_VERSION})
  373. -set(CPACK_PACKAGE_VERSION_PATCH ${LAPACK_PATCH_VERSION})
  374. -set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
  375. -set(CPACK_MONOLITHIC_INSTALL ON)
  376. -set(CPACK_PACKAGE_INSTALL_DIRECTORY "LAPACK")
  377. -if(WIN32 AND NOT UNIX)
  378. - # There is a bug in NSI that does not handle full unix paths properly. Make
  379. - # sure there is at least one set of four (4) backlasshes.
  380. - set(CPACK_NSIS_HELP_LINK "http:\\\\\\\\http://icl.cs.utk.edu/lapack-forum")
  381. - set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.netlib.org/lapack")
  382. - set(CPACK_NSIS_CONTACT "lapack@eecs.utk.edu")
  383. - set(CPACK_NSIS_MODIFY_PATH ON)
  384. - set(CPACK_NSIS_DISPLAY_NAME "LAPACK-${LAPACK_VERSION}")
  385. - set(CPACK_PACKAGE_RELOCATABLE "true")
  386. -else()
  387. - set(CPACK_GENERATOR "TGZ")
  388. - set(CPACK_SOURCE_GENERATOR TGZ)
  389. - set(CPACK_SOURCE_PACKAGE_FILE_NAME "lapack-${LAPACK_VERSION}")
  390. - set(CPACK_SOURCE_IGNORE_FILES ~$ .svn ${CPACK_SOURCE_IGNORE_FILES})
  391. -endif()
  392. -include(CPack)
  393. -
  394. -
  395. -# --------------------------------------------------
  396. -
  397. -if(NOT BLAS_FOUND)
  398. - set(ALL_TARGETS ${ALL_TARGETS} ${BLASLIB})
  399. -endif()
  400. -
  401. -if(NOT LATESTLAPACK_FOUND)
  402. - set(ALL_TARGETS ${ALL_TARGETS} ${LAPACKLIB})
  403. -endif()
  404. -
  405. -# Export lapack targets, not including lapacke, from the
  406. -# install tree, if any.
  407. -set(_lapack_config_install_guard_target "")
  408. -if(ALL_TARGETS)
  409. - install(EXPORT ${LAPACKLIB}-targets
  410. - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LAPACKLIB}-${LAPACK_VERSION}
  411. - COMPONENT Development
  412. - )
  413. -
  414. - # Choose one of the lapack targets to use as a guard for
  415. - # lapack-config.cmake to load targets from the install tree.
  416. - list(GET ALL_TARGETS 0 _lapack_config_install_guard_target)
  417. -endif()
  418. -
  419. -# Include cblas in targets exported from the build tree.
  420. -if(CBLAS)
  421. - set(ALL_TARGETS ${ALL_TARGETS} ${CBLASLIB})
  422. -endif()
  423. -
  424. -# Include lapacke in targets exported from the build tree.
  425. -if(LAPACKE)
  426. - set(ALL_TARGETS ${ALL_TARGETS} ${LAPACKELIB})
  427. -endif()
  428. -
  429. -if(NOT LAPACK_WITH_TMGLIB_FOUND AND LAPACKE_WITH_TMG)
  430. - set(ALL_TARGETS ${ALL_TARGETS} ${TMGLIB})
  431. +# Neither user specified or optimized BLAS libraries can be used
  432. +if(NEED_BLAS AND NOT BLAS_FOUND)
  433. + message(FATAL_ERROR "--> No BLAS library found. Specify BLAS_LIBRARIES or enable USE_OPTIMIZED_BLAS or BUILD_BLAS.")
  434. endif()
  435. -# Export lapack and lapacke targets from the build tree, if any.
  436. -set(_lapack_config_build_guard_target "")
  437. -if(ALL_TARGETS)
  438. - export(TARGETS ${ALL_TARGETS} FILE ${LAPACKLIB}-targets.cmake)
  439. -
  440. - # Choose one of the lapack or lapacke targets to use as a guard
  441. - # for lapack-config.cmake to load targets from the build tree.
  442. - list(GET ALL_TARGETS 0 _lapack_config_build_guard_target)
  443. +# Neither user specified or optimized LAPACK libraries can be used
  444. +if(NEED_LAPACK AND NOT LAPACK_FOUND)
  445. + message(FATAL_ERROR "--> No LAPACK library found. Specify LAPACK_LIBRARIES or enable USE_OPTIMIZED_LAPACK or BUILD_LAPACK.")
  446. endif()
  447. -configure_file(${LAPACK_SOURCE_DIR}/CMAKE/lapack-config-build.cmake.in
  448. - ${LAPACK_BINARY_DIR}/${LAPACKLIB}-config.cmake @ONLY)
  449. -
  450. -
  451. -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lapack.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${LAPACKLIB}.pc @ONLY)
  452. - install(FILES
  453. - ${CMAKE_CURRENT_BINARY_DIR}/${LAPACKLIB}.pc
  454. - DESTINATION ${PKG_CONFIG_DIR}
  455. - COMPONENT Development
  456. - )
  457. -
  458. -configure_file(${LAPACK_SOURCE_DIR}/CMAKE/lapack-config-install.cmake.in
  459. - ${LAPACK_BINARY_DIR}/CMakeFiles/${LAPACKLIB}-config.cmake @ONLY)
  460. -
  461. -include(CMakePackageConfigHelpers)
  462. -write_basic_package_version_file(
  463. - ${LAPACK_BINARY_DIR}/${LAPACKLIB}-config-version.cmake
  464. - VERSION ${LAPACK_VERSION}
  465. - COMPATIBILITY SameMajorVersion
  466. - )
  467. -
  468. -install(FILES
  469. - ${LAPACK_BINARY_DIR}/CMakeFiles/${LAPACKLIB}-config.cmake
  470. - ${LAPACK_BINARY_DIR}/${LAPACKLIB}-config-version.cmake
  471. - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LAPACKLIB}-${LAPACK_VERSION}
  472. - COMPONENT Development
  473. - )
  474. if (LAPACK++)
  475. install(
  476. DIRECTORY "${LAPACK_BINARY_DIR}/lib/"
  477. diff --git a/LAPACKE/CMakeLists.txt b/LAPACKE/CMakeLists.txt
  478. --- a/LAPACKE/CMakeLists.txt
  479. +++ b/LAPACKE/CMakeLists.txt
  480. @@ -1,8 +1,6 @@
  481. message(STATUS "LAPACKE enable")
  482. enable_language(C)
  483. -set(LAPACK_INSTALL_EXPORT_NAME ${LAPACKELIB}-targets)
  484. -
  485. # Create a header file lapacke_mangling.h for the routines called in my C programs
  486. include(FortranCInterface)
  487. ## Ensure that the fortran compiler and c compiler specified are compatible
  488. @@ -79,14 +77,6 @@
  489. VERSION ${LAPACK_VERSION}
  490. SOVERSION ${LAPACK_MAJOR_VERSION}
  491. )
  492. -target_include_directories(${LAPACKELIB} PUBLIC
  493. - $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  494. - $<INSTALL_INTERFACE:include>
  495. -)
  496. -if(WIN32 AND NOT UNIX)
  497. - target_compile_definitions(${LAPACKELIB} PUBLIC HAVE_LAPACK_CONFIG_H LAPACK_COMPLEX_STRUCTURE)
  498. - message(STATUS "Windows BUILD")
  499. -endif()
  500. if(LAPACKE_WITH_TMG)
  501. target_link_libraries(${LAPACKELIB} PRIVATE ${TMGLIB})
  502. @@ -111,22 +101,3 @@
  503. DESTINATION ${PKG_CONFIG_DIR}
  504. COMPONENT Development
  505. )
  506. -
  507. -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/lapacke-config-version.cmake.in
  508. - ${LAPACK_BINARY_DIR}/${LAPACKELIB}-config-version.cmake @ONLY)
  509. -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/lapacke-config-build.cmake.in
  510. - ${LAPACK_BINARY_DIR}/${LAPACKELIB}-config.cmake @ONLY)
  511. -
  512. -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/lapacke-config-install.cmake.in
  513. - ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${LAPACKELIB}-config.cmake @ONLY)
  514. -install(FILES
  515. - ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${LAPACKELIB}-config.cmake
  516. - ${LAPACK_BINARY_DIR}/${LAPACKELIB}-config-version.cmake
  517. - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LAPACKELIB}-${LAPACK_VERSION}
  518. - COMPONENT Development
  519. - )
  520. -
  521. -install(EXPORT ${LAPACKELIB}-targets
  522. - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LAPACKELIB}-${LAPACK_VERSION}
  523. - COMPONENT Development
  524. - )
  525. diff --git a/LAPACKE/cmake/lapacke-config-build.cmake.in b/LAPACKE/cmake/lapacke-config-build.cmake.in
  526. deleted file mode 100644
  527. --- a/LAPACKE/cmake/lapacke-config-build.cmake.in
  528. +++ /dev/null
  529. @@ -1,17 +0,0 @@
  530. -# Load the LAPACK package with which we were built.
  531. -set(LAPACK_DIR "@LAPACK_BINARY_DIR@")
  532. -find_package(LAPACK NO_MODULE)
  533. -
  534. -# Load lapack targets from the build tree, including lapacke targets.
  535. -if(NOT TARGET @LAPACKELIB@)
  536. - include("@LAPACK_BINARY_DIR@/@LAPACKLIB@-targets.cmake")
  537. -endif()
  538. -
  539. -# Hint for project building against lapack
  540. -set(LAPACKE_Fortran_COMPILER_ID ${LAPACK_Fortran_COMPILER_ID})
  541. -
  542. -# Report lapacke header search locations from build tree.
  543. -set(LAPACKE_INCLUDE_DIRS "@LAPACK_BINARY_DIR@/include")
  544. -
  545. -# Report lapacke libraries.
  546. -set(LAPACKE_LIBRARIES @LAPACKELIB@ ${LAPACK_LIBRARIES})
  547. diff --git a/LAPACKE/cmake/lapacke-config-install.cmake.in b/LAPACKE/cmake/lapacke-config-install.cmake.in
  548. deleted file mode 100644
  549. --- a/LAPACKE/cmake/lapacke-config-install.cmake.in
  550. +++ /dev/null
  551. @@ -1,26 +0,0 @@
  552. -# Compute locations from <prefix>/@{LIBRARY_DIR@/cmake/lapacke-<v>/<self>.cmake
  553. -get_filename_component(_LAPACKE_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
  554. -get_filename_component(_LAPACKE_PREFIX "${_LAPACKE_SELF_DIR}" PATH)
  555. -get_filename_component(_LAPACKE_PREFIX "${_LAPACKE_PREFIX}" PATH)
  556. -get_filename_component(_LAPACKE_PREFIX "${_LAPACKE_PREFIX}" PATH)
  557. -
  558. -# Load the LAPACK package with which we were built.
  559. -set(LAPACK_DIR "${_LAPACKE_PREFIX}/@CMAKE_INSTALL_LIBDIR@/cmake/@LAPACKLIB@-@LAPACK_VERSION@")
  560. -find_package(LAPACK NO_MODULE)
  561. -
  562. -# Load lapacke targets from the install tree.
  563. -if(NOT TARGET @LAPACKELIB@)
  564. - include(${_LAPACKE_SELF_DIR}/@LAPACKELIB@-targets.cmake)
  565. -endif()
  566. -
  567. -# Hint for project building against lapack
  568. -set(LAPACKE_Fortran_COMPILER_ID ${LAPACK_Fortran_COMPILER_ID})
  569. -
  570. -# Report lapacke header search locations.
  571. -set(LAPACKE_INCLUDE_DIRS ${_LAPACKE_PREFIX}/include)
  572. -
  573. -# Report lapacke libraries.
  574. -set(LAPACKE_LIBRARIES @LAPACKELIB@ ${LAPACK_LIBRARIES})
  575. -
  576. -unset(_LAPACKE_PREFIX)
  577. -unset(_LAPACKE_SELF_DIR)
  578. diff --git a/LAPACKE/cmake/lapacke-config-version.cmake.in b/LAPACKE/cmake/lapacke-config-version.cmake.in
  579. deleted file mode 100644
  580. --- a/LAPACKE/cmake/lapacke-config-version.cmake.in
  581. +++ /dev/null
  582. @@ -1,8 +0,0 @@
  583. -set(PACKAGE_VERSION "@LAPACK_VERSION@")
  584. -if(NOT ${PACKAGE_FIND_VERSION} VERSION_GREATER ${PACKAGE_VERSION})
  585. - set(PACKAGE_VERSION_COMPATIBLE 1)
  586. - if(${PACKAGE_FIND_VERSION} VERSION_EQUAL ${PACKAGE_VERSION})
  587. - set(PACKAGE_VERSION_EXACT 1)
  588. - endif()
  589. -endif()
  590. -