From e362443ab8551a32511403281b24ebc2cf887be8 Mon Sep 17 00:00:00 2001 From: plunky Date: Fri, 28 Feb 2020 21:48:53 +0000 Subject: Update math/lapack and math/blas to v3.9.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Have switched to the CMAKE build and enabled tests. make test passes all (with one patch pushed upstream) Package additions, from the release notes are: LAPACK 3.9.0 LAPACK QR preconditioned QR SVD method for computing the SVD with high accuracy, by Zlatko Drmac LAPACK Householder Reconstruction by Igor Kozachenko and Jim Demmel LAPACK 3.8.0 Symmetric-indefinite Factorization: Aasen’s tridiagonalization 2 stage A contribution from Ichitaro Yamazaki (University of Tennessee). LAPACKE interfaces A contribution from Julie Langou (University of Tennessee). --- math/blas/Makefile | 11 +++-- math/blas/PLIST | 6 ++- math/blas/buildlink3.mk | 4 +- math/lapack/Makefile | 25 ++--------- math/lapack/Makefile.common | 33 ++++++++++---- math/lapack/PLIST | 6 ++- math/lapack/distinfo | 16 +++---- math/lapack/files/etime_test.f | 27 ------------ math/lapack/patches/patch-BLAS_SRC_Makefile | 23 ---------- .../patches/patch-TESTING_MATGEN_CMakeLists.txt | 12 ++++++ math/lapack/patches/patch-TESTING_dbal.in | 14 ++++++ math/lapack/patches/patch-aa | 50 ---------------------- math/lapack/patches/patch-ac | 16 ------- math/lapack/patches/patch-ad | 17 -------- 14 files changed, 78 insertions(+), 182 deletions(-) delete mode 100644 math/lapack/files/etime_test.f delete mode 100644 math/lapack/patches/patch-BLAS_SRC_Makefile create mode 100644 math/lapack/patches/patch-TESTING_MATGEN_CMakeLists.txt create mode 100644 math/lapack/patches/patch-TESTING_dbal.in delete mode 100644 math/lapack/patches/patch-aa delete mode 100644 math/lapack/patches/patch-ac delete mode 100644 math/lapack/patches/patch-ad diff --git a/math/blas/Makefile b/math/blas/Makefile index aca0869db2f..9b565674f5f 100644 --- a/math/blas/Makefile +++ b/math/blas/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.36 2016/12/03 15:37:34 marino Exp $ +# $NetBSD: Makefile,v 1.37 2020/02/28 21:48:53 plunky Exp $ .include "../../math/lapack/Makefile.common" @@ -6,12 +6,11 @@ PKGNAME= ${DISTNAME:S/lapack/blas/} COMMENT= Basic Linear Algebra Subprograms (Fortran) -PATCHDIR= ${.CURDIR}/../../math/lapack/patches +# not actually true but pretend as we package it separately +CMAKE_ARGS+= -DLATESTLAPACK_FOUND:BOOL=TRUE -BUILD_TARGET= blaslib +BUILD_TARGET= blas -do-install: - ${LIBTOOL} --mode=install ${INSTALL_DATA} ${WRKSRC}/BLAS/SRC/libblas.la \ - ${DESTDIR}${PREFIX}/lib +TEST_DIRS= ${WRKSRC}/${OBJDIR}/BLAS .include "../../mk/bsd.pkg.mk" diff --git a/math/blas/PLIST b/math/blas/PLIST index d7d83077d7d..2e01e3b40ce 100644 --- a/math/blas/PLIST +++ b/math/blas/PLIST @@ -1,2 +1,4 @@ -@comment $NetBSD: PLIST,v 1.4 2004/09/22 08:09:42 jlam Exp $ -lib/libblas.la +@comment $NetBSD: PLIST,v 1.5 2020/02/28 21:48:53 plunky Exp $ +lib/libblas.so +lib/libblas.so.3 +lib/libblas.so.${PKGVERSION} diff --git a/math/blas/buildlink3.mk b/math/blas/buildlink3.mk index 80124c99072..53a51e91c05 100644 --- a/math/blas/buildlink3.mk +++ b/math/blas/buildlink3.mk @@ -1,4 +1,4 @@ -# $NetBSD: buildlink3.mk,v 1.8 2009/03/20 19:24:56 joerg Exp $ +# $NetBSD: buildlink3.mk,v 1.9 2020/02/28 21:48:53 plunky Exp $ BUILDLINK_TREE+= blas @@ -8,6 +8,8 @@ BLAS_BUILDLINK3_MK:= BUILDLINK_API_DEPENDS.blas+= blas>=1.0nb2 BUILDLINK_ABI_DEPENDS.blas+= blas>=1.0nb3 BUILDLINK_PKGSRCDIR.blas?= ../../math/blas + +BLAS_LIBS= -lblas .endif # BLAS_BUILDLINK3_MK BUILDLINK_TREE+= -blas diff --git a/math/lapack/Makefile b/math/lapack/Makefile index b2b87a3df38..4af306f3fe8 100644 --- a/math/lapack/Makefile +++ b/math/lapack/Makefile @@ -1,30 +1,13 @@ -# $NetBSD: Makefile,v 1.39 2019/10/05 06:14:05 ryoon Exp $ +# $NetBSD: Makefile,v 1.40 2020/02/28 21:48:53 plunky Exp $ .include "Makefile.common" COMMENT= Linear Algebra PACKage -BUILD_TARGET= lapacklib +# use external blas +CMAKE_ARGS+= -DBLAS_LIBRARIES:STRING=${BLAS_LIBS} -# -j8 fails with some .o file not-found errors. -MAKE_JOBS_SAFE= no - -#FFLAGS+= -ffloat-store - -# With f2c-20090411nb4, libf2c-20090201nb3, we need EXT_ETIME but gcc44-4.4.1nb3 -# needs INT_ETIME. Rather than trying to enumerate all possible fortran compilers, -# just do a test for it. -do-configure: - @${ECHO_N} "Checking if fortran compiler has etime() as an intrinsic: " - @cd ${WRKDIR} && ${FC} -o etime_test ${FILESDIR}/etime_test.f >${WRKDIR}/etime_test.log 2>&1; \ - if test $$? -eq 0 ; then \ - ${ECHO} "TIMER=INT_ETIME" >> ${WRKSRC}/make.inc ; ${ECHO} "YES" ; else \ - ${ECHO} "TIMER=EXT_ETIME" >> ${WRKSRC}/make.inc ; ${ECHO} "NO" ; fi - @${ECHO} "See ${WRKDIR}/etime_test.log for details on the test" - -do-install: - ${LIBTOOL} --mode=install ${INSTALL_DATA} ${WRKSRC}/liblapack.la \ - ${DESTDIR}${PREFIX}/lib +BUILD_TARGET= lapack .include "../../math/blas/buildlink3.mk" .include "../../mk/bsd.pkg.mk" diff --git a/math/lapack/Makefile.common b/math/lapack/Makefile.common index 7b6224440b3..d601b489f76 100644 --- a/math/lapack/Makefile.common +++ b/math/lapack/Makefile.common @@ -1,9 +1,8 @@ -# $NetBSD: Makefile.common,v 1.10 2020/01/26 17:31:38 rillig Exp $ +# $NetBSD: Makefile.common,v 1.11 2020/02/28 21:48:53 plunky Exp $ # used by math/blas/Makefile # used by math/lapack/Makefile -DISTNAME= lapack-3.7.1 -PKGREVISION= 1 +DISTNAME= lapack-3.9.0 CATEGORIES= math MASTER_SITES= ${MASTER_SITE_NETLIB:=lapack/} EXTRACT_SUFX= .tgz @@ -12,14 +11,32 @@ MAINTAINER= adam@NetBSD.org HOMEPAGE= https://www.netlib.org/lapack/ LICENSE= modified-bsd -USE_LANGUAGES= c fortran -USE_LIBTOOL= yes -USE_TOOLS+= gmake - -MAKE_ENV+= BUILD_DEPRECATED=yes DISTINFO_FILE= ${.CURDIR}/../../math/lapack/distinfo PATCHDIR= ${.CURDIR}/../../math/lapack/patches +USE_LANGUAGES= c fortran +USE_CMAKE= yes + +OBJDIR= obj + +CONFIGURE_DIRS= ${OBJDIR} +CMAKE_ARG_PATH= .. +CMAKE_ARGS+= -DBUILD_SHARED_LIBS:BOOL=ON +CMAKE_ARGS+= -DBUILD_DEPRECATED:BOOL=ON +CMAKE_ARGS+= -DBUILD_TESTING:BOOL=ON + +TEST_TARGET= all test +TEST_ENV= LD_LIBRARY_PATH=${WRKSRC}/${OBJDIR}/lib + +pre-configure: + cd ${WRKSRC} && ${MKDIR} ${OBJDIR} + +do-install: + cd ${WRKSRC}/${OBJDIR} && \ + ${PKGSRC_SETENV} ${INSTALL_ENV} ${MAKE_ENV} \ + ${CMAKE} -DCMAKE_INSTALL_COMPONENT=RuntimeLibraries \ + -P cmake_install.cmake + INSTALLATION_DIRS= lib # blas fails using the gold linker with: diff --git a/math/lapack/PLIST b/math/lapack/PLIST index 9478243beb0..1e08f1ec9c7 100644 --- a/math/lapack/PLIST +++ b/math/lapack/PLIST @@ -1,2 +1,4 @@ -@comment $NetBSD: PLIST,v 1.3 2004/09/22 08:09:42 jlam Exp $ -lib/liblapack.la +@comment $NetBSD: PLIST,v 1.4 2020/02/28 21:48:53 plunky Exp $ +lib/liblapack.so +lib/liblapack.so.3 +lib/liblapack.so.${PKGVERSION} diff --git a/math/lapack/distinfo b/math/lapack/distinfo index e35ad53faf4..6f1d7660b54 100644 --- a/math/lapack/distinfo +++ b/math/lapack/distinfo @@ -1,10 +1,8 @@ -$NetBSD: distinfo,v 1.21 2017/09/11 20:56:28 wiz Exp $ +$NetBSD: distinfo,v 1.22 2020/02/28 21:48:53 plunky Exp $ -SHA1 (lapack-3.7.1.tgz) = 84c4f7163b52b1bf1f6ca2193f6f48ed3dec0fab -RMD160 (lapack-3.7.1.tgz) = db7d1e3cd904d01459db3c40bc613cb8738ad114 -SHA512 (lapack-3.7.1.tgz) = b16063146626d2f67ae1456a660dbb93f42d8387cfebef1bc2681a35b5d21d53120fb74b52932373d2423cd7df39a7ae4bbfc992a71addd936bbdd051d4e2eb7 -Size (lapack-3.7.1.tgz) = 9137261 bytes -SHA1 (patch-BLAS_SRC_Makefile) = cf78648a8a1fe0320ad876a8d29e8f60defc07d7 -SHA1 (patch-aa) = 1b6bfd3737f8ee12334dcf0234ed75cc6253314d -SHA1 (patch-ac) = 14945f2d5d18a6e310a2237ca413967dc5bdf4ff -SHA1 (patch-ad) = 90e88c4e48c9effdfaf415691e2d3878effc3064 +SHA1 (lapack-3.9.0.tgz) = 9da5f17521260e9f0cfefd9dfc5616d9ef10efb0 +RMD160 (lapack-3.9.0.tgz) = 136c181f31fd056956a96cec723ceb5a4fdf3feb +SHA512 (lapack-3.9.0.tgz) = 90c2c8372c2567b15c25653ed64e7c86a2cb0f1dda116f33716c6877490415210217af5badb67cb50e9d428f56ff83d33a3dad60b6ed7d31919164f6e7e98e0f +Size (lapack-3.9.0.tgz) = 9347104 bytes +SHA1 (patch-TESTING_MATGEN_CMakeLists.txt) = 695655299ccc48eec4c38c75d50144b3a13ee8db +SHA1 (patch-TESTING_dbal.in) = 3a6a726b6504a07fb1c0908a3893ea46aca670ea diff --git a/math/lapack/files/etime_test.f b/math/lapack/files/etime_test.f deleted file mode 100644 index 32c313467e9..00000000000 --- a/math/lapack/files/etime_test.f +++ /dev/null @@ -1,27 +0,0 @@ - program main - -c -c $NetBSD: etime_test.f,v 1.1 2010/03/17 21:47:11 dmcmahill Exp $ -c -c Simple program to check if the etime function is available -c - implicit none - - real cpu - real etime - intrinsic etime - real t_array(2) - - cpu = etime ( t_array ) - - write ( *, '(a)' ) ' ' - write ( *, '(a)' ) ' ETIME reports:' - write ( *, '(a,g14.6)' ) - & ' The current CPU time is ', cpu - write ( *, '(a,g14.6)' ) - & ' TARRAY(1) = ', t_array(1) - write ( *, '(a,g14.6)' ) - & ' TARRAY(2) = ', t_array(2) - - stop - end diff --git a/math/lapack/patches/patch-BLAS_SRC_Makefile b/math/lapack/patches/patch-BLAS_SRC_Makefile deleted file mode 100644 index df4ab2d3c76..00000000000 --- a/math/lapack/patches/patch-BLAS_SRC_Makefile +++ /dev/null @@ -1,23 +0,0 @@ -$NetBSD: patch-BLAS_SRC_Makefile,v 1.5 2017/09/11 20:56:28 wiz Exp $ - -Use LIBTOOL. - ---- BLAS/SRC/Makefile.orig 2017-06-17 22:46:53.000000000 +0000 -+++ BLAS/SRC/Makefile -@@ -138,8 +138,8 @@ ALLOBJ = $(SBLAS1) $(SBLAS2) $(SBLAS3) $ - $(ZBLAS2) $(ZBLAS3) $(ALLBLAS) - - $(BLASLIB): $(ALLOBJ) -- $(ARCH) $(ARCHFLAGS) $@ $^ -- $(RANLIB) $@ -+ ${LIBTOOL} --mode=link --tag=FC ${FC} ${LDFLAGS} -o libblas.la \ -+ $(ALLOBJ:.o=.lo) -rpath ${PREFIX}/lib -version-info 4:0 - - single: $(SBLAS1) $(ALLBLAS) $(SBLAS2) $(SBLAS3) - $(ARCH) $(ARCHFLAGS) $(BLASLIB) $^ -@@ -167,4 +167,4 @@ cleanlib: - #rm -f $(BLASLIB) # May point to a system lib, e.g. -lblas - - .f.o: -- $(FORTRAN) $(OPTS) -c -o $@ $< -+ ${LIBTOOL} --mode=compile --tag=FC ${FC} ${FFLAGS} -c -o $@ $< diff --git a/math/lapack/patches/patch-TESTING_MATGEN_CMakeLists.txt b/math/lapack/patches/patch-TESTING_MATGEN_CMakeLists.txt new file mode 100644 index 00000000000..d8c08da0d8b --- /dev/null +++ b/math/lapack/patches/patch-TESTING_MATGEN_CMakeLists.txt @@ -0,0 +1,12 @@ +$NetBSD: patch-TESTING_MATGEN_CMakeLists.txt,v 1.1 2020/02/28 21:48:54 plunky Exp $ + +we don't actually want to install the testing matrix generator lib + +--- TESTING/MATGEN/CMakeLists.txt.orig 2020-02-20 13:46:28.024672825 +0000 ++++ TESTING/MATGEN/CMakeLists.txt +@@ -49,4 +49,4 @@ list(REMOVE_DUPLICATES SOURCES) + + add_library(tmglib ${SOURCES}) + target_link_libraries(tmglib ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}) +-lapack_install_library(tmglib) ++#lapack_install_library(tmglib) diff --git a/math/lapack/patches/patch-TESTING_dbal.in b/math/lapack/patches/patch-TESTING_dbal.in new file mode 100644 index 00000000000..93b20e15018 --- /dev/null +++ b/math/lapack/patches/patch-TESTING_dbal.in @@ -0,0 +1,14 @@ +$NetBSD: patch-TESTING_dbal.in,v 1.1 2020/02/28 21:48:54 plunky Exp $ + +remove extraneous semicolon from testing data (causes test to fail) + +--- TESTING/dbal.in.orig 2020-02-20 21:55:51.547637125 +0000 ++++ TESTING/dbal.in +@@ -209,6 +209,6 @@ DBL: Tests DGEBAL + 0.00000000000000000000D+00 0.00000000000000000000D+00 0.00000000000000000000D+00 0.63043209914231165391D-03 0.10000000000000000000D+01 0.79310682416114036641D+03 + 0.00000000000000000000D+00 0.00000000000000000000D+00 0.00000000000000000000D+00 0.00000000000000000000D+00 0.12608641982846233078D-02 0.10000000000000000000D+01 + +- 2.494800386918399765D+291 1.582914569427869018D+175 1.004336277661868922D+59 3.186183822264904554D-58 5.053968264940243633D-175 0.40083367200179455560D-291; ++ 2.494800386918399765D+291 1.582914569427869018D+175 1.004336277661868922D+59 3.186183822264904554D-58 5.053968264940243633D-175 0.40083367200179455560D-291 + + 0 diff --git a/math/lapack/patches/patch-aa b/math/lapack/patches/patch-aa deleted file mode 100644 index 4c0c0e8d605..00000000000 --- a/math/lapack/patches/patch-aa +++ /dev/null @@ -1,50 +0,0 @@ -$NetBSD: patch-aa,v 1.12 2017/09/11 20:56:28 wiz Exp $ - -Use LIBTOOL. - ---- SRC/Makefile.orig 2017-06-17 22:46:53.000000000 +0000 -+++ SRC/Makefile -@@ -497,19 +497,19 @@ DEPRECSRC = DEPRECATED/cgegs.o DEPRECATE - ALLOBJ = $(SLASRC) $(DLASRC) $(DSLASRC) $(CLASRC) $(ZLASRC) $(ZCLASRC) \ - $(SCLAUX) $(DZLAUX) $(ALLAUX) - - ifdef USEXBLAS - ALLXOBJ = $(SXLASRC) $(DXLASRC) $(CXLASRC) $(ZXLASRC) - endif - - ifdef BUILD_DEPRECATED - DEPRECATED = $(DEPRECSRC) - endif - - all: ../$(LAPACKLIB) - - ../$(LAPACKLIB): $(ALLOBJ) $(ALLXOBJ) $(DEPRECATED) -- $(ARCH) $(ARCHFLAGS) $@ $^ -- $(RANLIB) $@ -+ ${LIBTOOL} --mode=link --tag=FC ${FC} ${LDFLAGS} -o ../$(LAPACKLIB) \ -+ $(ALLOBJ:.o=.lo) $(ALLXOBJ:.o=.lo) $(DEPRECATED:.o=.lo) -rpath ${PREFIX}/lib -version-info 4:0 - - single: $(SLASRC) $(DSLASRC) $(SXLASRC) $(SCLAUX) $(ALLAUX) - $(ARCH) $(ARCHFLAGS) ../$(LAPACKLIB) $^ -@@ -553,13 +553,13 @@ cleanlib: - rm -f ../$(LAPACKLIB) - - .f.o: -- $(FORTRAN) $(OPTS) -c -o $@ $< -+ ${LIBTOOL} --mode=compile --tag=FC ${FC} ${FFLAGS} -c -o $@ $< - .F.o: -- $(FORTRAN) $(OPTS) -c -o $@ $< -+ ${LIBTOOL} --mode=compile --tag=FC ${FC} ${FFLAGS} -c -o $@ $< - --slaruv.o: slaruv.f ; $(FORTRAN) $(NOOPT) -c -o $@ $< --dlaruv.o: dlaruv.f ; $(FORTRAN) $(NOOPT) -c -o $@ $< --sla_wwaddw.o: sla_wwaddw.f ; $(FORTRAN) $(NOOPT) -c -o $@ $< --dla_wwaddw.o: dla_wwaddw.f ; $(FORTRAN) $(NOOPT) -c -o $@ $< --cla_wwaddw.o: cla_wwaddw.f ; $(FORTRAN) $(NOOPT) -c -o $@ $< --zla_wwaddw.o: zla_wwaddw.f ; $(FORTRAN) $(NOOPT) -c -o $@ $< -+slaruv.o: slaruv.f ; ${LIBTOOL} --mode=compile --tag=FC $(FC) $(NOOPT) -c -o $@ $< -+dlaruv.o: dlaruv.f ; ${LIBTOOL} --mode=compile --tag=FC $(FC) $(NOOPT) -c -o $@ $< -+sla_wwaddw.o: sla_wwaddw.f ; ${LIBTOOL} --mode=compile --tag=FC $(FC) $(NOOPT) -c -o $@ $< -+dla_wwaddw.o: dla_wwaddw.f ; ${LIBTOOL} --mode=compile --tag=FC $(FC) $(NOOPT) -c -o $@ $< -+cla_wwaddw.o: cla_wwaddw.f ; ${LIBTOOL} --mode=compile --tag=FC $(FC) $(NOOPT) -c -o $@ $< -+zla_wwaddw.o: zla_wwaddw.f ; ${LIBTOOL} --mode=compile --tag=FC $(FC) $(NOOPT) -c -o $@ $< diff --git a/math/lapack/patches/patch-ac b/math/lapack/patches/patch-ac deleted file mode 100644 index a0742e70aa4..00000000000 --- a/math/lapack/patches/patch-ac +++ /dev/null @@ -1,16 +0,0 @@ -$NetBSD: patch-ac,v 1.4 2014/02/28 09:39:56 adam Exp $ - ---- /dev/null 2007-11-22 18:29:57.000000000 +0100 -+++ make.inc -@@ -0,0 +1,11 @@ -+SHELL= /bin/sh -+PLAT= _${MACHINE} -+FORTRAN= ${FC} -+OPTS= ${FFLAGS} -+DRVOPTS= $(OPTS) -+NOOPT= ${FFLAGSNOOPT} -+LOADER= ${FC} -+LOADOPTS= ${LDFLAGS} -+LAPACKLIB= liblapack.la -+BLASLIB= ${PREFIX}/lib/libblas.la -+TMGLIB= libtmglib.la diff --git a/math/lapack/patches/patch-ad b/math/lapack/patches/patch-ad deleted file mode 100644 index e8a802eb52b..00000000000 --- a/math/lapack/patches/patch-ad +++ /dev/null @@ -1,17 +0,0 @@ -$NetBSD: patch-ad,v 1.6 2017/09/11 20:56:28 wiz Exp $ - -Use LIBTOOL. - ---- INSTALL/Makefile.orig 2017-06-17 22:46:53.000000000 +0000 -+++ INSTALL/Makefile -@@ -44,7 +44,7 @@ cleantest: - - .SUFFIXES: .o .f - .f.o: -- $(FORTRAN) $(OPTS) -c -o $@ $< -+ ${LIBTOOL} --mode=compile --tag=FC ${FC} ${FFLAGS} -c -o $@ $< - --slamch.o: slamch.f ; $(FORTRAN) $(NOOPT) -c -o $@ $< --dlamch.o: dlamch.f ; $(FORTRAN) $(NOOPT) -c -o $@ $< -+slamch.o: slamch.f ; ${LIBTOOL} --mode=compile --tag=FC $(FC) $(NOOPT) -c -o $@ $< -+dlamch.o: dlamch.f ; ${LIBTOOL} --mode=compile --tag=FC $(FC) $(NOOPT) -c -o $@ $< -- cgit v1.2.3