File:  [cvs.NetBSD.org] / pkgsrc / math / lapack / patches / Attic / patch-LAPACKE_CMakeLists.txt
Revision 1.1: download - view: text, annotated - select for diffs
Mon Oct 12 21:51:57 2020 UTC (4 years, 6 months ago) by bacon
Branches: MAIN
CVS tags: pkgsrc-2021Q1-base, pkgsrc-2021Q1, pkgsrc-2020Q4-base, pkgsrc-2020Q4, HEAD
math/blas, math/lapack: Install interchangeable BLAS system

Install the new interchangeable BLAS system created by Thomas Orgis,
currently supporting Netlib BLAS/LAPACK, OpenBLAS, cblas, lapacke, and
Apple's Accelerate.framework.  This system allows the user to select any
BLAS implementation without modifying packages or using package options, by
setting PKGSRC_BLAS_TYPES in mk.conf. See mk/blas.buildlink3.mk for details.

This commit should not alter behavior of existing packages as the system
defaults to Netlib BLAS/LAPACK, which until now has been the only supported
implementation.

Details:

Add new mk/blas.buildlink3.mk for inclusion in dependent packages
Install compatible Netlib math/blas and math/lapack packages
Update math/blas and math/lapack MAINTAINER approved by adam@
OpenBLAS, cblas, and lapacke will follow in separate commits
Update direct dependents to use mk/blas.buildlink3.mk
Perform recursive revbump

$NetBSD: patch-LAPACKE_CMakeLists.txt,v 1.1 2020/10/12 21:51:57 bacon Exp $

Support combined build of shared and static libraries.

--- LAPACKE/CMakeLists.txt.orig	2020-01-03 19:33:52.766364829 +0100
+++ LAPACKE/CMakeLists.txt	2020-01-03 19:49:05.115280246 +0100
@@ -94,6 +94,26 @@
 target_link_libraries(lapacke PRIVATE ${LAPACK_LIBRARIES})
 
 lapack_install_library(lapacke)
+
+if(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
+  add_library(lapacke_static STATIC ${SOURCES})
+  set_target_properties(
+    lapacke_static PROPERTIES
+    OUTPUT_NAME lapacke
+    )
+   target_include_directories(lapacke_static PUBLIC
+    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
+    $<INSTALL_INTERFACE:include>
+  )
+
+  if(LAPACKE_WITH_TMG)
+    target_link_libraries(lapacke_static PRIVATE tmglib)
+  endif()
+  target_link_libraries(lapacke_static PRIVATE ${LAPACK_LIBRARIES})
+
+  lapack_install_library(lapacke_static)
+endif()
+
 install(
   FILES ${LAPACKE_INCLUDE} ${LAPACK_BINARY_DIR}/include/lapacke_mangling.h
   DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
@@ -126,7 +146,8 @@
   COMPONENT Development
   )
 
-install(EXPORT lapacke-targets
-  DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lapacke-${LAPACK_VERSION}
-  COMPONENT Development
-  )
+#install(EXPORT lapacke-targets
+#  DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lapacke-${LAPACK_VERSION}
+#  COMPONENT Development
+#  )
+

CVSweb <webmaster@jp.NetBSD.org>