blas and lapack: Split the two again to make upgrade easier.
The current math/blas and math/lapack are both real packages that install libraries and the latter depends on the former. Our concept of installing everyting with math/lapack, to mirror the functionality of openblas, makes the upgrade from the old packages difficult. After some CMake hacking (hateithateithateit), wip/blas now installs libblas and wip/lapack installs liblapack. I don't think mk/blas.bl3 needs any change, as it picks up lapack as depencency and thus blas indirectly. TODO: Contact upstream about integrating the cmake switches.
This commit is contained in:
parent
31e61adbd0
commit
9dfda27522
|
@ -1,25 +1,9 @@
|
|||
# $NetBSD$
|
||||
|
||||
# This is just a dummy to pull in Netlib BLAS from lapack.
|
||||
COMMENT= Netlib reference BLAS library
|
||||
LAPACK_COMPONENT= blas
|
||||
LAPACK_COMPONENT_CMAKE_ARGS= \
|
||||
-DUSE_OPTIMIZED_BLAS=OFF \
|
||||
-DCBLAS=OFF -DLAPACKE=OFF -DLAPACK=OFF
|
||||
|
||||
# Should the version be kept in sync with lapack?
|
||||
# The main point of this package is a smooth transition
|
||||
# until everyone uses mk/blas.buildlink3.mk (and people removed
|
||||
# math/blas from their pkgsrc-related scripts).
|
||||
|
||||
PKGNAME= blas-${NETLIB_BLAS_VERSION}
|
||||
CATEGORIES= math
|
||||
|
||||
MAINTAINER= thomas.orgis@uni-hamburg.de
|
||||
HOMEPAGE= https://www.netlib.org/lapack/
|
||||
COMMENT= Transitional BLAS package that depends on lapack
|
||||
LICENSE= modified-bsd
|
||||
|
||||
USE_LIBTOOL= yes
|
||||
|
||||
META_PACKAGE= yes
|
||||
|
||||
.include "../../wip/lapack/version.mk"
|
||||
.include "../../wip/lapack/buildlink3.mk"
|
||||
|
||||
.include "../../mk/bsd.pkg.mk"
|
||||
.include "../../wip/lapack/Makefile.common"
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
@comment $NetBSD$
|
||||
lib/libblas.a
|
||||
lib/libblas.so
|
||||
lib/libblas.so.3
|
||||
lib/libblas.so.${PKGVERSION}
|
||||
lib/pkgconfig/blas.pc
|
|
@ -2,6 +2,12 @@
|
|||
|
||||
BUILDLINK_TREE+= blas
|
||||
|
||||
.include "../../wip/lapack/buildlink3.mk"
|
||||
.if !defined(BLAS_BUILDLINK3_MK)
|
||||
BLAS_BUILDLINK3_MK:=
|
||||
|
||||
BUILDLINK_API_DEPENDS.blas+= blas>=3.8.0
|
||||
BUILDLINK_ABI_DEPENDS.blas+= blas>=3.8.0
|
||||
BUILDLINK_PKGSRCDIR.blas?= ../../wip/blas
|
||||
.endif # BLAS_BUILDLINK3_MK
|
||||
|
||||
BUILDLINK_TREE+= -blas
|
||||
|
|
|
@ -5,8 +5,14 @@ COMMENT= Linear Algebra PACKage (Netlib reference code)
|
|||
|
||||
LAPACK_COMPONENT= lapack
|
||||
LAPACK_COMPONENT_CMAKE_ARGS= \
|
||||
-DUSE_OPTIMIZED_BLAS=OFF \
|
||||
-DUSE_OPTIMIZED_BLAS=ON \
|
||||
-DBLAS_LIBRARIES=${BLAS_LIBS:Q} \
|
||||
-DUSE_OPTIMIZED_LAPACK=OFF \
|
||||
-DCBLAS=OFF -DLAPACKE=OFF
|
||||
|
||||
# This always uses Netlib BLAS. Other optimized BLAS packages bring
|
||||
# their own LAPACK, hence cblas and lapacke packages use
|
||||
# mk/blas.buildlink3.mk instead.
|
||||
.include "../../wip/blas/buildlink3.mk"
|
||||
|
||||
.include "../../wip/lapack/Makefile.common"
|
||||
|
|
|
@ -3,13 +3,8 @@ 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}
|
||||
lib/pkgconfig/blas.pc
|
||||
lib/pkgconfig/lapack.pc
|
||||
|
|
|
@ -8,6 +8,9 @@ LAPACK_BUILDLINK3_MK:=
|
|||
BUILDLINK_API_DEPENDS.lapack+= lapack>=3.8.0
|
||||
BUILDLINK_ABI_DEPENDS.lapack+= lapack>=3.8.0
|
||||
BUILDLINK_PKGSRCDIR.lapack?= ../../wip/lapack
|
||||
|
||||
.include "../../wip/blas/buildlink3.mk"
|
||||
|
||||
.endif # LAPACK_BUILDLINK3_MK
|
||||
|
||||
BUILDLINK_TREE+= -lapack
|
||||
|
|
|
@ -7,7 +7,7 @@ Size (lapack-3.9.0.tar.gz) = 7534567 bytes
|
|||
SHA1 (patch-BLAS_SRC_CMakeLists.txt) = c8c69e6e0c67337af999863c4f5c64618d1374d7
|
||||
SHA1 (patch-CBLAS_cblas.pc.in) = 3befb18c1b7f2f82c6da83ea10f913c817acf09f
|
||||
SHA1 (patch-CBLAS_src_CMakeLists.txt) = faa1ad6c322830cb62e0f5bdab33732c0372cce3
|
||||
SHA1 (patch-CMakeLists.txt) = 0d853fc8bd17daaeb03e6f0a9993a050eea80c91
|
||||
SHA1 (patch-CMakeLists.txt) = 90de0b88da519ea75659cd962fd2d1d9a29f5c07
|
||||
SHA1 (patch-LAPACKE_CMakeLists.txt) = 745c662d7f9ca45905434bffafaec2566e1a5559
|
||||
SHA1 (patch-LAPACKE_lapacke.pc.in) = 7f0d91aaceac7f9980650ec90dbda95cf09b768f
|
||||
SHA1 (patch-SRC_CMakeLists.txt) = 2908cdeb0d94f51ec16b02b8a6426dd6cde7e10f
|
||||
|
|
|
@ -1,29 +1,120 @@
|
|||
$NetBSD$
|
||||
|
||||
Avoid installation of LAPACK CMake and pkg-config files when not installing
|
||||
LAPACK.
|
||||
LAPACK, also allowing explicitly to switch off LAPACK build for BLAS-only
|
||||
packaging.
|
||||
|
||||
--- CMakeLists.txt.orig 2019-11-21 08:57:43.000000000 +0100
|
||||
+++ CMakeLists.txt 2020-01-03 19:48:54.141281263 +0100
|
||||
@@ -372,10 +372,12 @@
|
||||
--- CMakeLists.txt.orig 2020-03-03 15:36:43.155560348 +0100
|
||||
+++ CMakeLists.txt 2020-03-03 15:36:34.827560837 +0100
|
||||
@@ -11,7 +11,7 @@
|
||||
)
|
||||
|
||||
if(NOT BLAS_FOUND)
|
||||
set(ALL_TARGETS ${ALL_TARGETS} blas)
|
||||
+ set(BLAS ON)
|
||||
# Add the CMake directory for custon CMake modules
|
||||
-set(CMAKE_MODULE_PATH "${LAPACK_SOURCE_DIR}/CMAKE" ${CMAKE_MODULE_PATH})
|
||||
+set (CMAKE_MODULE_PATH "/tmp/work-with-system-gcc/pkgsrc/cvs-20200227/pkgsrc-cvs-20200227/math/blas/work/.buildlink/cmake-Modules" "/tmp/work-with-system-gcc/pkgsrc/cvs-20200227/pkgsrc-cvs-20200227/math/blas/work/.buildlink/cmake-Modules" "/tmp/work-with-system-gcc/pkgsrc/cvs-20200227/pkgsrc-cvs-20200227/math/blas/work/.buildlink/cmake-Modules" "${LAPACK_SOURCE_DIR}/CMAKE" ${CMAKE_MODULE_PATH})
|
||||
|
||||
# Export all symbols on Windows when building shared libraries
|
||||
SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
||||
@@ -112,8 +112,10 @@
|
||||
|
||||
|
||||
# --------------------------------------------------
|
||||
-set(LAPACK_INSTALL_EXPORT_NAME lapack-targets)
|
||||
|
||||
+if(LAPACK)
|
||||
+
|
||||
+set(LAPACK_INSTALL_EXPORT_NAME lapack-targets)
|
||||
macro(lapack_install_library lib)
|
||||
install(TARGETS ${lib}
|
||||
EXPORT ${LAPACK_INSTALL_EXPORT_NAME}
|
||||
@@ -123,6 +125,18 @@
|
||||
)
|
||||
endmacro()
|
||||
|
||||
+else()
|
||||
+
|
||||
+macro(lapack_install_library lib)
|
||||
+ install(TARGETS ${lib}
|
||||
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development
|
||||
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries
|
||||
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT RuntimeLibraries
|
||||
+ )
|
||||
+endmacro()
|
||||
+
|
||||
+endif()
|
||||
+
|
||||
set(PKG_CONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
|
||||
# --------------------------------------------------
|
||||
@@ -252,6 +266,10 @@
|
||||
|
||||
option(USE_OPTIMIZED_LAPACK "Whether or not to use an optimized LAPACK library instead of included netlib LAPACK" OFF)
|
||||
|
||||
+option(LAPACK "Whether to build or use LAPACK (to enable a BLAS-only build)")
|
||||
+
|
||||
+if(LAPACK)
|
||||
+
|
||||
# --------------------------------------------------
|
||||
# LAPACK
|
||||
# User did not provide a LAPACK Library but specified to search for one
|
||||
@@ -293,6 +311,8 @@
|
||||
CACHE STRING "Linker flags for shared libs" FORCE)
|
||||
endif()
|
||||
|
||||
+endif()
|
||||
+
|
||||
if(BUILD_TESTING)
|
||||
add_subdirectory(TESTING)
|
||||
endif()
|
||||
@@ -374,14 +394,18 @@
|
||||
set(ALL_TARGETS ${ALL_TARGETS} blas)
|
||||
endif()
|
||||
|
||||
+if(LAPACK)
|
||||
if(NOT LATESTLAPACK_FOUND)
|
||||
set(ALL_TARGETS ${ALL_TARGETS} lapack)
|
||||
+ set(LAPACK ON)
|
||||
+ set(BUILD_LAPACK ON)
|
||||
+endif()
|
||||
endif()
|
||||
|
||||
if(BUILD_TESTING OR LAPACKE_WITH_TMG)
|
||||
@@ -420,12 +422,14 @@
|
||||
${LAPACK_BINARY_DIR}/lapack-config.cmake @ONLY)
|
||||
set(ALL_TARGETS ${ALL_TARGETS} tmglib)
|
||||
endif()
|
||||
|
||||
+if(LAPACK)
|
||||
# Export lapack targets, not including lapacke, from the
|
||||
# install tree, if any.
|
||||
set(_lapack_config_install_guard_target "")
|
||||
@@ -395,6 +419,7 @@
|
||||
# lapack-config.cmake to load targets from the install tree.
|
||||
list(GET ALL_TARGETS 0 _lapack_config_install_guard_target)
|
||||
endif()
|
||||
+endif()
|
||||
|
||||
# Include cblas in targets exported from the build tree.
|
||||
if(CBLAS)
|
||||
@@ -406,6 +431,7 @@
|
||||
set(ALL_TARGETS ${ALL_TARGETS} lapacke)
|
||||
endif()
|
||||
|
||||
+if(LAPACK)
|
||||
# Export lapack and lapacke targets from the build tree, if any.
|
||||
set(_lapack_config_build_guard_target "")
|
||||
if(ALL_TARGETS)
|
||||
@@ -415,32 +441,34 @@
|
||||
# for lapack-config.cmake to load targets from the build tree.
|
||||
list(GET ALL_TARGETS 0 _lapack_config_build_guard_target)
|
||||
endif()
|
||||
+endif()
|
||||
|
||||
-configure_file(${LAPACK_SOURCE_DIR}/CMAKE/lapack-config-build.cmake.in
|
||||
- ${LAPACK_BINARY_DIR}/lapack-config.cmake @ONLY)
|
||||
-
|
||||
+if(BUILD_LAPACK)
|
||||
+ configure_file(${LAPACK_SOURCE_DIR}/CMAKE/lapack-config-build.cmake.in
|
||||
+ ${LAPACK_BINARY_DIR}/lapack-config.cmake @ONLY)
|
||||
|
||||
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lapack.pc.in ${CMAKE_CURRENT_BINARY_DIR}/lapack.pc @ONLY)
|
||||
+if(LAPACK)
|
||||
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lapack.pc.in ${CMAKE_CURRENT_BINARY_DIR}/lapack.pc @ONLY)
|
||||
install(FILES
|
||||
- ${CMAKE_CURRENT_BINARY_DIR}/lapack.pc
|
||||
|
@ -34,13 +125,24 @@ LAPACK.
|
|||
+ DESTINATION ${PKG_CONFIG_DIR}
|
||||
+ COMPONENT Development
|
||||
+ )
|
||||
+endif()
|
||||
|
||||
configure_file(${LAPACK_SOURCE_DIR}/CMAKE/lapack-config-install.cmake.in
|
||||
${LAPACK_BINARY_DIR}/CMakeFiles/lapack-config.cmake @ONLY)
|
||||
@@ -437,10 +441,12 @@
|
||||
COMPATIBILITY SameMajorVersion
|
||||
)
|
||||
-configure_file(${LAPACK_SOURCE_DIR}/CMAKE/lapack-config-install.cmake.in
|
||||
- ${LAPACK_BINARY_DIR}/CMakeFiles/lapack-config.cmake @ONLY)
|
||||
+ configure_file(${LAPACK_SOURCE_DIR}/CMAKE/lapack-config-install.cmake.in
|
||||
+ ${LAPACK_BINARY_DIR}/CMakeFiles/lapack-config.cmake @ONLY)
|
||||
|
||||
-include(CMakePackageConfigHelpers)
|
||||
-write_basic_package_version_file(
|
||||
- ${LAPACK_BINARY_DIR}/lapack-config-version.cmake
|
||||
- VERSION ${LAPACK_VERSION}
|
||||
- COMPATIBILITY SameMajorVersion
|
||||
- )
|
||||
+ include(CMakePackageConfigHelpers)
|
||||
+ write_basic_package_version_file(
|
||||
+ ${LAPACK_BINARY_DIR}/lapack-config-version.cmake
|
||||
+ VERSION ${LAPACK_VERSION}
|
||||
+ COMPATIBILITY SameMajorVersion
|
||||
+ )
|
||||
|
||||
-install(FILES
|
||||
- ${LAPACK_BINARY_DIR}/CMakeFiles/lapack-config.cmake
|
||||
|
@ -50,7 +152,6 @@ LAPACK.
|
|||
- )
|
||||
-
|
||||
\ Kein Zeilenumbruch am Dateiende.
|
||||
+if(LAPACK)
|
||||
+ install(FILES
|
||||
+ ${LAPACK_BINARY_DIR}/CMakeFiles/lapack-config.cmake
|
||||
+ ${LAPACK_BINARY_DIR}/lapack-config-version.cmake
|
||||
|
|
Loading…
Reference in New Issue