From 93ae8d8a0215ca2096d2029c54b8d67a9c557d7226042acd811ada9e3211548e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Sat, 10 Oct 2020 11:48:42 +0000 Subject: [PATCH 1/2] Accepting request 840472 from home:StefanBruens:branches:science - lapack-man: * Build manpages from same sources as the binaries (3.8.0) instead of old 3.5.0. * Merge blas-man package into lapack-man package. Avoids tedious splitting of the two. * Use fdupes macro instead of trying to deduplicate man pages manually. - Cleanup lapack spec: * Remove conditionals for obsolete distro versions * Only use python3-base instead of python3 * Drop old copy of lapack_testing.py as separate source OBS-URL: https://build.opensuse.org/request/show/840472 OBS-URL: https://build.opensuse.org/package/show/science/lapack?expand=0&rev=18 --- lapack-3.5.0.tgz | 3 - lapack-man.changes | 25 ++++ lapack-man.spec | 118 +++------------- lapack.changes | 15 +++ lapack.spec | 36 +---- lapack_testing.py | 326 --------------------------------------------- 6 files changed, 64 insertions(+), 459 deletions(-) delete mode 100644 lapack-3.5.0.tgz delete mode 100644 lapack_testing.py diff --git a/lapack-3.5.0.tgz b/lapack-3.5.0.tgz deleted file mode 100644 index 1ada2a0..0000000 --- a/lapack-3.5.0.tgz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e405fd54fb457f5a382511b79dff347a90870edbffe42602b8d9c25970bb4177 -size 6312876 diff --git a/lapack-man.changes b/lapack-man.changes index e6d043a..51b818f 100644 --- a/lapack-man.changes +++ b/lapack-man.changes @@ -1,3 +1,28 @@ +------------------------------------------------------------------- +Fri Oct 9 17:28:03 UTC 2020 - Stefan Brüns + +- lapack-man: + * Build manpages from same sources as the binaries (3.8.0) instead + of old 3.5.0. + * Merge blas-man package into lapack-man package. Avoids tedious + splitting of the two. + * Use fdupes macro instead of trying to deduplicate man pages + manually. +- Cleanup lapack spec: + * Remove conditionals for obsolete distro versions + * Only use python3-base instead of python3 + * Drop old copy of lapack_testing.py as separate source + +------------------------------------------------------------------- +Fri Mar 13 14:58:33 UTC 2020 - Martin Liška + +- Add -std=legacy in order to fix boo#1166619. + +------------------------------------------------------------------- +Fri Aug 2 07:03:54 UTC 2019 - Martin Liška + +- Use FAT LTO objects in order to provide proper static library. + ------------------------------------------------------------------- Thu Mar 29 13:11:32 UTC 2018 - badshah400@gmail.com diff --git a/lapack-man.spec b/lapack-man.spec index 90223ec..d6c82d1 100644 --- a/lapack-man.spec +++ b/lapack-man.spec @@ -18,125 +18,43 @@ Name: lapack-man %define _name lapack -Version: 3.5.0 +Version: 3.8.0 Release: 0 -Summary: Manpages for LAPACK +Summary: Manpages for LAPACK and BLAS License: BSD-3-Clause -Group: Documentation/HTML +Group: Documentation/Other URL: http://www.netlib.org/lapack/ -Source0: http://www.netlib.org/lapack/%{_name}-%{version}.tgz +Source0: http://www.netlib.org/lapack/%{_name}-%{version}.tar.gz BuildRequires: doxygen >= 1.7 -Provides: lapack-manpages = %{version} -Obsoletes: lapack-manpages < %{version} +BuildRequires: fdupes +# Merged blas-man into lapack-man with 3.8.0 update +Provides: blas-man = %{version} +Obsoletes: blas-man < %{version} BuildArch: noarch -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description -Manpages for LAPACK - -%package -n blas-man -Summary: Documentation for BLAS (Basic Linear Algebra Subprograms) -Group: Development/Libraries/Parallel -Provides: blasman = %{version} -Obsoletes: blasman < %{version} - -%description -n blas-man -The blas-man package contains documentation for BLAS (Basic Linear -Algebra subprograms) routines, in the form of man pages. +The lapack-man package contains documentation for LAPACK +(Linear Algebra PACKage) and BLAS (Basic Linear Algebra +Subprograms) routines, in the form of man pages. %prep %setup -q -n %{_name}-%{version} %build -%global _lto_cflags %{_lto_cflags} -ffat-lto-objects cp make.inc.example make.inc -# Create man pages - and do some cleanup make man %{?_smp_mflags} -rm -f DOCS/man/man3/*tst* -rm -f DOCS/man/man3/TST* -rm -f DOCS/man/man3/MYSUB.3 -rm -f DOCS/man/man3/INSTALL_lsame.f.3 -rm -f DOCS/man/man3/xerbla.f.3 -rm -f DOCS/man/man3/xerbla_array.f.3 -rm -f DOCS/man/man3/*_.3 -rm -f DOCS/man/man3/dsecnd_*.3 -rm -f DOCS/man/man3/DSECND.3 -rm -f DOCS/man/man3/second_*3 -rm -f DOCS/man/man3/SECOND.3 -rm -f DOCS/man/man3/LAPACK_version.f.3 -rm -f DOCS/man/man3/SRC_ilaver.f.3 -rm -f DOCS/man/man3/SRC_xerbla.f.3 -rm -f DOCS/man/man3/SRC_xerbla_array.f.3 -rm -f DOCS/man/man3/SLAMC2.3.gz -rm -f DOCS/man/man3/SLAMC3.3.gz -rm -f DOCS/man/man3/SLAMC4.3.gz -rm -f DOCS/man/man3/SLAMC5.3.gz -rm -f DOCS/man/man3/DLAMC2.3.gz -rm -f DOCS/man/man3/DLAMC3.3.gz -rm -f DOCS/man/man3/DLAMC4.3.gz -rm -f DOCS/man/man3/DLAMC5.3.gz -rm -f DOCS/man/man3/SLADIV1.3.gz -rm -f DOCS/man/man3/SLADIV2.3.gz -rm -f DOCS/man/man3/DLADIV1.3.gz -rm -f DOCS/man/man3/DLADIV2.3.gz -mv DOCS/man/man3/BLAS_SRC_lsame.f.3 DOCS/man/man3/lsame.f.3 -mv DOCS/man/man3/BLAS_SRC_xerbla.f.3 DOCS/man/man3/xerbla.f.3 -mv DOCS/man/man3/BLAS_SRC_xerbla_array.f.3 DOCS/man/man3/xerbla_array.f.3 -mv DOCS/man/man3/INSTALL_ilaver.f.3 DOCS/man/man3/ilaver.f.3 -rm -f DOCS/psfig.tex # see bnc#757332 + +# Remove some intermediate files +rm -f DOCS/man/man3/_*_.3 +rm -f DOCS/man/man3/{BLAS_,}SRC_xerbla{_array,}.f.3 %install install -d %{buildroot}%{_mandir}/man3 install -m 0644 DOCS/man/man3/*.3 %{buildroot}%{_mandir}/man3/ -find BLAS/SRC/ -name \*.f -type f -printf "%{_mandir}/man3/%f.3.gz\n" \ - > blasmans -find BLAS/SRC/ -name \*.f -type f -printf "%f\n" \ - | tr 'a-z' 'A-Z' |sed -e 's#\(.*\).F#'%{_mandir}/man3/'\1.3.gz#' \ - >> blasmans -find SRC/ -name \*.f -type f -printf "%{_mandir}/man3/%f.3.gz\n" \ - | grep -v -E 'lsame.f|sceil.f|xerbla.f|xerbla_array.f' \ - | sort -u > lapackmans -find SRC/ -name \*.f -type f -printf "%f\n" \ - | grep -v -E 'sceil.f|xerbla.f|xerbla_array.f' \ - | tr 'a-z' 'A-Z' |sed -e 's#\(.*\).F#'%{_mandir}/man3/'\1.3.gz#' \ - | sort -u >> lapackmans -echo %{_mandir}/man3/SLAMC1.3.gz >> lapackmans -echo %{_mandir}/man3/SLAMC2.3.gz >> lapackmans -echo %{_mandir}/man3/SLAMC3.3.gz >> lapackmans -echo %{_mandir}/man3/SLAMC4.3.gz >> lapackmans -echo %{_mandir}/man3/SLAMC5.3.gz >> lapackmans -echo %{_mandir}/man3/SLAMCH.3.gz >> lapackmans -echo %{_mandir}/man3/DLAMC1.3.gz >> lapackmans -echo %{_mandir}/man3/DLAMC2.3.gz >> lapackmans -echo %{_mandir}/man3/DLAMC3.3.gz >> lapackmans -echo %{_mandir}/man3/DLAMC4.3.gz >> lapackmans -echo %{_mandir}/man3/DLAMC5.3.gz >> lapackmans -echo %{_mandir}/man3/DLAMCH.3.gz >> lapackmans -echo %{_mandir}/man3/SLADIV1.3.gz >> lapackmans -echo %{_mandir}/man3/SLADIV2.3.gz >> lapackmans -echo %{_mandir}/man3/DLADIV1.3.gz >> lapackmans -echo %{_mandir}/man3/DLADIV2.3.gz >> lapackmans -echo %{_mandir}/man3/slamch.f.3.gz >> lapackmans -echo %{_mandir}/man3/slamchf77.f.3.gz >> lapackmans -echo %{_mandir}/man3/dlamch.f.3.gz >> lapackmans -echo %{_mandir}/man3/dlamchf77.f.3.gz >> lapackmans -ln -s SLAMC1.3.gz %{buildroot}/%{_mandir}/man3/SLAMC2.3.gz -ln -s SLAMC1.3.gz %{buildroot}/%{_mandir}/man3/SLAMC4.3.gz -ln -s SLAMC1.3.gz %{buildroot}/%{_mandir}/man3/SLAMC5.3.gz -ln -s SLAMCH.3.gz %{buildroot}/%{_mandir}/man3/SLAMC3.3.gz -ln -s DLAMC1.3.gz %{buildroot}/%{_mandir}/man3/DLAMC2.3.gz -ln -s DLAMC1.3.gz %{buildroot}/%{_mandir}/man3/DLAMC4.3.gz -ln -s DLAMC1.3.gz %{buildroot}/%{_mandir}/man3/DLAMC5.3.gz -ln -s DLAMCH.3.gz %{buildroot}/%{_mandir}/man3/DLAMC3.3.gz -ln -s SLADIV.3.gz %{buildroot}/%{_mandir}/man3/SLADIV1.3.gz -ln -s SLADIV.3.gz %{buildroot}/%{_mandir}/man3/SLADIV2.3.gz -ln -s DLADIV.3.gz %{buildroot}/%{_mandir}/man3/DLADIV1.3.gz -ln -s DLADIV.3.gz %{buildroot}/%{_mandir}/man3/DLADIV2.3.gz -%files -f lapackmans -%defattr(-,root,root) +%fdupes %{buildroot}/%{_mandir}/man3/ -%files -n blas-man -f blasmans -%defattr(-,root,root) +%files +%doc %{_mandir}/man3/ %changelog diff --git a/lapack.changes b/lapack.changes index ac918ad..51b818f 100644 --- a/lapack.changes +++ b/lapack.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Fri Oct 9 17:28:03 UTC 2020 - Stefan Brüns + +- lapack-man: + * Build manpages from same sources as the binaries (3.8.0) instead + of old 3.5.0. + * Merge blas-man package into lapack-man package. Avoids tedious + splitting of the two. + * Use fdupes macro instead of trying to deduplicate man pages + manually. +- Cleanup lapack spec: + * Remove conditionals for obsolete distro versions + * Only use python3-base instead of python3 + * Drop old copy of lapack_testing.py as separate source + ------------------------------------------------------------------- Fri Mar 13 14:58:33 UTC 2020 - Martin Liška diff --git a/lapack.spec b/lapack.spec index cb77a0c..b9cce9b 100644 --- a/lapack.spec +++ b/lapack.spec @@ -24,14 +24,12 @@ License: BSD-3-Clause Group: Development/Libraries/Parallel URL: http://www.netlib.org/lapack/ Source0: http://www.netlib.org/lapack/%{name}-%{version}.tar.gz -Source1: lapack_testing.py Source99: baselibs.conf Patch1: lapack-3.2.2.patch BuildRequires: gcc-fortran -BuildRequires: python3 +BuildRequires: python3-base BuildRequires: update-alternatives Requires(pre): update-alternatives -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description LAPACK provides routines for solving systems of simultaneous linear @@ -47,9 +45,7 @@ both single and double precision. %package -n liblapack3 Summary: LAPACK Shared Library Group: Development/Libraries/Parallel -%if 0%{?suse_version} >= 1120 Requires(pre): update-alternatives -%endif %description -n liblapack3 LAPACK provides routines for solving systems of simultaneous linear @@ -65,9 +61,7 @@ both single and double precision. %package -n libblas3 Summary: BLAS Shared Library Group: Development/Libraries/Parallel -%if 0%{?suse_version} >= 1120 Requires(pre): update-alternatives -%endif %description -n libblas3 BLAS (Basic Linear Algebra Subprograms) is a standard library for @@ -173,6 +167,8 @@ LAPACKE development files - static libraries. %prep %setup -q %patch1 +sed -i -e '1 s@env python@python3@' lapack_testing.py +head lapack_testing.py %build %global _lto_cflags %{_lto_cflags} -ffat-lto-objects @@ -238,10 +234,8 @@ make cleanlib %{?_smp_mflags} make %{?_smp_mflags} lapacke \ CFLAGS="%{optflags} -DADD_ -DHAVE_LAPACK_CONFIG_H -DLAPACK_COMPLEX_STRUCTURE" mv ../liblapacke.a liblapacke.a -# fix wrong end of line -sed -i 's/\r//' LICENSE cd .. -cp %{SOURCE1} . + make lapack_testing \ OPTS="%{optflags} $PRECFLAGS" \ NOOPT="%{optflags} $PRECFLAGS -O0" @@ -328,64 +322,46 @@ fi %postun -n liblapacke3 -p /sbin/ldconfig %files -n liblapack3 -%defattr(-,root,root) %doc README.md %license LICENSE %dir %{_libdir}/lapack %{_libdir}/lapack/liblapack.so.%{version} %{_libdir}/lapack/liblapack.so.3 -%if 0%{?suse_version} >= 1120 %ghost %{_libdir}/liblapack.so.3 %ghost %{_sysconfdir}/alternatives/liblapack.so.3 -%else -%{_libdir}/liblapack.so.3 -%{_sysconfdir}/alternatives/liblapack.so.3 -%endif %files -n libblas3 -%defattr(-,root,root) %doc README.md %license LICENSE %dir %{_libdir}/blas %{_libdir}/blas/libblas.so.%{version} %{_libdir}/blas/libblas.so.3 -%if 0%{?suse_version} >= 1120 %ghost %{_libdir}/libblas.so.3 %ghost %{_sysconfdir}/alternatives/libblas.so.3 -%else -%{_libdir}/libblas.so.3 -%{_sysconfdir}/alternatives/libblas.so.3 -%endif %files devel -%defattr(-,root,root) %{_libdir}/liblapack.so %files devel-static -%defattr(-,root,root) %{_libdir}/liblapack.a %files -n blas-devel -%defattr(-,root,root) %{_libdir}/libblas.so %files -n blas-devel-static -%defattr(-,root,root) %{_libdir}/libblas.a %files -n liblapacke3 -%defattr(-,root,root,-) %{_libdir}/liblapacke.so.%{version} %{_libdir}/liblapacke.so.3 %files -n lapacke-devel -%defattr(-,root,root,-) -%doc LAPACKE/LICENSE LAPACKE/README +%doc LAPACKE/README +%license LAPACKE/LICENSE %{_libdir}/liblapacke.so %{_includedir}/*.h %files -n lapacke-devel-static -%defattr(-,root,root,-) %{_libdir}/liblapacke.a %changelog diff --git a/lapack_testing.py b/lapack_testing.py deleted file mode 100644 index 6eb0eb7..0000000 --- a/lapack_testing.py +++ /dev/null @@ -1,326 +0,0 @@ -#!/usr/bin/python3 -# -*- coding: utf-8 -*- - - -############################################################################### -# lapack_testing.py -############################################################################### - -from __future__ import print_function -from subprocess import Popen, STDOUT, PIPE -import os, sys, math -import getopt -# Arguments -try: - opts, args = getopt.getopt(sys.argv[1:], "hd:srep:t:n", - ["help", "dir", "short", "run", "error","prec=","test=","number"]) - -except getopt.error as msg: - print(msg) - print("for help use --help") - sys.exit(2) - -short_summary=0 -with_file=1 -just_errors = 0 -prec='x' -test='all' -only_numbers=0 -test_dir='TESTING' -bin_dir='bin/Release' - -abs_bin_dir=os.path.normpath(os.path.join(os.getcwd(),bin_dir)) - -for o, a in opts: - if o in ("-h", "--help"): - print(sys.argv[0]+" [-h|--help] [-d dir |--dir dir] [-s |--short] [-r |--run] [-e |--error] [-p p |--prec p] [-t test |--test test] [-n | --number]") - print(" - h is to print this message") - print(" - r is to use to run the LAPACK tests then analyse the output (.out files). By default, the script will not run all the LAPACK tests") - print(" - d [dir] is to indicate where is the LAPACK testing directory (.out files). By default, the script will use .") - print(" LEVEL OF OUTPUT") - print(" - x is to print a detailed summary") - print(" - e is to print only the error summary") - print(" - s is to print a short summary") - print(" - n is to print the numbers of failing tests (turn on summary mode)") - print(" SECLECTION OF TESTS:") - print(" - p [s/c/d/z/x] is to indicate the PRECISION to run:") - print(" s=single") - print(" d=double") - print(" sd=single/double") - print(" c=complex") - print(" z=double complex") - print(" cz=complex/double complex") - print(" x=all [DEFAULT]") - print(" - t [lin/eig/mixed/rfp/all] is to indicate which TEST FAMILY to run:") - print(" lin=Linear Equation") - print(" eig=Eigen Problems") - print(" mixed=mixed-precision") - print(" rfp=rfp format") - print(" all=all tests [DEFAULT]") - print(" EXAMPLES:") - print(" ./lapack_testing.py -n") - print(" Will return the numbers of failed tests by analyzing the LAPACK output") - print(" ./lapack_testing.py -n -r -p s") - print(" Will return the numbers of failed tests in REAL precision by running the LAPACK Tests then analyzing the output") - print(" ./lapack_testing.py -n -p s -t eig ") - print(" Will return the numbers of failed tests in REAL precision by analyzing only the LAPACK output of EIGEN testings") - print("Written by Julie Langou (June 2011) ") - sys.exit(0) - else: - if o in ("-s", "--short"): - short_summary = 1 - if o in ("-r", "--run"): - with_file = 0 - if o in ("-e", "--error"): - just_errors = 1 - if o in ( '-p', '--prec' ): - prec = a - if o in ( '-d', '--dir' ): - test_dir = a - if o in ( '-t', '--test' ): - test = a - if o in ( '-n', '--number' ): - only_numbers = 1 - short_summary = 1 - -# process options - -os.chdir(test_dir) - -execution=1 -summary="\n\t\t\t--> LAPACK TESTING SUMMARY <--\n"; -if with_file: summary+= "\t\tProcessing LAPACK Testing output found in the "+test_dir+" directory\n"; -summary+="SUMMARY \tnb test run \tnumerical error \tother error \n"; -summary+="================ \t===========\t=================\t================ \n"; -nb_of_test=0 - -# Add current directory to the path for subshells of this shell -# Allows the popen to find local files in both windows and unixes -os.environ["PATH"] = os.environ["PATH"]+":." - -# Define a function to open the executable (different filenames on unix and Windows) -def run_summary_test( f, cmdline, short_summary): - nb_test_run=0 - nb_test_fail=0 - nb_test_illegal=0 - nb_test_info=0 - - if (with_file): - if not os.path.exists(cmdline): - error_message=cmdline+" file not found" - r=1 - if short_summary: return [nb_test_run,nb_test_fail,nb_test_illegal,nb_test_info] - else: - pipe = open(cmdline,'r') - r=0 - else: - if os.name != 'nt': - cmdline='./' + cmdline - else : - cmdline=abs_bin_dir+os.path.sep+cmdline - - outfile=cmdline.split()[4] - #pipe = open(outfile,'w') - p = Popen(cmdline, shell=True)#, stdout=pipe) - p.wait() - #pipe.close() - r=p.returncode - pipe = open(outfile,'r') - error_message=cmdline+" did not work" - - if r != 0 and not with_file: - print("---- TESTING " + cmdline.split()[0] + "... FAILED(" + error_message +") !") - for line in pipe.readlines(): - f.write(str(line)) - elif r != 0 and with_file and not short_summary: - print("---- WARNING: please check that you have the LAPACK output : "+cmdline+"!") - print("---- WARNING: with the option -r, we can run the LAPACK testing for you") - # print "---- "+error_message - else: - for line in pipe.readlines(): - f.write(str(line)) - words_in_line=line.split() - if (line.find("run")!=-1): -# print line - whereisrun=words_in_line.index("run)") - nb_test_run+=int(words_in_line[whereisrun-2]) - if (line.find("out of")!=-1): - if (short_summary==0): print(line, end=' ') - whereisout= words_in_line.index("out") - nb_test_fail+=int(words_in_line[whereisout-1]) - if ((line.find("illegal")!=-1) or (line.find("Illegal")!=-1)): - if (short_summary==0):print(line, end=' ') - nb_test_illegal+=1 - if (line.find(" INFO")!=-1): - if (short_summary==0):print(line, end=' ') - nb_test_info+=1 - if (with_file==1): - pipe.close() - - f.flush(); - - return [nb_test_run,nb_test_fail,nb_test_illegal,nb_test_info] - - -# If filename cannot be opened, send output to sys.stderr -filename = "testing_results.txt" -try: - f = open(filename, 'w') -except IOError: - f = sys.stdout - -if (short_summary==0): - print(" ") - print("---------------- Testing LAPACK Routines ----------------") - print(" ") - print("-- Detailed results are stored in", filename) - -dtypes = ( -("s", "d", "c", "z"), -("REAL ", "DOUBLE PRECISION", "COMPLEX ", "COMPLEX16 "), -) - -if prec=='s': - range_prec=[0] -elif prec=='d': - range_prec=[1] -elif prec=='sd': - range_prec=[0,1] -elif prec=='c': - range_prec=[2] -elif prec=='z': - range_prec=[3] -elif prec=='cz': - range_prec=[2,3] -else: - prec='x'; - range_prec=list(range(4)) - -if test=='lin': - range_test=[16] -elif test=='mixed': - range_test=[17] - range_prec=[1,3] -elif test=='rfp': - range_test=[18] -elif test=='eig': - range_test=list(range(16)) -else: - range_test=list(range(19)) - -list_results = [ -[0, 0, 0, 0, 0], -[0, 0, 0, 0, 0], -[0, 0, 0, 0, 0], -[0, 0, 0, 0, 0], -] - -for dtype in range_prec: - letter = dtypes[0][dtype] - name = dtypes[1][dtype] - - if (short_summary==0): - print(" ") - print("------------------------- %s ------------------------" % name) - print(" ") - sys.stdout.flush() - - dtests = ( - ("nep", "sep", "se2", "svd", - letter+"ec",letter+"ed",letter+"gg", - letter+"gd",letter+"sb",letter+"sg", - letter+"bb","glm","gqr", - "gsv","csd","lse", - letter+"test", letter+dtypes[0][dtype-1]+"test",letter+"test_rfp"), - ("Nonsymmetric-Eigenvalue-Problem", "Symmetric-Eigenvalue-Problem", "Symmetric-Eigenvalue-Problem-2-stage", "Singular-Value-Decomposition", - "Eigen-Condition","Nonsymmetric-Eigenvalue","Nonsymmetric-Generalized-Eigenvalue-Problem", - "Nonsymmetric-Generalized-Eigenvalue-Problem-driver", "Symmetric-Eigenvalue-Problem", "Symmetric-Eigenvalue-Generalized-Problem", - "Banded-Singular-Value-Decomposition-routines", "Generalized-Linear-Regression-Model-routines", "Generalized-QR-and-RQ-factorization-routines", - "Generalized-Singular-Value-Decomposition-routines", "CS-Decomposition-routines", "Constrained-Linear-Least-Squares-routines", - "Linear-Equation-routines", "Mixed-Precision-linear-equation-routines","RFP-linear-equation-routines"), - (letter+"nep", letter+"sep", letter+"se2", letter+"svd", - letter+"ec",letter+"ed",letter+"gg", - letter+"gd",letter+"sb",letter+"sg", - letter+"bb",letter+"glm",letter+"gqr", - letter+"gsv",letter+"csd",letter+"lse", - letter+"test", letter+dtypes[0][dtype-1]+"test",letter+"test_rfp"), - ) - - - for dtest in range_test: - nb_of_test=0 - # NEED TO SKIP SOME PRECISION (namely s and c) FOR PROTO MIXED PRECISION TESTING - if dtest==17 and (letter=="s" or letter=="c"): - continue - if (with_file==1): - cmdbase=dtests[2][dtest]+".out" - else: - if dtest==16: - # LIN TESTS - cmdbase="xlintst"+letter+" < "+dtests[0][dtest]+".in > "+dtests[2][dtest]+".out" - elif dtest==17: - # PROTO LIN TESTS - cmdbase="xlintst"+letter+dtypes[0][dtype-1]+" < "+dtests[0][dtest]+".in > "+dtests[2][dtest]+".out" - elif dtest==18: - # PROTO LIN TESTS - cmdbase="xlintstrf"+letter+" < "+dtests[0][dtest]+".in > "+dtests[2][dtest]+".out" - else: - # EIG TESTS - cmdbase="xeigtst"+letter+" < "+dtests[0][dtest]+".in > "+dtests[2][dtest]+".out" - if (not just_errors and not short_summary): - print("Testing "+name+" "+dtests[1][dtest]+"-"+cmdbase, end=' ') - # Run the process: either to read the file or run the LAPACK testing - nb_test = run_summary_test(f, cmdbase, short_summary) - list_results[0][dtype]+=nb_test[0] - list_results[1][dtype]+=nb_test[1] - list_results[2][dtype]+=nb_test[2] - list_results[3][dtype]+=nb_test[3] - got_error=nb_test[1]+nb_test[2]+nb_test[3] - - if (not short_summary): - if (nb_test[0]>0 and just_errors==0): - print("passed: "+str(nb_test[0])) - if (nb_test[1]>0): - print("failing to pass the threshold: "+str(nb_test[1])) - if (nb_test[2]>0): - print("Illegal Error: "+str(nb_test[2])) - if (nb_test[3]>0): - print("Info Error: "+str(nb_test[3])) - if (got_error>0 and just_errors==1): - print("ERROR IS LOCATED IN "+name+" "+dtests[1][dtest]+" [ "+cmdbase+" ]") - print("") - if (just_errors==0): - print("") -# elif (got_error>0): -# print dtests[2][dtest]+".out \t"+str(nb_test[1])+"\t"+str(nb_test[2])+"\t"+str(nb_test[3]) - - sys.stdout.flush() - if (list_results[0][dtype] > 0 ): - percent_num_error=float(list_results[1][dtype])/float(list_results[0][dtype])*100 - percent_error=float(list_results[2][dtype]+list_results[3][dtype])/float(list_results[0][dtype])*100 - else: - percent_num_error=0 - percent_error=0 - summary+=name+"\t"+str(list_results[0][dtype])+"\t\t"+str(list_results[1][dtype])+"\t("+"%.3f" % percent_num_error+"%)\t"+str(list_results[2][dtype]+list_results[3][dtype])+"\t("+"%.3f" % percent_error+"%)\t""\n" - list_results[0][4]+=list_results[0][dtype] - list_results[1][4]+=list_results[1][dtype] - list_results[2][4]+=list_results[2][dtype] - list_results[3][4]+=list_results[3][dtype] - -if only_numbers==1: - print(str(list_results[1][4])+"\n"+str(list_results[2][4]+list_results[3][4])) -else: - print(summary) - if (list_results[0][4] > 0 ): - percent_num_error=float(list_results[1][4])/float(list_results[0][4])*100 - percent_error=float(list_results[2][4]+list_results[3][4])/float(list_results[0][4])*100 - else: - percent_num_error=0 - percent_error=0 - if (prec=='x'): - print("--> ALL PRECISIONS\t"+str(list_results[0][4])+"\t\t"+str(list_results[1][4])+"\t("+"%.3f" % percent_num_error+"%)\t"+str(list_results[2][4]+list_results[3][4])+"\t("+"%.3f" % percent_error+"%)\t""\n") - if list_results[0][4] == 0: - print("NO TESTS WERE ANALYZED, please use the -r option to run the LAPACK TESTING") - -# This may close the sys.stdout stream, so make it the last statement -f.close() From 494dbe8a0f8a8a48e16e909bea2954e2c056dfc3d9718f17704faa56b76bd180 Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Sun, 11 Oct 2020 14:18:15 +0000 Subject: [PATCH 2/2] Accepting request 840488 from home:StefanBruens:branches:home:StefanBruens:branches:science - Build CBLAS from lapack package * update baselibs.conf - Clean up spec file: * remove useless make cleanlib * remove ineffective duplicated 'make ..lib' calls with deviating opts, as the object files are not removed (fortuanately) the existing PIC files are used for the static libraries * remove fortran-only -std=legacy opt from CFLAGS OBS-URL: https://build.opensuse.org/request/show/840488 OBS-URL: https://build.opensuse.org/package/show/science/lapack?expand=0&rev=19 --- baselibs.conf | 4 ++ lapack-man.changes | 12 ++++ lapack.changes | 12 ++++ lapack.spec | 155 ++++++++++++++++++++++++++++++++------------- 4 files changed, 140 insertions(+), 43 deletions(-) diff --git a/baselibs.conf b/baselibs.conf index ee59c1b..18d7048 100644 --- a/baselibs.conf +++ b/baselibs.conf @@ -1,5 +1,6 @@ liblapack3 libblas3 +libcblas3 liblapacke3 lapack-devel requires -lapack- @@ -7,6 +8,9 @@ lapack-devel blas-devel requires -blas- requires "libblas3- = " +cblas-devel + requires -cblas- + requires "libcblas3- = " lapacke-devel requires -lapacke- requires "liblapacke3- = " diff --git a/lapack-man.changes b/lapack-man.changes index 51b818f..8e27b46 100644 --- a/lapack-man.changes +++ b/lapack-man.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Fri Oct 9 21:00:30 UTC 2020 - Stefan Brüns + +- Build CBLAS from lapack package + * update baselibs.conf +- Clean up spec file: + * remove useless make cleanlib + * remove ineffective duplicated 'make ..lib' calls with deviating + opts, as the object files are not removed (fortuanately) the + existing PIC files are used for the static libraries + * remove fortran-only -std=legacy opt from CFLAGS + ------------------------------------------------------------------- Fri Oct 9 17:28:03 UTC 2020 - Stefan Brüns diff --git a/lapack.changes b/lapack.changes index 51b818f..8e27b46 100644 --- a/lapack.changes +++ b/lapack.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Fri Oct 9 21:00:30 UTC 2020 - Stefan Brüns + +- Build CBLAS from lapack package + * update baselibs.conf +- Clean up spec file: + * remove useless make cleanlib + * remove ineffective duplicated 'make ..lib' calls with deviating + opts, as the object files are not removed (fortuanately) the + existing PIC files are used for the static libraries + * remove fortran-only -std=legacy opt from CFLAGS + ------------------------------------------------------------------- Fri Oct 9 17:28:03 UTC 2020 - Stefan Brüns diff --git a/lapack.spec b/lapack.spec index b9cce9b..4caccce 100644 --- a/lapack.spec +++ b/lapack.spec @@ -151,106 +151,131 @@ Summary: LAPACKE development files Group: Development/Libraries/C and C++ Requires: liblapacke3 = %{version} Provides: lapacke = %{version} -Provides: lapacke-devel-static = %{version} %description -n lapacke-devel LAPACKE headers and development files. %package -n lapacke-devel-static -Summary: LAPACKE development files - static libraries +Summary: LAPACKE static libraries Group: Development/Libraries/C and C++ Requires: lapacke-devel = %{version} %description -n lapacke-devel-static -LAPACKE development files - static libraries. +LAPACKE development files - static libraries. + +%package -n libcblas3 +Summary: CBLAS Shared Library +Group: Development/Libraries/C and C++ +Requires(pre): update-alternatives +# Only version ever packaged separately +Obsoletes: libcblas3 == 20110120 + +%description -n libcblas3 +This library provides a native C interface to BLAS routines available +at www.netlib.org/blas to facilitate usage of BLAS functionality +for C programmers. + +%package -n cblas-devel +Summary: CBLAS development files +Group: Development/Libraries/C and C++ +Requires: libcblas3 = %{version} +Provides: cblas = %{version} + +%description -n cblas-devel +cblas headers and development files. + +%package -n cblas-devel-static +Summary: CBLAS - static libraries +Group: Development/Libraries/C and C++ +Requires: cblas-devel = %{version} + +%description -n cblas-devel-static +The cblas-devel-static package contains the CBLAS static libraries +for -static linking. You do not need these, unless you link +statically, which is highly discouraged. + %prep %setup -q %patch1 sed -i -e '1 s@env python@python3@' lapack_testing.py -head lapack_testing.py %build %global _lto_cflags %{_lto_cflags} -ffat-lto-objects -%global optflags %{optflags} -std=legacy +%global optflags_f %{optflags} -std=legacy case "$RPM_ARCH" in i[0-9]86) PRECFLAGS="-ffloat-store" ;; *) PRECFLAGS="" ;; esac export PRECFLAGS cp make.inc.example make.inc + make cleanlib %{?_smp_mflags} make %{?_smp_mflags} blaslib \ - OPTS="%{optflags} -fPIC" \ - NOOPT="%{optflags} -O0 -fPIC" -mv librefblas.a libblas_pic.a + OPTS="%{optflags_f} -fPIC" \ + NOOPT="%{optflags_f} -O0 -fPIC" mkdir tmp -( cd tmp; ar x ../libblas_pic.a ) +( cd tmp; ar x ../librefblas.a ) gfortran -shared -Wl,-soname=libblas.so.3 -o libblas.so.%{version} tmp/*.o ln -s libblas.so.%{version} libblas.so rm -rf tmp -make cleanlib %{?_smp_mflags} -make %{?_smp_mflags} blaslib \ - OPTS="%{optflags}" \ - NOOPT="%{optflags} -O0" + make blas_testing \ - OPTS="%{optflags} $PRECFLAGS" \ - NOOPT="%{optflags} $PRECFLAGS -O0" + OPTS="%{optflags_f} $PRECFLAGS" \ + NOOPT="%{optflags_f} $PRECFLAGS -O0" if grep -B15 -A15 FAIL BLAS/*.out; then echo echo "blas_testing FAILED" - echo false -else - true # No failures fi mv librefblas.a libblas.a -make cleanlib %{?_smp_mflags} -make %{?_smp_mflags} lapacklib \ - OPTS="%{optflags} -fPIC" \ - NOOPT="%{optflags} -O0 -fPIC" -mv liblapack.a liblapack_pic.a + +make %{?_smp_mflags} cblaslib \ + CFLAGS="%{optflags} -fPIC -DADD_ " \ + LINKER=gfortran mkdir tmp -( cd tmp; ar x ../liblapack_pic.a ) +( cd tmp; ar x ../libcblas.a ) +gfortran -shared -Wl,-soname=libcblas.so.3 -o libcblas.so.%{version} tmp/*.o -L. -lblas +ln -s libcblas.so.%{version} libcblas.so +rm -rf tmp +make %{?_smp_mflags} cblas_testing \ + CFLAGS="%{optflags} -fPIC" \ + LINKER=gfortran +grep -B15 -A15 FAIL TESTING/*.out && false + +make %{?_smp_mflags} lapacklib \ + OPTS="%{optflags_f} -fPIC" \ + NOOPT="%{optflags_f} -O0 -fPIC" +mkdir tmp +( cd tmp; ar x ../liblapack.a ) gfortran -shared -Wl,-soname=liblapack.so.3 -o liblapack.so.%{version} tmp/*.o -L. -lblas ln -s liblapack.so.%{version} liblapack.so rm -rf tmp -make cleanlib %{?_smp_mflags} -make %{?_smp_mflags} lapacklib \ - OPTS="%{optflags}" \ - NOOPT="%{optflags} -O0" -ln -s libblas.a librefblas.a + cd LAPACKE make %{?_smp_mflags} lapacke \ CFLAGS="%{optflags} -fPIC -DADD_ -DHAVE_LAPACK_CONFIG_H -DLAPACK_COMPLEX_STRUCTURE" \ LINKER=gfortran -mv ../liblapacke.a liblapacke_pic.a mkdir tmp -( cd tmp; ar x ../liblapacke_pic.a ) +( cd tmp; ar x ../../liblapacke.a ) gfortran -shared -Wl,-soname=liblapacke.so.3 -o liblapacke.so.%{version} tmp/*.o ln -s liblapacke.so.%{version} liblapacke.so rm -rf tmp -make cleanlib %{?_smp_mflags} -make %{?_smp_mflags} lapacke \ - CFLAGS="%{optflags} -DADD_ -DHAVE_LAPACK_CONFIG_H -DLAPACK_COMPLEX_STRUCTURE" -mv ../liblapacke.a liblapacke.a cd .. make lapack_testing \ - OPTS="%{optflags} $PRECFLAGS" \ - NOOPT="%{optflags} $PRECFLAGS -O0" + OPTS="%{optflags_f} $PRECFLAGS" \ + NOOPT="%{optflags_f} $PRECFLAGS -O0" if grep -B15 -A15 FAIL TESTING/*.out; then echo echo "lapack_testing FAILED" - echo false -else - true # No failures fi %install install -d %{buildroot}/%{_libdir} install -d %{buildroot}/%{_sysconfdir}/alternatives +install -d %{buildroot}/%{_includedir} ## BLAS install -d %{buildroot}/%{_libdir}/blas install -m 644 libblas.a %{buildroot}/%{_libdir} @@ -260,6 +285,15 @@ ln -s blas/libblas.so.%{version} %{buildroot}/%{_libdir}/libblas.so # dummy target for update-alternatives ln -s blas/libblas.so.%{version} %{buildroot}/%{_libdir}/libblas.so.3 ln -s libblas.so.%{version} %{buildroot}/%{_sysconfdir}/alternatives/libblas.so.3 +## CBLAS +install -m 644 CBLAS/include/*.h %{buildroot}/%{_includedir} +install -m 644 libcblas.a %{buildroot}/%{_libdir} +install -m 755 libcblas.so.%{version} %{buildroot}/%{_libdir}/blas +ln -s libcblas.so.%{version} %{buildroot}/%{_libdir}/blas/libcblas.so.3 +ln -s blas/libcblas.so.%{version} %{buildroot}/%{_libdir}/libcblas.so +# dummy target for update-alternatives +ln -s blas/libcblas.so.%{version} %{buildroot}/%{_libdir}/libcblas.so.3 +ln -s libcblas.so.%{version} %{buildroot}/%{_sysconfdir}/alternatives/libcblas.so.3 ## LAPACK install -d %{buildroot}/%{_libdir}/lapack install -m 644 liblapack.a %{buildroot}/%{_libdir} @@ -270,10 +304,9 @@ ln -s lapack/liblapack.so.%{version} %{buildroot}/%{_libdir}/liblapack.so ln -s lapack/liblapack.so.%{version} %{buildroot}/%{_libdir}/liblapack.so.3 ln -s liblapack.so.%{version} %{buildroot}/%{_sysconfdir}/alternatives/liblapack.so.3 ## LAPACKE -install -d %{buildroot}/%{_includedir} cd LAPACKE install -m 644 include/*.h %{buildroot}/%{_includedir} -install -m 644 liblapacke.a %{buildroot}/%{_libdir} +install -m 644 ../liblapacke.a %{buildroot}/%{_libdir} install -m 755 liblapacke.so.%{version} %{buildroot}/%{_libdir} ln -s liblapacke.so.%{version} %{buildroot}/%{_libdir}/liblapacke.so.3 ln -s liblapacke.so.%{version} %{buildroot}/%{_libdir}/liblapacke.so @@ -317,6 +350,25 @@ if [ "$1" = 0 ] ; then fi fi +%post -n libcblas3 +%{_sbindir}/update-alternatives --install \ + %{_libdir}/libcblas.so.3 libcblas.so.3 %{_libdir}/blas/libcblas.so.3 50 +/sbin/ldconfig + +%preun -n libcblas3 +if [ "$1" = 0 ] ; then + %{_sbindir}/update-alternatives --remove libcblas.so.3 %{_libdir}/blas/libcblas.so.3 +fi + +%postun -n libcblas3 -p /sbin/ldconfig + +%posttrans -n libcblas3 +if [ "$1" = 0 ] ; then + if ! [ -f %{_libdir}/libcblas.so.3 ] ; then + "%{_sbindir}/update-alternatives" --auto libcblas.so.3 + fi +fi + %post -n liblapacke3 -p /sbin/ldconfig %postun -n liblapacke3 -p /sbin/ldconfig @@ -359,9 +411,26 @@ fi %doc LAPACKE/README %license LAPACKE/LICENSE %{_libdir}/liblapacke.so -%{_includedir}/*.h +%{_includedir}/lapack*.h %files -n lapacke-devel-static %{_libdir}/liblapacke.a +%files -n libcblas3 +%doc README.md +%license LICENSE +%dir %{_libdir}/blas +%{_libdir}/blas/libcblas.so.%{version} +%{_libdir}/blas/libcblas.so.3 +%ghost %{_libdir}/libcblas.so.3 +%ghost %{_sysconfdir}/alternatives/libcblas.so.3 + +%files -n cblas-devel +%doc CBLAS/README +%{_libdir}/libcblas.so +%{_includedir}/cblas*.h + +%files -n cblas-devel-static +%{_libdir}/libcblas.a + %changelog