summaryrefslogtreecommitdiffstats
path: root/libraries/lapack
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/lapack')
-rw-r--r--libraries/lapack/README7
-rw-r--r--libraries/lapack/lapack.SlackBuild81
-rw-r--r--libraries/lapack/lapack.info6
-rw-r--r--libraries/lapack/patches/cmake-piecewise.diff369
4 files changed, 244 insertions, 219 deletions
diff --git a/libraries/lapack/README b/libraries/lapack/README
index 6cbfe89752..fb54ac26bb 100644
--- a/libraries/lapack/README
+++ b/libraries/lapack/README
@@ -2,8 +2,11 @@ LAPACK provides routines for solving systems of simultaneous linear
equations, least-squares solutions of linear systems of equations,
eigenvalue problems, and singular value problems.
+xblas is an optional dependency.
+
To build a static library in addition to the shared library,
pass STATIC=yes to the script.
-Note: If you want good performance, then use the BLAS libraries provided by
- your CPU vendor, or OpenBLAS or atlas provided by SlackBuilds.org.
+Note: If you want good performance, then use the BLAS libraries
+provided by your CPU vendor, or OpenBLAS or atlas provided by
+SlackBuilds.org.
diff --git a/libraries/lapack/lapack.SlackBuild b/libraries/lapack/lapack.SlackBuild
index 492a7c8673..1ec4de8555 100644
--- a/libraries/lapack/lapack.SlackBuild
+++ b/libraries/lapack/lapack.SlackBuild
@@ -1,8 +1,8 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for LAPACK
-# Copyright 2014-2020 Kyle Guinn <elyk03@gmail.com>
+# Copyright 2014-2024 Kyle Guinn <elyk03@gmail.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,11 +22,14 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=lapack
SRCNAM=lapack
-VERSION=${VERSION:-3.9.0}
+VERSION=${VERSION:-3.12.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$(uname -m)" in
@@ -36,16 +39,18 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
-PKG=$TMP/package-$PRGNAM-$VERSION
+PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
DOCS="LICENSE README.md DOCS/lapack.png DOCS/lawn81.tex DOCS/org2.ps"
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
-elif [ "$ARCH" = "i586" ]; then
+if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -69,6 +74,10 @@ chmod -R u+w,go-w,a+rX-st .
# Allow building only the LAPACK component.
patch -p1 < $CWD/patches/cmake-piecewise.diff
+if pkg-config --exists xblas; then
+ use_xblas='-DUSE_XBLAS=ON'
+fi
+
# Avoid adding an RPATH entry to the shared lib. It's unnecessary (except for
# running the test suite), and it's broken on 64-bit (needs LIBDIRSUFFIX).
mkdir -p shared
@@ -82,6 +91,7 @@ cd shared
-DUSE_OPTIMIZED_BLAS=ON \
-DBUILD_LAPACK=ON \
-DBUILD_DEPRECATED=ON \
+ $use_xblas \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_SKIP_RPATH=YES \
..
@@ -104,28 +114,47 @@ if [ "${STATIC:-no}" != "no" ]; then
-DUSE_OPTIMIZED_BLAS=ON \
-DBUILD_LAPACK=ON \
-DBUILD_DEPRECATED=ON \
+ $use_xblas \
..
make
make install/strip DESTDIR=$PKG
cd ..
fi
-# Generate man pages. Also requires some fix-ups:
+# Generate man pages. Since 3.12.0 there is no longer a Doxyfile
+# intended for man page creation (only html), so attempt to recreate it.
+# Note that CMake can generate a Doxyfile, but it may differ from the
+# supplied one, and is less convenient to edit.
# 0. Join all escaped newlines so the entire value is replaced.
+# 1. Turn off GENERATE_HTML.
+# 2. Turn on GENERATE_MAN.
+# 3. Turn off MAN_LINKS, see below.
+# 4. Turn off HAVE_DOT, disable all graph generation.
+# 5. Turn off CREATE_SUBDIRS, may interfere with output file locations.
+# 6. Turn off REPEAT_BRIEF's repetitive comments.
+# 7. Turn off FULL_PATH_NAMES, omit source code paths from man pages.
+# 8. Turn off INLINE_SOURCES, don't copy the code to the man pages.
+sed -i \
+ -e ':a;/\\$/N;s/\s*\\\n\s*/ /;ta' \
+ -e 's/^\(GENERATE_HTML *=\).*/\1 NO/' \
+ -e 's/^\(GENERATE_MAN *=\).*/\1 YES/' \
+ -e 's/^\(MAN_LINKS *=\).*/\1 NO/' \
+ -e 's/^\(HAVE_DOT *=\).*/\1 NO/' \
+ -e 's/^\(CREATE_SUBDIRS *=\).*/\1 NO/' \
+ -e 's/^\(REPEAT_BRIEF *=\).*/\1 NO/' \
+ -e 's/^\(FULL_PATH_NAMES *=\).*/\1 NO/' \
+ -e 's/^\(INLINE_SOURCES *=\).*/\1 NO/' \
+ DOCS/Doxyfile
+# Limit ourselves to the LAPACK functions:
# 1. Only generate on the LAPACK sources.
-# 2. Turn off recursion. Only operate on directories in INPUT.
-# 3. Turn off EXCLUDE to not conflict with INPUT.
-# 4. Turn off some repetitive comments.
-# 5. Turn off MAN_LINKS. See below.
+# 2. Turn off RECURSIVE, only operate on directories in INPUT.
+# 3. Turn off EXCLUDE, to not conflict with INPUT.
sed -i \
- -e ':a;/\\$/N;s/\\\n//;ta' \
- -e 's/^\(INPUT *=\).*/\1 SRC/' \
+ -e 's/^\(INPUT *=\).*/\1 SRC SRC\/DEPRECATED/' \
-e 's/^\(RECURSIVE *=\).*/\1 NO/' \
-e 's/^\(EXCLUDE *=\).*/\1/' \
- -e 's/^\(REPEAT_BRIEF *=\).*/\1 NO/' \
- -e 's/^\(MAN_LINKS *=\).*/\1 NO/' \
- DOCS/Doxyfile_man
-doxygen DOCS/Doxyfile_man
+ DOCS/Doxyfile
+doxygen DOCS/Doxyfile
# Doxygen generates manpages on a file-by-file basis (note the .f extensions).
# We want a page for each function, not each file. MAN_LINKS creates a page
# for each function that just sources the page for the corresponding file.
@@ -135,11 +164,19 @@ mkdir -p $PKG/usr/man/man3
for i in DOCS/man/man3/*.f.3; do
gzip -9c $i > $PKG/usr/man/man3/$(basename $i .f.3).3.gz
done
+for i in DOCS/man/man3/*.F.3; do
+ gzip -9c $i > $PKG/usr/man/man3/$(basename $i .F.3).3.gz
+done
+for i in DOCS/man/man3/*.f90.3; do
+ gzip -9c $i > $PKG/usr/man/man3/$(basename $i .f90.3).3.gz
+done
# Fix up some special cases where the mapping isn't 1:1.
ln -s sladiv.3.gz $PKG/usr/man/man3/sladiv1.3.gz
ln -s sladiv.3.gz $PKG/usr/man/man3/sladiv2.3.gz
ln -s dladiv.3.gz $PKG/usr/man/man3/dladiv1.3.gz
ln -s dladiv.3.gz $PKG/usr/man/man3/dladiv2.3.gz
+# Remove internal documentation.
+rm $PKG/usr/man/man3/la_constants.3.gz
# Remove files that are supplied by BLAS.
rm $PKG/usr/man/man3/xerbla.3.gz
rm $PKG/usr/man/man3/xerbla_array.3.gz
@@ -148,8 +185,8 @@ rm $PKG/usr/man/man3/xerbla_array.3.gz
# select few. Some are duplicated by BLAS (lsame.f), are unused (slamchf77.f,
# dlamchf77.f), or are test programs.
rm -rf DOCS/man
-sed -i 's/^\(INPUT *=\).*/\1 INSTALL/' DOCS/Doxyfile_man
-doxygen DOCS/Doxyfile_man
+sed -i 's/^\(INPUT *=\).*/\1 INSTALL/' DOCS/Doxyfile
+doxygen DOCS/Doxyfile
gzip -9c DOCS/man/man3/ilaver.f.3 > $PKG/usr/man/man3/ilaver.3.gz
gzip -9c DOCS/man/man3/slamch.f.3 > $PKG/usr/man/man3/slamch.3.gz
gzip -9c DOCS/man/man3/dlamch.f.3 > $PKG/usr/man/man3/dlamch.3.gz
@@ -174,4 +211,4 @@ mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/libraries/lapack/lapack.info b/libraries/lapack/lapack.info
index 3e4930804f..78690e0214 100644
--- a/libraries/lapack/lapack.info
+++ b/libraries/lapack/lapack.info
@@ -1,8 +1,8 @@
PRGNAM="lapack"
-VERSION="3.9.0"
+VERSION="3.12.0"
HOMEPAGE="https://www.netlib.org/lapack/"
-DOWNLOAD="https://github.com/Reference-LAPACK/lapack/archive/v3.9.0/lapack-3.9.0.tar.gz"
-MD5SUM="0b251e2a8d5f949f99b50dd5e2200ee2"
+DOWNLOAD="https://github.com/Reference-LAPACK/lapack/archive/v3.12.0/lapack-3.12.0.tar.gz"
+MD5SUM="c1b38bef123584d86a1bd8000784a7b2"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="blas"
diff --git a/libraries/lapack/patches/cmake-piecewise.diff b/libraries/lapack/patches/cmake-piecewise.diff
index b1bdfaec1e..37cde2acaa 100644
--- a/libraries/lapack/patches/cmake-piecewise.diff
+++ b/libraries/lapack/patches/cmake-piecewise.diff
@@ -2,69 +2,37 @@ 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 cblas-targets)
+-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
-@@ -41,54 +39,8 @@
- add_subdirectory(examples)
- endif()
-
--if(NOT BLAS_FOUND)
-- set(ALL_TARGETS ${ALL_TARGETS} blas)
--endif()
--
--# Export cblas targets from the
--# install tree, if any.
--set(_cblas_config_install_guard_target "")
--if(ALL_TARGETS)
-- install(EXPORT cblas-targets
-- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cblas-${LAPACK_VERSION}
-- COMPONENT Development
-- )
-- # Choose one of the cblas targets to use as a guard for
-- # cblas-config.cmake to load targets from the install tree.
-- list(GET ALL_TARGETS 0 _cblas_config_install_guard_target)
--endif()
--
--# Export cblas targets from the build tree, if any.
--set(_cblas_config_build_guard_target "")
--if(ALL_TARGETS)
-- export(TARGETS ${ALL_TARGETS} FILE cblas-targets.cmake)
--
-- # Choose one of the cblas targets to use as a guard
-- # for cblas-config.cmake to load targets from the build tree.
-- list(GET ALL_TARGETS 0 _cblas_config_build_guard_target)
--endif()
+ include(CheckLanguage)
+ check_language(Fortran)
+@@ -54,22 +52,3 @@
+ DESTINATION ${PKG_CONFIG_DIR}
+ COMPONENT Development
+ )
-
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-version.cmake.in
-- ${LAPACK_BINARY_DIR}/cblas-config-version.cmake @ONLY)
+- ${LAPACK_BINARY_DIR}/${CBLASLIB}-config-version.cmake @ONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-build.cmake.in
-- ${LAPACK_BINARY_DIR}/cblas-config.cmake @ONLY)
--
--
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cblas.pc.in ${CMAKE_CURRENT_BINARY_DIR}/cblas.pc @ONLY)
- install(FILES
- ${CMAKE_CURRENT_BINARY_DIR}/cblas.pc
- DESTINATION ${PKG_CONFIG_DIR}
- )
+- ${LAPACK_BINARY_DIR}/${CBLASLIB}-config.cmake @ONLY)
-
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-install.cmake.in
-- ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/cblas-config.cmake @ONLY)
+- ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${CBLASLIB}-config.cmake @ONLY)
-install(FILES
-- ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/cblas-config.cmake
-- ${LAPACK_BINARY_DIR}/cblas-config-version.cmake
-- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cblas-${LAPACK_VERSION}
+- ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${CBLASLIB}-config.cmake
+- ${LAPACK_BINARY_DIR}/${CBLASLIB}-config-version.cmake
+- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CBLASLIB}-${LAPACK_VERSION}
+- COMPONENT Development
- )
-
--#install(EXPORT cblas-targets
--# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cblas-${LAPACK_VERSION}
--# COMPONENT Development
--# )
+-install(EXPORT ${CBLASLIB}-targets
+- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CBLASLIB}-${LAPACK_VERSION}
+- COMPONENT Development
+- )
diff --git a/CBLAS/cmake/cblas-config-build.cmake.in b/CBLAS/cmake/cblas-config-build.cmake.in
deleted file mode 100644
--- a/CBLAS/cmake/cblas-config-build.cmake.in
@@ -76,41 +44,37 @@ deleted file mode 100644
-
-# Load lapack targets from the build tree, including lapacke targets.
-if(NOT TARGET lapacke)
-- include("@LAPACK_BINARY_DIR@/lapack-targets.cmake")
+- include("@LAPACK_BINARY_DIR@/@LAPACKLIB@-targets.cmake")
-endif()
-
-# Report cblas header search locations from build tree.
-set(CBLAS_INCLUDE_DIRS "@LAPACK_BINARY_DIR@/include")
-
-# Report cblas libraries.
--set(CBLAS_LIBRARIES cblas)
+-set(CBLAS_LIBRARIES @CBLASLIB@)
diff --git a/CBLAS/cmake/cblas-config-install.cmake.in b/CBLAS/cmake/cblas-config-install.cmake.in
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/lapack-@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.
--if(NOT TARGET cblas)
-- include(${_CBLAS_SELF_DIR}/cblas-targets.cmake)
+-if(NOT TARGET @CBLASLIB@)
+- include(${_CBLAS_SELF_DIR}/@CBLASLIB@-targets.cmake)
-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 cblas)
+-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
@@ -128,16 +92,16 @@ 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
-@@ -120,9 +120,5 @@
- VERSION ${LAPACK_VERSION}
- SOVERSION ${LAPACK_MAJOR_VERSION}
- )
--target_include_directories(cblas PUBLIC
-- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
+@@ -172,9 +172,5 @@
+ if(HAS_ATTRIBUTE_WEAK_SUPPORT)
+ target_compile_definitions(${CBLASLIB} PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT)
+ endif()
+-target_include_directories(${CBLASLIB} PUBLIC
+- $<BUILD_INTERFACE:${LAPACK_BINARY_DIR}/include>
- $<INSTALL_INTERFACE:include>
-)
- target_link_libraries(cblas PRIVATE ${BLAS_LIBRARIES})
- lapack_install_library(cblas)
+ 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
--- a/CMAKE/lapack-config-build.cmake.in
@@ -146,7 +110,7 @@ deleted file mode 100644
-# Load lapack targets from the build tree if necessary.
-set(_LAPACK_TARGET "@_lapack_config_build_guard_target@")
-if(_LAPACK_TARGET AND NOT TARGET "${_LAPACK_TARGET}")
-- include("@LAPACK_BINARY_DIR@/lapack-targets.cmake")
+- include("@LAPACK_BINARY_DIR@/@LAPACKLIB@-targets.cmake")
-endif()
-unset(_LAPACK_TARGET)
-
@@ -168,7 +132,7 @@ deleted file mode 100644
-# Load lapack targets from the install tree if necessary.
-set(_LAPACK_TARGET "@_lapack_config_install_guard_target@")
-if(_LAPACK_TARGET AND NOT TARGET "${_LAPACK_TARGET}")
-- include("${_LAPACK_SELF_DIR}/lapack-targets.cmake")
+- include("${_LAPACK_SELF_DIR}/@LAPACKLIB@-targets.cmake")
-endif()
-unset(_LAPACK_TARGET)
-
@@ -184,11 +148,11 @@ deleted file mode 100644
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -112,11 +112,8 @@
-
+@@ -155,11 +155,8 @@
+ endif()
# --------------------------------------------------
--set(LAPACK_INSTALL_EXPORT_NAME lapack-targets)
+-set(LAPACK_INSTALL_EXPORT_NAME ${LAPACKLIB}-targets)
-
macro(lapack_install_library lib)
install(TARGETS ${lib}
@@ -196,30 +160,8 @@ 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
-@@ -155,21 +152,6 @@
- include(CheckLAPACKCompilerFlags)
- CheckLAPACKCompilerFlags()
+@@ -218,8 +215,9 @@
--# --------------------------------------------------
--# Check second function
--
--include(CheckTimeFunction)
--set(TIME_FUNC NONE ${TIME_FUNC})
--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}")
-@@ -193,8 +175,9 @@
- endif()
# --------------------------------------------------
-# Subdirectories that need to be processed
@@ -229,7 +171,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
# Check the usage of the user provided BLAS libraries
if(BLAS_LIBRARIES)
-@@ -205,113 +188,108 @@
+@@ -230,59 +228,41 @@
if(BLAS_FOUND)
message(STATUS "--> BLAS supplied by user is WORKING, will use ${BLAS_LIBRARIES}.")
else()
@@ -250,7 +192,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
- message(STATUS "Using supplied NETLIB BLAS implementation")
- add_subdirectory(BLAS)
+elseif(BUILD_BLAS)
- set(BLAS_LIBRARIES blas)
+ set(BLAS_LIBRARIES ${BLASLIB})
-else()
- set(CMAKE_EXE_LINKER_FLAGS
- "${CMAKE_EXE_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
@@ -300,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()
@@ -326,24 +275,16 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
+ find_package(LAPACK)
+
+elseif(BUILD_LAPACK)
- set(LAPACK_LIBRARIES lapack)
+ set(LAPACK_LIBRARIES ${LAPACKLIB})
+ set(LAPACK_FOUND TRUE)
+
+ set(NEED_BLAS TRUE)
-+
-+ # Check second function
-+ include(CheckTimeFunction)
-+ set(TIME_FUNC NONE ${TIME_FUNC})
-+ 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
@@ -363,9 +304,9 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
+ add_subdirectory(TESTING)
+ endif()
+
-+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lapack.pc.in ${CMAKE_CURRENT_BINARY_DIR}/lapack.pc @ONLY)
++ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lapack.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${LAPACKLIB}.pc @ONLY)
+ install(FILES
-+ ${CMAKE_CURRENT_BINARY_DIR}/lapack.pc
++ ${CMAKE_CURRENT_BINARY_DIR}/${LAPACKLIB}.pc
+ DESTINATION ${PKG_CONFIG_DIR}
+ COMPONENT Development
+ )
@@ -381,11 +322,37 @@ 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)
+-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)
+- # Build and install TMG as part of LAPACKE targets (as opposed to LAPACK
+- # targets)
+- set(LAPACK_INSTALL_EXPORT_NAME ${LAPACKELIB}-targets)
+- endif()
+- endif()
+- add_subdirectory(TESTING/MATGEN)
+ set(BUILD_LAPACKE ON)
endif()
- if(BUILD_TESTING OR LAPACKE_WITH_TMG) #already included, avoid double inclusion
- add_subdirectory(TESTING/MATGEN)
- 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)
-if(LAPACKE)
+if(BUILD_LAPACKE)
@@ -393,8 +360,12 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
add_subdirectory(LAPACKE)
endif()
-@@ -338,109 +316,12 @@
- _display_cpp_implementation_msg("LAPACK")
+-
+ #-------------------------------------
+ # BLAS++ / LAPACK++
+ option(BLAS++ "Build BLAS++" OFF)
+@@ -446,111 +398,16 @@
+ ExternalProject_Add_StepDependencies(lapackpp build blaspp ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
endif()
-# --------------------------------------------------
@@ -411,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")
@@ -430,23 +401,19 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
-# --------------------------------------------------
-
-if(NOT BLAS_FOUND)
-- set(ALL_TARGETS ${ALL_TARGETS} blas)
+- set(ALL_TARGETS ${ALL_TARGETS} ${BLASLIB})
-endif()
-
-if(NOT LATESTLAPACK_FOUND)
-- set(ALL_TARGETS ${ALL_TARGETS} lapack)
--endif()
--
--if(BUILD_TESTING OR LAPACKE_WITH_TMG)
-- set(ALL_TARGETS ${ALL_TARGETS} tmglib)
+- set(ALL_TARGETS ${ALL_TARGETS} ${LAPACKLIB})
-endif()
-
-# Export lapack targets, not including lapacke, from the
-# install tree, if any.
-set(_lapack_config_install_guard_target "")
-if(ALL_TARGETS)
-- install(EXPORT lapack-targets
-- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lapack-${LAPACK_VERSION}
+- install(EXPORT ${LAPACKLIB}-targets
+- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LAPACKLIB}-${LAPACK_VERSION}
- COMPONENT Development
- )
-
@@ -457,12 +424,16 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
-
-# Include cblas in targets exported from the build tree.
-if(CBLAS)
-- set(ALL_TARGETS ${ALL_TARGETS} cblas)
+- set(ALL_TARGETS ${ALL_TARGETS} ${CBLASLIB})
-endif()
-
-# Include lapacke in targets exported from the build tree.
-if(LAPACKE)
-- set(ALL_TARGETS ${ALL_TARGETS} lapacke)
+- set(ALL_TARGETS ${ALL_TARGETS} ${LAPACKELIB})
+-endif()
+-
+-if(NOT LAPACK_WITH_TMGLIB_FOUND AND LAPACKE_WITH_TMG)
+- set(ALL_TARGETS ${ALL_TARGETS} ${TMGLIB})
+# Neither user specified or optimized BLAS libraries can be used
+if(NEED_BLAS AND NOT BLAS_FOUND)
+ message(FATAL_ERROR "--> No BLAS library found. Specify BLAS_LIBRARIES or enable USE_OPTIMIZED_BLAS or BUILD_BLAS.")
@@ -471,7 +442,7 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
-# Export lapack and lapacke targets from the build tree, if any.
-set(_lapack_config_build_guard_target "")
-if(ALL_TARGETS)
-- export(TARGETS ${ALL_TARGETS} FILE lapack-targets.cmake)
+- export(TARGETS ${ALL_TARGETS} FILE ${LAPACKLIB}-targets.cmake)
-
- # Choose one of the lapack or lapacke targets to use as a guard
- # for lapack-config.cmake to load targets from the build tree.
@@ -480,84 +451,85 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
+if(NEED_LAPACK AND NOT LAPACK_FOUND)
+ message(FATAL_ERROR "--> No LAPACK library found. Specify LAPACK_LIBRARIES or enable USE_OPTIMIZED_LAPACK or BUILD_LAPACK.")
endif()
--
+
-configure_file(${LAPACK_SOURCE_DIR}/CMAKE/lapack-config-build.cmake.in
-- ${LAPACK_BINARY_DIR}/lapack-config.cmake @ONLY)
+- ${LAPACK_BINARY_DIR}/${LAPACKLIB}-config.cmake @ONLY)
-
-
--configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lapack.pc.in ${CMAKE_CURRENT_BINARY_DIR}/lapack.pc @ONLY)
+-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lapack.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${LAPACKLIB}.pc @ONLY)
- install(FILES
-- ${CMAKE_CURRENT_BINARY_DIR}/lapack.pc
+- ${CMAKE_CURRENT_BINARY_DIR}/${LAPACKLIB}.pc
- DESTINATION ${PKG_CONFIG_DIR}
- COMPONENT Development
- )
-
-configure_file(${LAPACK_SOURCE_DIR}/CMAKE/lapack-config-install.cmake.in
-- ${LAPACK_BINARY_DIR}/CMakeFiles/lapack-config.cmake @ONLY)
+- ${LAPACK_BINARY_DIR}/CMakeFiles/${LAPACKLIB}-config.cmake @ONLY)
-
-include(CMakePackageConfigHelpers)
-write_basic_package_version_file(
-- ${LAPACK_BINARY_DIR}/lapack-config-version.cmake
+- ${LAPACK_BINARY_DIR}/${LAPACKLIB}-config-version.cmake
- VERSION ${LAPACK_VERSION}
- COMPATIBILITY SameMajorVersion
- )
-
-install(FILES
-- ${LAPACK_BINARY_DIR}/CMakeFiles/lapack-config.cmake
-- ${LAPACK_BINARY_DIR}/lapack-config-version.cmake
-- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lapack-${LAPACK_VERSION}
+- ${LAPACK_BINARY_DIR}/CMakeFiles/${LAPACKLIB}-config.cmake
+- ${LAPACK_BINARY_DIR}/${LAPACKLIB}-config-version.cmake
+- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LAPACKLIB}-${LAPACK_VERSION}
- COMPONENT Development
- )
--
-\ No newline at end of file
+ if (LAPACK++)
+ install(
+ DIRECTORY "${LAPACK_BINARY_DIR}/lib/"
diff --git a/LAPACKE/CMakeLists.txt b/LAPACKE/CMakeLists.txt
--- a/LAPACKE/CMakeLists.txt
+++ b/LAPACKE/CMakeLists.txt
@@ -1,8 +1,6 @@
- message(STATUS "LAPACKE enable")
+ message(STATUS "LAPACKE enabled")
enable_language(C)
--set(LAPACK_INSTALL_EXPORT_NAME lapacke-targets)
+-set(LAPACK_INSTALL_EXPORT_NAME ${LAPACKELIB}-targets)
-
- # Create a header file lapacke_mangling.h for the routines called in my C programs
- include(FortranCInterface)
- ## Ensure that the fortran compiler and c compiler specified are compatible
-@@ -79,14 +77,6 @@
+ include_directories(include ${LAPACK_BINARY_DIR}/include)
+ add_subdirectory(src)
+ add_subdirectory(utils)
+@@ -74,14 +72,6 @@
VERSION ${LAPACK_VERSION}
SOVERSION ${LAPACK_MAJOR_VERSION}
)
--target_include_directories(lapacke PUBLIC
-- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+-target_include_directories(${LAPACKELIB} PUBLIC
+- $<BUILD_INTERFACE:${LAPACK_BINARY_DIR}/include>
- $<INSTALL_INTERFACE:include>
-)
-if(WIN32 AND NOT UNIX)
-- target_compile_definitions(lapacke PUBLIC HAVE_LAPACK_CONFIG_H LAPACK_COMPLEX_STRUCTURE)
+- target_compile_definitions(${LAPACKELIB} PUBLIC HAVE_LAPACK_CONFIG_H LAPACK_COMPLEX_STRUCTURE)
- message(STATUS "Windows BUILD")
-endif()
if(LAPACKE_WITH_TMG)
- target_link_libraries(lapacke PRIVATE tmglib)
-@@ -111,22 +101,3 @@
+ target_link_libraries(${LAPACKELIB} PRIVATE ${TMGLIB})
+@@ -106,22 +96,3 @@
DESTINATION ${PKG_CONFIG_DIR}
COMPONENT Development
)
-
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/lapacke-config-version.cmake.in
-- ${LAPACK_BINARY_DIR}/lapacke-config-version.cmake @ONLY)
+- ${LAPACK_BINARY_DIR}/${LAPACKELIB}-config-version.cmake @ONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/lapacke-config-build.cmake.in
-- ${LAPACK_BINARY_DIR}/lapacke-config.cmake @ONLY)
+- ${LAPACK_BINARY_DIR}/${LAPACKELIB}-config.cmake @ONLY)
-
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/lapacke-config-install.cmake.in
-- ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/lapacke-config.cmake @ONLY)
+- ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${LAPACKELIB}-config.cmake @ONLY)
-install(FILES
-- ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/lapacke-config.cmake
-- ${LAPACK_BINARY_DIR}/lapacke-config-version.cmake
-- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lapacke-${LAPACK_VERSION}
+- ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${LAPACKELIB}-config.cmake
+- ${LAPACK_BINARY_DIR}/${LAPACKELIB}-config-version.cmake
+- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LAPACKELIB}-${LAPACK_VERSION}
- COMPONENT Development
- )
-
--install(EXPORT lapacke-targets
-- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lapacke-${LAPACK_VERSION}
+-install(EXPORT ${LAPACKELIB}-targets
+- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LAPACKELIB}-${LAPACK_VERSION}
- COMPONENT Development
- )
diff --git a/LAPACKE/cmake/lapacke-config-build.cmake.in b/LAPACKE/cmake/lapacke-config-build.cmake.in
@@ -570,8 +542,8 @@ deleted file mode 100644
-find_package(LAPACK NO_MODULE)
-
-# Load lapack targets from the build tree, including lapacke targets.
--if(NOT TARGET lapacke)
-- include("@LAPACK_BINARY_DIR@/lapack-targets.cmake")
+-if(NOT TARGET @LAPACKELIB@)
+- include("@LAPACK_BINARY_DIR@/@LAPACKLIB@-targets.cmake")
-endif()
-
-# Hint for project building against lapack
@@ -581,37 +553,33 @@ deleted file mode 100644
-set(LAPACKE_INCLUDE_DIRS "@LAPACK_BINARY_DIR@/include")
-
-# Report lapacke libraries.
--set(LAPACKE_LIBRARIES lapacke ${LAPACK_LIBRARIES})
+-set(LAPACKE_LIBRARIES @LAPACKELIB@ ${LAPACK_LIBRARIES})
diff --git a/LAPACKE/cmake/lapacke-config-install.cmake.in b/LAPACKE/cmake/lapacke-config-install.cmake.in
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/lapack-@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.
--if(NOT TARGET lapacke)
-- include(${_LAPACKE_SELF_DIR}/lapacke-targets.cmake)
+-if(NOT TARGET @LAPACKELIB@)
+- include(${_LAPACKE_SELF_DIR}/@LAPACKELIB@-targets.cmake)
-endif()
-
-# Hint for project building against lapack
-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 lapacke ${LAPACK_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
@@ -626,3 +594,20 @@ deleted file mode 100644
- endif()
-endif()
-
+diff --git a/LAPACKE/include/CMakeLists.txt b/LAPACKE/include/CMakeLists.txt
+--- a/LAPACKE/include/CMakeLists.txt
++++ b/LAPACKE/include/CMakeLists.txt
+@@ -1,5 +1,5 @@
+ set(LAPACKE_INCLUDE lapack.h)
+-IF(LAPACKE)
++IF(BUILD_LAPACKE)
+ list(APPEND LAPACKE_INCLUDE lapacke.h lapacke_config.h lapacke_utils.h)
+ endif()
+
+@@ -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()