diff options
Diffstat (limited to 'libraries/lapack/lapack.SlackBuild')
-rw-r--r-- | libraries/lapack/lapack.SlackBuild | 81 |
1 files changed, 59 insertions, 22 deletions
diff --git a/libraries/lapack/lapack.SlackBuild b/libraries/lapack/lapack.SlackBuild index 8b79c83e17..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-2017 Kyle Guinn <elyk03@gmail.com>, USA +# 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.8.0} -BUILD=${BUILD:-2} +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 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 |