diff options
Diffstat (limited to 'sci-libs/openblas')
-rw-r--r-- | sci-libs/openblas/Manifest | 4 | ||||
-rw-r--r-- | sci-libs/openblas/files/shared-blas-lapack.patch | 137 | ||||
-rw-r--r-- | sci-libs/openblas/metadata.xml | 20 | ||||
-rw-r--r-- | sci-libs/openblas/openblas-0.3.5.ebuild | 85 |
4 files changed, 246 insertions, 0 deletions
diff --git a/sci-libs/openblas/Manifest b/sci-libs/openblas/Manifest new file mode 100644 index 000000000000..60afd58b0e5c --- /dev/null +++ b/sci-libs/openblas/Manifest @@ -0,0 +1,4 @@ +AUX shared-blas-lapack.patch 5557 BLAKE2B 1e41b18e5a9c12eec9283c835e9b09e4ca89c6512f47a2f158f29c8a8a822d0365ad350177e379bec13f7c7574d8debd55a2f612027ff661c67ac7b226bb2370 SHA512 baa23f0c2bc8b7bc3384d7b8fa20eb5e095f20e1d8859badb55e680ccd435a851da6099b20aa203e46d62096ac93663ea130bea04dabf19432522e53139d393b +DIST openblas-0.3.5.tar.gz 11853101 BLAKE2B a9b249bc397fcb1d80401d1c60c6985803016e4fd0908649fe6386ae84a09a53569814b3af65fd8fbfa92f2cdd5d4af313ba91a80f7daa7e481a7941cbb9af2c SHA512 15520c3eca79b002f1afbee64257afa24705dec667a89bd46acfcdae426e29342816fb586db98ff256fcc9d0fd744b14b347fed23995958e7646a5e3e7310cf4 +EBUILD openblas-0.3.5.ebuild 2274 BLAKE2B 1b0468795ff2370cc02cc9bded43bf92330aa34567fea3f471adc5c5c8730e5f4f9598f534a0bab23fdfbf954473bfc06af2a3ac97d8d15b0ec2e59089665d4f SHA512 f2c9b8db2da57f3c812f2cc7c9551d53f013c8994a5e928d3e0bf266f581e808e8440c759abf588a7274670c1866e400051f094a7c8f34e75d2d12a29428ff12 +MISC metadata.xml 771 BLAKE2B 0b6c057240716a43a471c04d82eaf6f94b17564187fba71e208358038b6c25383f8ea5ab489c613ee0e9291e0cdb82e665dda05410fadab2f4267a0ff77d7757 SHA512 53db10778178c4bd8ea7eaf30e72e55f1dd0e77f8b01788df14b32980b9be6a69b23635415454cc0cee10efdf63d207319c90f3d3ca24a93414cc2757de02e3a diff --git a/sci-libs/openblas/files/shared-blas-lapack.patch b/sci-libs/openblas/files/shared-blas-lapack.patch new file mode 100644 index 000000000000..fc77427362c1 --- /dev/null +++ b/sci-libs/openblas/files/shared-blas-lapack.patch @@ -0,0 +1,137 @@ +diff --git a/sci-libs/openblas/files/Makefile b/sci-libs/openblas/files/Makefile +index 20ec74e..87e842f 100644 +--- a/interface/Makefile ++++ b/interface/Makefile +@@ -2151,3 +2151,132 @@ cblas_zgeadd.$(SUFFIX) cblas_zgeadd.$(PSUFFIX) : zgeadd.c + + cblas_xerbla.$(SUFFIX) cblas_xerbla.$(PSUFFIX) : xerbla.c + $(CC) -c $(CFLAGS) -DCBLAS $< -o $(@F) ++ ++############################################################################# ++# Customized shared objects ++ ++FSBLAS1OBJS = \ ++ saxpy.$(SUFFIX) sswap.$(SUFFIX) \ ++ scopy.$(SUFFIX) sscal.$(SUFFIX) \ ++ sdot.$(SUFFIX) sdsdot.$(SUFFIX) dsdot.$(SUFFIX) \ ++ sasum.$(SUFFIX) snrm2.$(SUFFIX) \ ++ smax.$(SUFFIX) samax.$(SUFFIX) ismax.$(SUFFIX) isamax.$(SUFFIX) \ ++ smin.$(SUFFIX) samin.$(SUFFIX) ismin.$(SUFFIX) isamin.$(SUFFIX) \ ++ srot.$(SUFFIX) srotg.$(SUFFIX) srotm.$(SUFFIX) srotmg.$(SUFFIX) \ ++ saxpby.$(SUFFIX) ++ ++FSBLAS2OBJS = \ ++ sgemv.$(SUFFIX) sger.$(SUFFIX) \ ++ strsv.$(SUFFIX) strmv.$(SUFFIX) ssymv.$(SUFFIX) \ ++ ssyr.$(SUFFIX) ssyr2.$(SUFFIX) sgbmv.$(SUFFIX) \ ++ ssbmv.$(SUFFIX) sspmv.$(SUFFIX) \ ++ sspr.$(SUFFIX) sspr2.$(SUFFIX) \ ++ stbsv.$(SUFFIX) stbmv.$(SUFFIX) \ ++ stpsv.$(SUFFIX) stpmv.$(SUFFIX) ++ ++FSBLAS3OBJS = \ ++ sgemm.$(SUFFIX) ssymm.$(SUFFIX) strmm.$(SUFFIX) \ ++ strsm.$(SUFFIX) ssyrk.$(SUFFIX) ssyr2k.$(SUFFIX) \ ++ somatcopy.$(SUFFIX) simatcopy.$(SUFFIX)\ ++ sgeadd.$(SUFFIX) ++ ++ ++FDBLAS1OBJS = \ ++ daxpy.$(SUFFIX) dswap.$(SUFFIX) \ ++ dcopy.$(SUFFIX) dscal.$(SUFFIX) \ ++ ddot.$(SUFFIX) \ ++ dasum.$(SUFFIX) dnrm2.$(SUFFIX) \ ++ dmax.$(SUFFIX) damax.$(SUFFIX) idmax.$(SUFFIX) idamax.$(SUFFIX) \ ++ dmin.$(SUFFIX) damin.$(SUFFIX) idmin.$(SUFFIX) idamin.$(SUFFIX) \ ++ drot.$(SUFFIX) drotg.$(SUFFIX) drotm.$(SUFFIX) drotmg.$(SUFFIX) \ ++ daxpby.$(SUFFIX) ++ ++FDBLAS2OBJS = \ ++ dgemv.$(SUFFIX) dger.$(SUFFIX) \ ++ dtrsv.$(SUFFIX) dtrmv.$(SUFFIX) dsymv.$(SUFFIX) \ ++ dsyr.$(SUFFIX) dsyr2.$(SUFFIX) dgbmv.$(SUFFIX) \ ++ dsbmv.$(SUFFIX) dspmv.$(SUFFIX) \ ++ dspr.$(SUFFIX) dspr2.$(SUFFIX) \ ++ dtbsv.$(SUFFIX) dtbmv.$(SUFFIX) \ ++ dtpsv.$(SUFFIX) dtpmv.$(SUFFIX) ++ ++FDBLAS3OBJS = \ ++ dgemm.$(SUFFIX) dsymm.$(SUFFIX) dtrmm.$(SUFFIX) \ ++ dtrsm.$(SUFFIX) dsyrk.$(SUFFIX) dsyr2k.$(SUFFIX) \ ++ domatcopy.$(SUFFIX) dimatcopy.$(SUFFIX)\ ++ dgeadd.$(SUFFIX) ++ ++FCBLAS1OBJS = \ ++ caxpy.$(SUFFIX) caxpyc.$(SUFFIX) cswap.$(SUFFIX) \ ++ ccopy.$(SUFFIX) cscal.$(SUFFIX) csscal.$(SUFFIX) \ ++ cdotc.$(SUFFIX) cdotu.$(SUFFIX) \ ++ scasum.$(SUFFIX) scnrm2.$(SUFFIX) \ ++ scamax.$(SUFFIX) icamax.$(SUFFIX) \ ++ scamin.$(SUFFIX) icamin.$(SUFFIX) \ ++ csrot.$(SUFFIX) crotg.$(SUFFIX) \ ++ caxpby.$(SUFFIX) ++ ++FCBLAS2OBJS = \ ++ cgemv.$(SUFFIX) cgeru.$(SUFFIX) cgerc.$(SUFFIX) \ ++ ctrsv.$(SUFFIX) ctrmv.$(SUFFIX) \ ++ csyr2.$(SUFFIX) cgbmv.$(SUFFIX) \ ++ csbmv.$(SUFFIX) \ ++ cspr2.$(SUFFIX) \ ++ ctbsv.$(SUFFIX) ctbmv.$(SUFFIX) \ ++ ctpsv.$(SUFFIX) ctpmv.$(SUFFIX) \ ++ chemv.$(SUFFIX) chbmv.$(SUFFIX) \ ++ cher.$(SUFFIX) cher2.$(SUFFIX) \ ++ chpmv.$(SUFFIX) chpr.$(SUFFIX) chpr2.$(SUFFIX) ++ ++FCBLAS3OBJS = \ ++ cgemm.$(SUFFIX) csymm.$(SUFFIX) ctrmm.$(SUFFIX) \ ++ ctrsm.$(SUFFIX) csyrk.$(SUFFIX) csyr2k.$(SUFFIX) \ ++ chemm.$(SUFFIX) cherk.$(SUFFIX) cher2k.$(SUFFIX) \ ++ comatcopy.$(SUFFIX) cimatcopy.$(SUFFIX)\ ++ cgeadd.$(SUFFIX) ++ ++FZBLAS1OBJS = \ ++ zaxpy.$(SUFFIX) zaxpyc.$(SUFFIX) zswap.$(SUFFIX) \ ++ zcopy.$(SUFFIX) zscal.$(SUFFIX) zdscal.$(SUFFIX) \ ++ zdotc.$(SUFFIX) zdotu.$(SUFFIX) \ ++ dzasum.$(SUFFIX) dznrm2.$(SUFFIX) \ ++ dzamax.$(SUFFIX) izamax.$(SUFFIX) \ ++ dzamin.$(SUFFIX) izamin.$(SUFFIX) \ ++ zdrot.$(SUFFIX) zrotg.$(SUFFIX) \ ++ zaxpby.$(SUFFIX) ++ ++FZBLAS2OBJS = \ ++ zgemv.$(SUFFIX) zgeru.$(SUFFIX) zgerc.$(SUFFIX) \ ++ ztrsv.$(SUFFIX) ztrmv.$(SUFFIX) \ ++ zsyr2.$(SUFFIX) zgbmv.$(SUFFIX) \ ++ zsbmv.$(SUFFIX) \ ++ zspr2.$(SUFFIX) \ ++ ztbsv.$(SUFFIX) ztbmv.$(SUFFIX) \ ++ ztpsv.$(SUFFIX) ztpmv.$(SUFFIX) \ ++ zhemv.$(SUFFIX) zhbmv.$(SUFFIX) \ ++ zher.$(SUFFIX) zher2.$(SUFFIX) \ ++ zhpmv.$(SUFFIX) zhpr.$(SUFFIX) zhpr2.$(SUFFIX) ++ ++FZBLAS3OBJS = \ ++ zgemm.$(SUFFIX) zsymm.$(SUFFIX) ztrmm.$(SUFFIX) \ ++ ztrsm.$(SUFFIX) zsyrk.$(SUFFIX) zsyr2k.$(SUFFIX) \ ++ zhemm.$(SUFFIX) zherk.$(SUFFIX) zher2k.$(SUFFIX) \ ++ zomatcopy.$(SUFFIX) zimatcopy.$(SUFFIX)\ ++ zgeadd.$(SUFFIX) ++ ++shared-blas-lapack: libblas.so.3 libcblas.so.3 liblapack.so.3 ++ ++# The list of prerequisite is created by comparing with NETLIB BLAS public API. ++# The symbol cblas_xerbla is missing here, but it does not seem to be provided ++# by libopenblas.so.0 either. ++libblas.so.3: $(FSBLAS1OBJS) $(FSBLAS2OBJS) $(FSBLAS3OBJS) $(FDBLAS1OBJS) $(FDBLAS2OBJS) $(FDBLAS3OBJS) $(FCBLAS1OBJS) $(FCBLAS2OBJS) $(FCBLAS3OBJS) $(FZBLAS1OBJS) $(FZBLAS2OBJS) $(FZBLAS3OBJS) ../kernel/lsame.o ../kernel/scabs1.o ../kernel/dcabs1.o ../driver/others/xerbla.o ++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -Wl,-soname,libblas.so.3 -L.. -lopenblas $(EXTRALIB) ++ ++libcblas.so.3: $(CSBLAS1OBJS) $(CSBLAS2OBJS) $(CSBLAS3OBJS) $(CDBLAS1OBJS) $(CDBLAS2OBJS) $(CDBLAS3OBJS) $(CCBLAS1OBJS) $(CCBLAS2OBJS) $(CCBLAS3OBJS) $(CZBLAS1OBJS) $(CZBLAS2OBJS) $(CZBLAS3OBJS) ../kernel/lsame.o ../kernel/scabs1.o ../kernel/dcabs1.o ../driver/others/xerbla.o ++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -Wl,-soname,libcblas.so.3 -L.. -lopenblas $(EXTRALIB) ++ ++liblapack.so.3: $(SLAPACKOBJS) $(DLAPACKOBJS) $(CLAPACKOBJS) $(ZLAPACKOBJS) ../kernel/lsame.o ../driver/others/xerbla.o ++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ ../lapack-netlib/SRC/*.o -Wl,-soname,liblapack.so.3 -L.. -lopenblas $(EXTRALIB) ++ ++clean:: ++ rm -f libblas.so.3 libcblas.so.3 liblapack.so.3 diff --git a/sci-libs/openblas/metadata.xml b/sci-libs/openblas/metadata.xml new file mode 100644 index 000000000000..a5e019212f0d --- /dev/null +++ b/sci-libs/openblas/metadata.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>sci@gentoo.org</email> + <name>Gentoo Science Project</name> + </maintainer> + <longdescription lang="en"> + OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. + </longdescription> + <use> + <flag name="dynamic">Build dynamic architecture detection at run time (for multi targets)</flag> + <flag name="pthread">Build with pthread threadding model</flag> + <flag name="serial">Build without multi-thraedding</flag> + <flag name="eselect-ldso">Enable BLAS/LAPACK runtime switching</flag> + </use> + <upstream> + <remote-id type="github">xianyi/OpenBLAS</remote-id> + </upstream> +</pkgmetadata> diff --git a/sci-libs/openblas/openblas-0.3.5.ebuild b/sci-libs/openblas/openblas-0.3.5.ebuild new file mode 100644 index 000000000000..b41803760ae9 --- /dev/null +++ b/sci-libs/openblas/openblas-0.3.5.ebuild @@ -0,0 +1,85 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="Optimized BLAS library based on GotoBLAS2" +HOMEPAGE="http://xianyi.github.com/OpenBLAS/" +SRC_URI="https://github.com/xianyi/OpenBLAS/tarball/v${PV} -> ${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos" +IUSE="dynamic openmp pthread serial static-libs eselect-ldso" +REQUIRED_USE="?? ( openmp pthread serial )" + +RDEPEND=" +>=app-eselect/eselect-blas-0.2 +>=app-eselect/eselect-lapack-0.2 +" +DEPEND="${RDEPEND} + virtual/pkgconfig" + +PATCHES=( "${FILESDIR}/shared-blas-lapack.patch" ) + +openblas_flags() { + local flags=() + use dynamic && \ + flags+=( DYNAMIC_ARCH=1 TARGET=GENERIC NUM_THREADS=64 NO_AFFINITY=1 ) + if use openmp; then + flags+=( USE_THREAD=1 USE_OPENMP=1 ) + elif use pthread; then + flags+=( USE_THREAD=1 USE_OPENMP=0 ) + else + flags+=( USE_THREAD=0 ) # serial + fi + flags+=( DESTDIR="${D}" PREFIX="${EPREFIX}/usr" ) + flags+=( OPENBLAS_INCLUDE_DIR='$(PREFIX)'/include/${PN} ) + flags+=( OPENBLAS_LIBRARY_DIR='$(PREFIX)'/$(get_libdir) ) + echo "${flags[@]}" +} + +src_unpack () { + default + find "${WORKDIR}" -maxdepth 1 -type d -name \*OpenBLAS\* && \ + mv "${WORKDIR}"/*OpenBLAS* "${S}" || die +} + +src_compile () { + emake $(openblas_flags) + emake -Cinterface shared-blas-lapack $(openblas_flags) +} + +src_install () { + emake install $(openblas_flags) + + if use eselect-ldso; then + dodir /usr/$(get_libdir)/blas/openblas/ + insinto /usr/$(get_libdir)/blas/openblas/ + doins interface/libblas.so.3 + dosym libblas.so.3 usr/$(get_libdir)/blas/openblas/libblas.so + doins interface/libcblas.so.3 + dosym libcblas.so.3 usr/$(get_libdir)/blas/openblas/libcblas.so + + dodir /usr/$(get_libdir)/lapack/openblas/ + insinto /usr/$(get_libdir)/lapack/openblas/ + doins interface/liblapack.so.3 + dosym liblapack.so.3 usr/$(get_libdir)/lapack/openblas/liblapack.so + fi +} + +pkg_postinst () { + if use eselect-ldso; then + eselect blas add $(get_libdir) \ + "${EROOT}"/usr/$(get_libdir)/blas/openblas openblas + eselect lapack add $(get_libdir) \ + "${EROOT}"/usr/$(get_libdir)/lapack/openblas openblas + fi +} + +pkg_postrm () { + if use eselect-ldso; then + eselect blas validate + eselect lapack validate + fi +} |