diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-11-12 15:32:09 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-11-12 15:32:09 +0000 |
commit | d1edfd3a57afc1db57e14cc58d3f28eea8eefd64 (patch) | |
tree | d5315c32caabd5ea57f0557a1b17681a6e12a435 /sci-libs | |
parent | 983485e93d76602266889d23c963609073b75e51 (diff) |
gentoo auto-resync : 12:11:2022 - 15:32:08
Diffstat (limited to 'sci-libs')
-rw-r--r-- | sci-libs/Manifest.gz | bin | 44396 -> 44397 bytes | |||
-rw-r--r-- | sci-libs/openblas/Manifest | 3 | ||||
-rw-r--r-- | sci-libs/openblas/files/openblas-0.3.21-fix-loong.patch | 237 | ||||
-rw-r--r-- | sci-libs/openblas/openblas-0.3.21.ebuild | 196 |
4 files changed, 436 insertions, 0 deletions
diff --git a/sci-libs/Manifest.gz b/sci-libs/Manifest.gz Binary files differindex a6fba3f7b563..7a2db611fdc6 100644 --- a/sci-libs/Manifest.gz +++ b/sci-libs/Manifest.gz diff --git a/sci-libs/openblas/Manifest b/sci-libs/openblas/Manifest index 76568c5379fd..e52f90808a85 100644 --- a/sci-libs/openblas/Manifest +++ b/sci-libs/openblas/Manifest @@ -1,10 +1,13 @@ AUX openblas-0.3.12-shared-blas-lapack.patch 2008 BLAKE2B 2d3a4a90d8144cbf149b7711b67364176a94287f26448930b5a4fd29fe761fb250e9007c580fb1ffa8148c477e2f4057f9cd8d7aa07efeb85caa842802d358fd SHA512 3f0d4b480549565c838eba6371e0990c162f56a226f9d26e1639e012ae3f39809f8c6badcf8fdfbb1258f45367dbaff9c4c611b8b44bac27d341aea954f0133e AUX openblas-0.3.20-fix-loong.patch 5694 BLAKE2B 0d4eb185ead0a47855e411670816aaf52e22530160cc2b29c7eca8a077d7bfb49a501d154c7492a259287efbd6dd24496f53d91cb834a97b2fec441d3dd06cf1 SHA512 1e90165549bc0a441003cf7bc0b1fa3e2af6eaaaad92ab5aca0d3f9569976184cbe653a049c26e81f016cf66152ac9903f619a990f54613fe3f091eb94fd742f AUX openblas-0.3.20-fix-riscv.patch 3786 BLAKE2B 5ba65c1f44aa8cd8f1b88458dfe16ef32bfd92260bed2b3b60596a16c9778a94b7c03752f41ad649ba1742c72b7528768fa51fcf30639c2bc0064ad132b0d747 SHA512 aec236b9d6fa9c80cef6401cf43e594cb17c73137cfcc17286046d8d85bb6a5bb6367b808a8b85152313cb596919de0173812832037ba88e4e39b722e4a8d2e1 +AUX openblas-0.3.21-fix-loong.patch 7341 BLAKE2B 33bd86e61b8a9d5d7130a4dd3a2d03f2e4ddd9703a3c2d6cf8e31e0af7499ea6128a1b7979f0a347b813292af2dca507d9b06e9ced6ab4e821d5f33ee03e5054 SHA512 c1c19e8965794658baff61bdc9082981b9e69b487c4221837ef10f176b12ee152bad0e37bbd0c347722ee2daf83adb016e75b149dad2b140ad4c631646290642 DIST openblas-0.3.18.tar.gz 12619822 BLAKE2B 38a5e7b861eb0063a4494c1cfb6f7f5723741437ecdd5cb1fb42645eb73bceb472b3a8c11eec3d0ba4f676981ac89de4ff1ee0d7ea42d1e234746f34ce8fb6b8 SHA512 df9a14026a61bdc5285636bfd7a52dce244d24fcf4a0c870ef4e58b8b50e412849828ca5aeac2a2435f635e78e60559762e8bae22ea7bc5dff2e865a96d81152 DIST openblas-0.3.19.tar.gz 12706050 BLAKE2B c29aa27faaf18e3330087f8d2ebed733f53878266d6865239dfbb1624a113f3cabc988bbfcc18a0aa5d971697bc68bb267795ef24e2d8e0e8d50f802cb817b57 SHA512 1fcbcfefb7744894b0b0c83c6071b342086ca311dc67f5c2745812d61dcc9d31ef7dd5e1215dfb2731ae7197d497dbdf8f8b26a432eb07d41a7db0983eb86a33 DIST openblas-0.3.20.tar.gz 12742441 BLAKE2B 9ae808e2a7da39e28dbe26c7feb5da3c70275f3b48bd68455c22e3b16fc1f2d10b9d84c9593acff2c837fc1514f21f2bbc0e87708075c5fe13514d0d47cf0b5a SHA512 0742d40b74b11b781021280fd627fa5798e6856b49f2ba1111a5927aac1a7823bcb8162187555f4cf3a4dd7eadf5b1f2a4685c0b5e189847b2869166d1bc7391 +DIST openblas-0.3.21.tar.gz 23729571 BLAKE2B 678bfb13ead69045e7d4d840bbcaed884d9ebedded5425cfa1f55e3d85bda31a3eb43dbbf9f07099d0d198f97ae68ef3b3b2b78aa1bd5b4999dd729dc08f7e28 SHA512 4625c8e6ccfa9120281fd714d3f6b7c3ba2265470c1be76121d6b25dc3dacb899d26e5d9a417ddc616d23909f1411495aa995ef8d8d6df8511cd5cefbabcb1c5 EBUILD openblas-0.3.18.ebuild 5778 BLAKE2B 20eacb6dfeb8114f77c9c63ee7962a4180bc029e8b950c4049b2d4d12cc81d666fd42ae13565cc9c1d9841510672308b8142ddcf898b795422c417e415ee3a9d SHA512 6155bff0b7bed8bff2db6eb3fc7d41be2eb1ae5638954825d6dea963a714067547bbd8459bbc438bad7c730e5607688bf8fc14fb6154c6a5065e87ea2012964e EBUILD openblas-0.3.19.ebuild 5778 BLAKE2B 20eacb6dfeb8114f77c9c63ee7962a4180bc029e8b950c4049b2d4d12cc81d666fd42ae13565cc9c1d9841510672308b8142ddcf898b795422c417e415ee3a9d SHA512 6155bff0b7bed8bff2db6eb3fc7d41be2eb1ae5638954825d6dea963a714067547bbd8459bbc438bad7c730e5607688bf8fc14fb6154c6a5065e87ea2012964e EBUILD openblas-0.3.20.ebuild 5882 BLAKE2B 593c2164016813464a3d3832e5b24ff4ed854960bda3c74a5bc10a1e5fe14c0dfb8c06a00d7c499e5cc1c04b7aae3abd0a074303a49c5fd409fe800cd95891f4 SHA512 5eee438e2d047b4f5df3e478d1809131e49f250396019b426e153124c6ea8d88b8f3b962c3074e037e3e6ef334b72deae7bff4e1d9452181fbbf2f49964cfa54 +EBUILD openblas-0.3.21.ebuild 5606 BLAKE2B 8f86ba88525b0b938cc766a57a7c38066ffcc584a5846791f15790b41ac59641449af3c8646a03a337dc23948ef2252857225a911c08105c066f023cffe54854 SHA512 210682410ff9731913d58eb34cdb0c5f550f91b23d8f50603044e0bb80a748b2eeb7779e2cf73fde6fc35ed08e1c586bd5c1a3d4ae7f43157ecba470566686b8 MISC metadata.xml 1561 BLAKE2B 5ba7ec66dd8ba7ca8bc29bc0193b48b6a82b4949bb79bab461400040667aa66aac3cfd2ad9c7323798048fd43d18ac96a562d53b68f3f7ae8bf8505ac7a04691 SHA512 05272eb56480ff82b240d0f430df3df03981e24b971dbd37c13d464f4f4b334bac19b54915446a09326a334aa76249bb79a4fa389d26150365f21389992f9a48 diff --git a/sci-libs/openblas/files/openblas-0.3.21-fix-loong.patch b/sci-libs/openblas/files/openblas-0.3.21-fix-loong.patch new file mode 100644 index 000000000000..ed112d62380b --- /dev/null +++ b/sci-libs/openblas/files/openblas-0.3.21-fix-loong.patch @@ -0,0 +1,237 @@ +https://github.com/xianyi/OpenBLAS/pull/3626 + +From 5af7b8638b3b972bd0e25597ec07927fffd52108 Mon Sep 17 00:00:00 2001 +From: WANG Xuerui <xen0n@gentoo.org> +Date: Fri, 13 May 2022 15:26:33 +0800 +Subject: [PATCH 1/3] Move LoongArch make rules to Makefile.loongarch64 + +--- + Makefile.loongarch64 | 5 +++-- + Makefile.system | 5 ----- + 2 files changed, 3 insertions(+), 7 deletions(-) + +diff --git a/Makefile.loongarch64 b/Makefile.loongarch64 +index 05ea9c679d..fced1a9462 100644 +--- a/Makefile.loongarch64 ++++ b/Makefile.loongarch64 +@@ -1,3 +1,4 @@ +-ifdef BINARY64 +-else ++ifeq ($(CORE), LOONGSON3R5) ++CCOMMON_OPT += -march=loongarch64 -mabi=lp64 ++FCOMMON_OPT += -march=loongarch64 -mabi=lp64 + endif +diff --git a/Makefile.system b/Makefile.system +index 3be5efa0c2..9c91425b0f 100644 +--- a/Makefile.system ++++ b/Makefile.system +@@ -895,11 +895,6 @@ ifeq ($(OSNAME), AIX) + BINARY_DEFINED = 1 + endif + +-ifeq ($(ARCH), loongarch64) +-CCOMMON_OPT += -march=loongarch64 -mabi=lp64 +-FCOMMON_OPT += -march=loongarch64 -mabi=lp64 +-endif +- + endif + + ifndef BINARY_DEFINED + +From 869061c783d60ba0b799fab643952c493b57fb0a Mon Sep 17 00:00:00 2001 +From: WANG Xuerui <xen0n@gentoo.org> +Date: Fri, 13 May 2022 15:53:22 +0800 +Subject: [PATCH 2/3] Probe for old-world LASX flavor on LoongArch and use + generic DGEMM kernel otherwise + +See: https://bugs.gentoo.org/844013 +--- + Makefile.system | 1 + + c_check | 27 ++++++++++++++++++++++++++- + kernel/loongarch64/KERNEL.LOONGSON3R5 | 5 +++++ + 3 files changed, 32 insertions(+), 1 deletion(-) + +diff --git a/Makefile.system b/Makefile.system +index 9c91425b0f..b86aafbddb 100644 +--- a/Makefile.system ++++ b/Makefile.system +@@ -1702,6 +1702,7 @@ export TARGET_CORE + export NO_AVX512 + export NO_AVX2 + export BUILD_BFLOAT16 ++export NO_LASX + + export SBGEMM_UNROLL_M + export SBGEMM_UNROLL_N +diff --git a/c_check b/c_check +index 01d4f4a7cf..a37e91f82c 100755 +--- a/c_check ++++ b/c_check +@@ -112,7 +112,7 @@ case "$architecture" in + defined=1 + ;; + arm|arm64) defined=1 ;; +- zarch|e2k|alpha|ia64|riscv64|loonarch64) ++ zarch|e2k|alpha|ia64|riscv64|loongarch64) + defined=1 + BINARY=64 + ;; +@@ -240,6 +240,29 @@ if [ "$architecture" = "riscv64" ]; then + rm -rf "$tmpd" + fi + ++no_lasx=0 ++if [ "$architecture" = "loongarch64" ]; then ++ tmpd=`mktemp -d` ++ tmpf="$tmpd/a.c" ++ # Old-world assembly flavor: LASX registers named "$xrNN", different ++ # from the ISA manual which suggests "$xNN". This is the flavor we ++ # currently support. ++ # ++ # As the LASX ISA manual is not out yet, we cannot predict what the ++ # new-world flavor would look like, so do not probe flavor for now. ++ # The compiler flags are also unsuitable for new-world gcc. ++ code='"xvld $xr0, $a0, 0\n"' ++ printf "int main(void){ __asm__ volatile(%s); }\n" "$code" >> "$tmpf" ++ args=" -march=loongarch64 -mabi=lp64 -mlasx -c -o $tmpf.o $tmpf" ++ no_lasx=0 ++ { ++ $compiler_name $flags $args >/dev/null 2>&1 ++ } || { ++ no_lasx=1 ++ } ++ rm -rf "$tmpd" ++fi ++ + c11_atomics=0 + case "$data" in + *HAVE_C11*) +@@ -350,6 +373,7 @@ done + + [ "$makefile" = "-" ] && { + [ "$no_rv64gv" -eq 1 ] && printf "NO_RV64GV=1\n" ++ [ "$no_lasx" -eq 1 ] && printf "NO_LASX=1\n" + [ "$no_avx512" -eq 1 ] && printf "NO_AVX512=1\n" + [ "$no_avx2" -eq 1 ] && printf "NO_AVX2=1\n" + [ "$oldgcc" -eq 1 ] && printf "OLDGCC=1\n" +@@ -380,6 +404,7 @@ done + printf "MSA_FLAGS=%s\n" "$msa_flags" + } + [ "$no_rv64gv" -eq 1 ] && printf "NO_RV64GV=1\n" ++ [ "$no_lasx" -eq 1 ] && printf "NO_LASX=1\n" + [ "$no_avx512" -eq 1 ] && printf "NO_AVX512=1\n" + [ "$no_avx2" -eq 1 ] && printf "NO_AVX2=1\n" + [ "$oldgcc" -eq 1 ] && printf "OLDGCC=1\n" +diff --git a/kernel/loongarch64/KERNEL.LOONGSON3R5 b/kernel/loongarch64/KERNEL.LOONGSON3R5 +index cda3590402..79b57d1e4d 100644 +--- a/kernel/loongarch64/KERNEL.LOONGSON3R5 ++++ b/kernel/loongarch64/KERNEL.LOONGSON3R5 +@@ -1,3 +1,7 @@ ++ifeq ($(NO_LASX), 1) ++# No LASX support in compiler, unable to consume the optimized version ++# leave out DGEMMKERNEL to pull in the generic version ++else + DGEMMKERNEL = dgemm_kernel_16x4.S + DGEMMINCOPY = dgemm_ncopy_16.S + DGEMMITCOPY = dgemm_tcopy_16.S +@@ -7,6 +11,7 @@ DGEMMINCOPYOBJ = dgemm_incopy$(TSUFFIX).$(SUFFIX) + DGEMMITCOPYOBJ = dgemm_itcopy$(TSUFFIX).$(SUFFIX) + DGEMMONCOPYOBJ = dgemm_oncopy$(TSUFFIX).$(SUFFIX) + DGEMMOTCOPYOBJ = dgemm_otcopy$(TSUFFIX).$(SUFFIX) ++endif + + DTRSMKERNEL_LN = ../generic/trsm_kernel_LN.c + DTRSMKERNEL_LT = ../generic/trsm_kernel_LT.c + +From 699c57d3767c9a5a5a69262a4b70a1f80e0bb2e2 Mon Sep 17 00:00:00 2001 +From: WANG Xuerui <xen0n@gentoo.org> +Date: Fri, 13 May 2022 16:23:46 +0800 +Subject: [PATCH 3/3] Fix ABI CFLAGS setting on new-world LoongArch + +See: https://bugs.gentoo.org/844013 +--- + Makefile.loongarch64 | 13 +++++++++++-- + Makefile.system | 1 + + c_check | 14 ++++++++++++++ + 3 files changed, 26 insertions(+), 2 deletions(-) + +diff --git a/Makefile.loongarch64 b/Makefile.loongarch64 +index fced1a9462..d6cbe848cd 100644 +--- a/Makefile.loongarch64 ++++ b/Makefile.loongarch64 +@@ -1,4 +1,13 @@ + ifeq ($(CORE), LOONGSON3R5) +-CCOMMON_OPT += -march=loongarch64 -mabi=lp64 +-FCOMMON_OPT += -march=loongarch64 -mabi=lp64 ++CCOMMON_OPT += -march=loongarch64 ++FCOMMON_OPT += -march=loongarch64 ++ ++ifeq ($(LOONGARCH_CC_FLAVOR), NEW) ++CCOMMON_OPT += -mabi=lp64d ++FCOMMON_OPT += -mabi=lp64d ++endif ++ifeq ($(LOONGARCH_CC_FLAVOR), OLD) ++CCOMMON_OPT += -mabi=lp64 ++FCOMMON_OPT += -mabi=lp64 ++endif + endif +diff --git a/Makefile.system b/Makefile.system +index b86aafbddb..4360a861cb 100644 +--- a/Makefile.system ++++ b/Makefile.system +@@ -1702,6 +1702,7 @@ export TARGET_CORE + export NO_AVX512 + export NO_AVX2 + export BUILD_BFLOAT16 ++export LOONGARCH_CC_FLAVOR + export NO_LASX + + export SBGEMM_UNROLL_M +diff --git a/c_check b/c_check +index a37e91f82c..573f0e52fd 100755 +--- a/c_check ++++ b/c_check +@@ -240,8 +240,19 @@ if [ "$architecture" = "riscv64" ]; then + rm -rf "$tmpd" + fi + ++loongarch_cc_flavor="" + no_lasx=0 + if [ "$architecture" = "loongarch64" ]; then ++ # Currently there are only 2 flavors: new-world and old-world. ++ # They differ in ABI names accepted, so check it to avoid creating temp ++ # files. ++ loongarch_cc_flavor="NEW" ++ { ++ $compiler_name -mabi=lp64d -E -o - /dev/null >/dev/null 2>&1 ++ } || { ++ loongarch_cc_flavor="OLD" ++ } ++ + tmpd=`mktemp -d` + tmpf="$tmpd/a.c" + # Old-world assembly flavor: LASX registers named "$xrNN", different +@@ -260,6 +271,7 @@ if [ "$architecture" = "loongarch64" ]; then + } || { + no_lasx=1 + } ++ + rm -rf "$tmpd" + fi + +@@ -377,6 +389,7 @@ done + [ "$no_avx512" -eq 1 ] && printf "NO_AVX512=1\n" + [ "$no_avx2" -eq 1 ] && printf "NO_AVX2=1\n" + [ "$oldgcc" -eq 1 ] && printf "OLDGCC=1\n" ++ [ -n "$loongarch_cc_flavor" ] && printf "LOONGARCH_CC_FLAVOR=%s\n" "$loongarch_cc_flavor" + exit 0 + } + +@@ -408,6 +421,7 @@ done + [ "$no_avx512" -eq 1 ] && printf "NO_AVX512=1\n" + [ "$no_avx2" -eq 1 ] && printf "NO_AVX2=1\n" + [ "$oldgcc" -eq 1 ] && printf "OLDGCC=1\n" ++ [ -n "$loongarch_cc_flavor" ] && printf "LOONGARCH_CC_FLAVOR=%s\n" "$loongarch_cc_flavor" + } >> "$makefile" + + os=`echo "$os" | tr '[[:lower:]]' '[[:upper:]]'/ ` diff --git a/sci-libs/openblas/openblas-0.3.21.ebuild b/sci-libs/openblas/openblas-0.3.21.ebuild new file mode 100644 index 000000000000..8684438c1a7a --- /dev/null +++ b/sci-libs/openblas/openblas-0.3.21.ebuild @@ -0,0 +1,196 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit fortran-2 toolchain-funcs + +DESCRIPTION="Optimized BLAS library based on GotoBLAS2" +HOMEPAGE="https://github.com/xianyi/OpenBLAS" +SRC_URI="https://github.com/xianyi/OpenBLAS/archive/v${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}"/OpenBLAS-${PV} + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~loong ~riscv ~x86 ~amd64-linux ~x86-linux ~x64-macos" +IUSE="dynamic eselect-ldso index-64bit openmp pthread relapack test" +REQUIRED_USE="?? ( openmp pthread )" +RESTRICT="!test? ( test )" + +RDEPEND=" + eselect-ldso? ( + >=app-eselect/eselect-blas-0.2 + >=app-eselect/eselect-lapack-0.2 + ) +" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}/${PN}-0.3.12-shared-blas-lapack.patch" + "${FILESDIR}/${PN}-0.3.21-fix-loong.patch" +) + +pkg_pretend() { + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp + + elog "This software has a massive number of options that" + elog "are configurable and it is *impossible* for all of" + elog "those to fit inside any manageable ebuild." + elog "The Gentoo provided package has enough to build" + elog "a fully optimized library for your targeted CPU." + elog "You can set the CPU target using the environment" + elog "variable - OPENBLAS_TARGET or it will be detected" + elog "automatically from the target toolchain (supports" + elog "cross compilation toolchains)." + elog "You can control the maximum number of threads" + elog "using OPENBLAS_NTHREAD, default=64 and number of " + elog "parallel calls to allow before further calls wait" + elog "using OPENBLAS_NPARALLEL, default=8." +} + +pkg_setup() { + fortran-2_pkg_setup + + # List of most configurable options - Makefile.rule + + # https://github.com/xianyi/OpenBLAS/pull/2663 + tc-export CC FC LD AR AS RANLIB + + # HOSTCC is used for scripting + export HOSTCC="$(tc-getBUILD_CC)" + + # threading options + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp + USE_THREAD=0 + if use openmp; then + USE_THREAD=1; USE_OPENMP=1; + elif use pthread; then + USE_THREAD=1; USE_OPENMP=0; + fi + export USE_THREAD USE_OPENMP + + # disable submake with -j and default optimization flags + # in Makefile.system + # Makefile.rule says to not modify COMMON_OPT/FCOMMON_OPT... + export MAKE_NB_JOBS=-1 \ + COMMON_OPT=" " \ + FCOMMON_OPT=" " + + # Target CPU ARCH options + # generally detected automatically from cross toolchain + use dynamic && \ + export DYNAMIC_ARCH=1 \ + NO_AFFINITY=1 \ + TARGET=GENERIC + + export NUM_PARALLEL=${OPENBLAS_NPARALLEL:-8} \ + NUM_THREADS=${OPENBLAS_NTHREAD:-64} + + # setting OPENBLAS_TARGET to override auto detection + # in case the toolchain is not enough to detect + # https://github.com/xianyi/OpenBLAS/blob/develop/TargetList.txt + if ! use dynamic && [[ ! -z "${OPENBLAS_TARGET}" ]] ; then + export TARGET="${OPENBLAS_TARGET}" + fi + + export NO_STATIC=1 + + BUILD_RELAPACK=1 + if ! use relapack; then + BUILD_RELAPACK=0 + fi + + export PREFIX="${EPREFIX}/usr" BUILD_RELAPACK +} + +src_prepare() { + default + + # Don't build the tests as part of "make all". We'll do + # it explicitly later if the test phase is enabled. + sed -e "/^all ::/s/tests //" -i Makefile || die + + # if 64bit-index is needed, create second library + # with LIBPREFIX=libopenblas64 + if use index-64bit; then + cp -aL "${S}" "${S}-index-64bit" || die + fi +} + +src_compile() { + default + cd interface || die + emake shared-blas-lapack + + if use index-64bit; then + emake -C"${S}-index-64bit" \ + INTERFACE64=1 \ + LIBPREFIX=libopenblas64 + fi +} + +src_test() { + emake tests +} + +src_install() { + emake install DESTDIR="${D}" \ + OPENBLAS_INCLUDE_DIR='$(PREFIX)'/include/${PN} \ + OPENBLAS_LIBRARY_DIR='$(PREFIX)'/$(get_libdir) + + dodoc GotoBLAS_*.txt *.md Changelog.txt + + if use index-64bit; then + dolib.so "${S}-index-64bit"/libopenblas64*.so* + fi + + if use eselect-ldso; then + 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 + + insinto /usr/$(get_libdir)/lapack/openblas/ + doins interface/liblapack.so.3 + dosym liblapack.so.3 usr/$(get_libdir)/lapack/openblas/liblapack.so + doins interface/liblapacke.so.3 + dosym liblapacke.so.3 usr/$(get_libdir)/lapack/openblas/liblapacke.so + fi +} + +pkg_postinst() { + use eselect-ldso || return + local libdir=$(get_libdir) me="openblas" + + # check blas + eselect blas add ${libdir} "${EROOT}"/usr/${libdir}/blas/${me} ${me} + local current_blas=$(eselect blas show ${libdir} | cut -d' ' -f2) + if [[ ${current_blas} == "${me}" || -z ${current_blas} ]]; then + eselect blas set ${libdir} ${me} + elog "Current eselect: BLAS/CBLAS ($libdir) -> [${current_blas}]." + else + elog "Current eselect: BLAS/CBLAS ($libdir) -> [${current_blas}]." + elog "To use blas [${me}] implementation, you have to issue (as root):" + elog "\t eselect blas set ${libdir} ${me}" + fi + + # check lapack + eselect lapack add ${libdir} "${EROOT}"/usr/${libdir}/lapack/${me} ${me} + local current_lapack=$(eselect lapack show ${libdir} | cut -d' ' -f2) + if [[ ${current_lapack} == "${me}" || -z ${current_lapack} ]]; then + eselect lapack set ${libdir} ${me} + elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]." + else + elog "Current eselect: LAPACK ($libdir) -> [${current_lapack}]." + elog "To use lapack [${me}] implementation, you have to issue (as root):" + elog "\t eselect lapack set ${libdir} ${me}" + fi +} + +pkg_postrm() { + if use eselect-ldso; then + eselect blas validate + eselect lapack validate + fi +} |