pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
lapack, cblas, lapacke: also install static libs, fix pkg-config files
Module Name: pkgsrc-wip
Committed By: Dr. Thomas Orgis <thomas.orgis%uni-hamburg.de@localhost>
Pushed By: thor
Date: Wed Mar 27 15:49:07 2019 +0100
Changeset: 1528ca8f05df088e5b74b959a3e1b9755a01f722
Modified Files:
cblas/PLIST
lapack/Makefile.common
lapack/PLIST
lapack/distinfo
lapacke/PLIST
Added Files:
lapack/patches/patch-BLAS_SRC_CMakeLists.txt
lapack/patches/patch-CBLAS_cblas.pc.in
lapack/patches/patch-CBLAS_src_CMakeLists.txt
lapack/patches/patch-LAPACKE_CMakeLists.txt
lapack/patches/patch-LAPACKE_lapacke.pc.in
lapack/patches/patch-SRC_CMakeLists.txt
lapack/patches/patch-TESTING_MATGEN_CMakeLists.txt
Log Message:
lapack, cblas, lapacke: also install static libs, fix pkg-config files
We patch the build system to also install the static libraries when both
-DBUILD_SHARED_LIBS and -DBUILD_STATIC_LIBS are given. The pkg-config
files of cblas and lapacke are adapted to also accomodate static linking
to our configured BLAS_LIBS and LAPACK_LIBS.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=1528ca8f05df088e5b74b959a3e1b9755a01f722
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
cblas/PLIST | 1 +
lapack/Makefile.common | 5 +++-
lapack/PLIST | 2 ++
lapack/distinfo | 7 +++++
lapack/patches/patch-BLAS_SRC_CMakeLists.txt | 18 ++++++++++++
lapack/patches/patch-CBLAS_cblas.pc.in | 11 ++++++++
lapack/patches/patch-CBLAS_src_CMakeLists.txt | 25 ++++++++++++++++
lapack/patches/patch-LAPACKE_CMakeLists.txt | 33 ++++++++++++++++++++++
lapack/patches/patch-LAPACKE_lapacke.pc.in | 11 ++++++++
lapack/patches/patch-SRC_CMakeLists.txt | 30 ++++++++++++++++++++
lapack/patches/patch-TESTING_MATGEN_CMakeLists.txt | 19 +++++++++++++
lapacke/PLIST | 1 +
12 files changed, 162 insertions(+), 1 deletion(-)
diffs:
diff --git a/cblas/PLIST b/cblas/PLIST
index f240c8b080..aaf08d72bb 100644
--- a/cblas/PLIST
+++ b/cblas/PLIST
@@ -5,6 +5,7 @@ include/cblas_mangling.h
include/cblas_test.h
lib/cmake/cblas-${PKGVERSION}/cblas-config-version.cmake
lib/cmake/cblas-${PKGVERSION}/cblas-config.cmake
+lib/libcblas.a
lib/libcblas.so
lib/libcblas.so.3
lib/libcblas.so.${PKGVERSION}
diff --git a/lapack/Makefile.common b/lapack/Makefile.common
index 3b8a5d0fdf..c8e55d339d 100644
--- a/lapack/Makefile.common
+++ b/lapack/Makefile.common
@@ -27,8 +27,11 @@ WRKSRC= ${WRKDIR}/${DISTNAME}
CONFIGURE_DIRS= ${WRKDIR}/build
CMAKE_ARG_PATH= ${WRKSRC}
-CMAKE_ARGS= -DBUILD_DEPRECATED=yes \
+# Note: We patch the build to install both static and
+# shared libraries.
+CMAKE_ARGS= -DBUILD_DEPRECATED=ON \
-DBUILD_SHARED_LIBS=ON \
+ -DBUILD_STATIC_LIBS=ON \
${LAPACK_PART_CMAKE_ARGS}
post-extract:
diff --git a/lapack/PLIST b/lapack/PLIST
index afd1efed2f..5737d40638 100644
--- a/lapack/PLIST
+++ b/lapack/PLIST
@@ -3,9 +3,11 @@ lib/cmake/lapack-${PKGVERSION}/lapack-config-version.cmake
lib/cmake/lapack-${PKGVERSION}/lapack-config.cmake
lib/cmake/lapack-${PKGVERSION}/lapack-targets-release.cmake
lib/cmake/lapack-${PKGVERSION}/lapack-targets.cmake
+lib/libblas.a
lib/libblas.so
lib/libblas.so.3
lib/libblas.so.${PKGVERSION}
+lib/liblapack.a
lib/liblapack.so
lib/liblapack.so.3
lib/liblapack.so.${PKGVERSION}
diff --git a/lapack/distinfo b/lapack/distinfo
index 8c347f81ba..f906c0e369 100644
--- a/lapack/distinfo
+++ b/lapack/distinfo
@@ -4,4 +4,11 @@ SHA1 (lapack-3.8.0.tar.gz) = 55ac9d6be510883c5442c8aca967722cdf58fb29
RMD160 (lapack-3.8.0.tar.gz) = ff306181c4c125e7594c57c1eeece8b0aa8f8523
SHA512 (lapack-3.8.0.tar.gz) = 17786cb7306fccdc9b4a242de7f64fc261ebe6a10b6ec55f519deb4cb673cb137e8742aa5698fd2dc52f1cd56d3bd116af3f593a01dcf6770c4dcc86c50b2a7f
Size (lapack-3.8.0.tar.gz) = 7426094 bytes
+SHA1 (patch-BLAS_SRC_CMakeLists.txt) = c8c69e6e0c67337af999863c4f5c64618d1374d7
+SHA1 (patch-CBLAS_cblas.pc.in) = 8291c46327766fea702c3cb533555311c6a5e97e
+SHA1 (patch-CBLAS_src_CMakeLists.txt) = faa1ad6c322830cb62e0f5bdab33732c0372cce3
SHA1 (patch-CMakeLists.txt) = 3f93b4745b1e64fb248249b845c0a44761c382d6
+SHA1 (patch-LAPACKE_CMakeLists.txt) = 1d26a94cbbd92a29b4e750a079add13de1d94d1e
+SHA1 (patch-LAPACKE_lapacke.pc.in) = c8d48afdd9da3f6a8bc05d83a43626e01322cf91
+SHA1 (patch-SRC_CMakeLists.txt) = a667a733298c25ed63e653e44390b4600725609e
+SHA1 (patch-TESTING_MATGEN_CMakeLists.txt) = 84d4cde8fef49c6efc9f50a3219b0299375934d5
diff --git a/lapack/patches/patch-BLAS_SRC_CMakeLists.txt b/lapack/patches/patch-BLAS_SRC_CMakeLists.txt
new file mode 100644
index 0000000000..1f5862aef9
--- /dev/null
+++ b/lapack/patches/patch-BLAS_SRC_CMakeLists.txt
@@ -0,0 +1,18 @@
+$NetBSD$
+
+Support combined build of shared and static libraries.
+
+--- BLAS/SRC/CMakeLists.txt.orig 2017-11-13 04:15:54.000000000 +0000
++++ BLAS/SRC/CMakeLists.txt
+@@ -104,3 +104,11 @@ set_target_properties(
+ SOVERSION ${LAPACK_MAJOR_VERSION}
+ )
+ lapack_install_library(blas)
++if(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
++ add_library(blas_static STATIC ${SOURCES})
++ set_target_properties(
++ blas_static PROPERTIES
++ OUTPUT_NAME blas
++ )
++ lapack_install_library(blas_static)
++endif()
diff --git a/lapack/patches/patch-CBLAS_cblas.pc.in b/lapack/patches/patch-CBLAS_cblas.pc.in
new file mode 100644
index 0000000000..a44182e4eb
--- /dev/null
+++ b/lapack/patches/patch-CBLAS_cblas.pc.in
@@ -0,0 +1,11 @@
+$NetBSD$
+
+--- CBLAS/cblas.pc.in.orig 2019-03-27 14:34:40.823289167 +0000
++++ CBLAS/cblas.pc.in
+@@ -6,5 +6,5 @@ Description: C Standard Interface to BLA
+ Version: @LAPACK_VERSION@
+ URL: http://www.netlib.org/blas/#_cblas
+ Libs: -L${libdir} -lcblas
++Libs.private: @BLAS_LIBRARIES@
+ Cflags: -I${includedir}
+-Requires.private: blas
diff --git a/lapack/patches/patch-CBLAS_src_CMakeLists.txt b/lapack/patches/patch-CBLAS_src_CMakeLists.txt
new file mode 100644
index 0000000000..2e35233e43
--- /dev/null
+++ b/lapack/patches/patch-CBLAS_src_CMakeLists.txt
@@ -0,0 +1,25 @@
+$NetBSD$
+
+Support combined build of shared and static libraries.
+
+--- CBLAS/src/CMakeLists.txt.orig 2017-11-13 04:15:54.000000000 +0000
++++ CBLAS/src/CMakeLists.txt
+@@ -126,3 +126,18 @@ target_include_directories(cblas PUBLIC
+ )
+ target_link_libraries(cblas PRIVATE ${BLAS_LIBRARIES})
+ lapack_install_library(cblas)
++
++if(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
++ add_library(cblas_static STATIC ${SOURCES})
++ set_target_properties(
++ cblas_static PROPERTIES
++ LINKER_LANGUAGE C
++ OUTPUT_NAME cblas
++ )
++ target_include_directories(cblas_static PUBLIC
++ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
++ $<INSTALL_INTERFACE:include>
++ )
++ target_link_libraries(cblas_static PRIVATE ${BLAS_LIBRARIES})
++ lapack_install_library(cblas_static)
++endif()
diff --git a/lapack/patches/patch-LAPACKE_CMakeLists.txt b/lapack/patches/patch-LAPACKE_CMakeLists.txt
new file mode 100644
index 0000000000..1f887a02ec
--- /dev/null
+++ b/lapack/patches/patch-LAPACKE_CMakeLists.txt
@@ -0,0 +1,33 @@
+$NetBSD$
+
+Support combined build of shared and static libraries.
+
+--- LAPACKE/CMakeLists.txt.orig 2017-11-13 04:15:54.000000000 +0000
++++ LAPACKE/CMakeLists.txt
+@@ -71,6 +71,26 @@ endif()
+ 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})
+
+ if(BUILD_TESTING)
diff --git a/lapack/patches/patch-LAPACKE_lapacke.pc.in b/lapack/patches/patch-LAPACKE_lapacke.pc.in
new file mode 100644
index 0000000000..ec0ac57641
--- /dev/null
+++ b/lapack/patches/patch-LAPACKE_lapacke.pc.in
@@ -0,0 +1,11 @@
+$NetBSD$
+
+--- LAPACKE/lapacke.pc.in.orig 2019-03-27 14:35:14.016006535 +0000
++++ LAPACKE/lapacke.pc.in
+@@ -6,5 +6,5 @@ Description: C Standard Interface to LAP
+ Version: @LAPACK_VERSION@
+ URL: http://www.netlib.org/lapack/#_standard_c_language_apis_for_lapack
+ Libs: -L${libdir} -llapacke
++Libs.private: @LAPACK_LIBRARIES@ @BLAS_LIBRARIES@
+ Cflags: -I${includedir}
+-Requires.private: lapack
diff --git a/lapack/patches/patch-SRC_CMakeLists.txt b/lapack/patches/patch-SRC_CMakeLists.txt
new file mode 100644
index 0000000000..afc6531520
--- /dev/null
+++ b/lapack/patches/patch-SRC_CMakeLists.txt
@@ -0,0 +1,30 @@
+$NetBSD$
+
+Support combined build of shared and static libraries.
+
+--- SRC/CMakeLists.txt.orig 2017-11-13 04:15:54.000000000 +0000
++++ SRC/CMakeLists.txt
+@@ -510,3 +510,23 @@ if (${CMAKE_BUILD_TYPE_UPPER} STREQUAL "
+ endif()
+
+ lapack_install_library(lapack)
++
++if(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
++ add_library(lapack_static STATIC ${SOURCES})
++ set_target_properties(
++ lapack_static PROPERTIES
++ OUTPUT_NAME lapack
++ )
++
++ if(USE_XBLAS)
++ target_link_libraries(lapack_static PRIVATE ${XBLAS_LIBRARY})
++ endif()
++ target_link_libraries(lapack_static PRIVATE ${BLAS_LIBRARIES})
++
++ if (${CMAKE_BUILD_TYPE_UPPER} STREQUAL "COVERAGE")
++ target_link_libraries(lapack_static PRIVATE gcov)
++ add_coverage(lapack_static)
++ endif()
++
++ lapack_install_library(lapack_static)
++endif()
diff --git a/lapack/patches/patch-TESTING_MATGEN_CMakeLists.txt b/lapack/patches/patch-TESTING_MATGEN_CMakeLists.txt
new file mode 100644
index 0000000000..14460ef5d4
--- /dev/null
+++ b/lapack/patches/patch-TESTING_MATGEN_CMakeLists.txt
@@ -0,0 +1,19 @@
+$NetBSD$
+
+Support combined build of shared and static libraries.
+
+--- TESTING/MATGEN/CMakeLists.txt.orig 2017-11-13 04:15:54.000000000 +0000
++++ TESTING/MATGEN/CMakeLists.txt
+@@ -50,3 +50,12 @@ list(REMOVE_DUPLICATES SOURCES)
+ add_library(tmglib ${SOURCES})
+ target_link_libraries(tmglib ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
+ lapack_install_library(tmglib)
++if(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
++ add_library(tmglib_static STATIC ${SOURCES})
++ set_target_properties(
++ tmglib_static PROPERTIES
++ OUTPUT_NAME tmglib
++ )
++ target_link_libraries(tmglib_static ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
++ lapack_install_library(tmglib_static)
++endif()
diff --git a/lapacke/PLIST b/lapacke/PLIST
index 5d39ad2ad8..3d494dab41 100644
--- a/lapacke/PLIST
+++ b/lapacke/PLIST
@@ -7,6 +7,7 @@ lib/cmake/lapacke-${PKGVERSION}/lapacke-config-version.cmake
lib/cmake/lapacke-${PKGVERSION}/lapacke-config.cmake
lib/cmake/lapacke-${PKGVERSION}/lapacke-targets-release.cmake
lib/cmake/lapacke-${PKGVERSION}/lapacke-targets.cmake
+lib/liblapacke.a
lib/liblapacke.so
lib/liblapacke.so.3
lib/liblapacke.so.${PKGVERSION}
Home |
Main Index |
Thread Index |
Old Index