diff options
author | Benda Xu <heroxbd@gentoo.org> | 2019-08-04 22:47:19 +0800 |
---|---|---|
committer | Benda Xu <heroxbd@gentoo.org> | 2019-08-04 22:47:51 +0800 |
commit | 64ff822f7d122a08ab0043641401df9207800a5c (patch) | |
tree | 28e8d87e0d5249f563105172462116e61669d0e5 /sci-libs/openblas | |
parent | dev-libs/libpwquality: Fix la files (diff) | |
download | gentoo-64ff822f7d122a08ab0043641401df9207800a5c.tar.gz gentoo-64ff822f7d122a08ab0043641401df9207800a5c.tar.bz2 gentoo-64ff822f7d122a08ab0043641401df9207800a5c.zip |
sci-libs/openblas: use pkg_setup to do the build env and checks.
Closes: https://github.com/gentoo/gentoo/pull/12576
Package-Manager: Portage-2.3.69, Repoman-2.3.12
Signed-off-by: Benda Xu <heroxbd@gentoo.org>
Diffstat (limited to 'sci-libs/openblas')
-rw-r--r-- | sci-libs/openblas/openblas-0.3.6.ebuild | 47 |
1 files changed, 21 insertions, 26 deletions
diff --git a/sci-libs/openblas/openblas-0.3.6.ebuild b/sci-libs/openblas/openblas-0.3.6.ebuild index 3a91ce44fc14..f52bf5c6ece1 100644 --- a/sci-libs/openblas/openblas-0.3.6.ebuild +++ b/sci-libs/openblas/openblas-0.3.6.ebuild @@ -23,32 +23,26 @@ DEPEND="virtual/pkgconfig" PATCHES=( "${FILESDIR}/shared-blas-lapack.patch" ) -src_prepare() { - default - # Set compiler and common CFLAGS. - sed \ - -e "/^#\s*CC/cCC=$(tc-getCC)" \ - -e "/^#\s*FC/cFC=$(tc-getFC)" \ - -e "/^#\s*COMMON_OPT/cCOMMON_OPT=${CFLAGS}" \ - -i "${S}"/Makefile.rule || die -} +pkg_setup() { + fortran-2_pkg_setup + use openmp && tc-check-openmp + export CC=$(tc-getCC) FC=$(tc-getFC) -openblas_flags() { - local flags=() use dynamic && \ - flags+=( DYNAMIC_ARCH=1 TARGET=GENERIC NUM_THREADS=64 NO_AFFINITY=1 ) + export DYNAMIC_ARCH=1 TARGET=GENERIC NUM_THREADS=64 NO_AFFINITY=1 + + # disable submake with -j + export MAKE_NB_JOBS=-1 + + USE_THREAD=0 if use openmp; then - tc-check-openmp - flags+=( USE_THREAD=1 USE_OPENMP=1 ) + USE_THREAD=1; USE_OPENMP=1; elif use pthread; then - flags+=( USE_THREAD=1 USE_OPENMP=0 ) - else - flags+=( USE_THREAD=0 ) # serial + USE_THREAD=1; USE_OPENMP=0; fi - flags+=( DESTDIR="${D}" PREFIX="${EPREFIX}/usr" ) - flags+=( OPENBLAS_INCLUDE_DIR='$(PREFIX)'/include/${PN} ) - flags+=( OPENBLAS_LIBRARY_DIR='$(PREFIX)'/$(get_libdir) ) - echo "${flags[@]}" + export USE_THREAD USE_OPENMP + + export PREFIX="${EPREFIX}/usr" } src_unpack () { @@ -60,19 +54,20 @@ src_unpack () { } src_compile () { - emake $(openblas_flags) - emake -Cinterface shared-blas-lapack $(openblas_flags) + emake + emake -Cinterface shared-blas-lapack if use index-64bit; then - emake -C"${S}-index-64bit" $(openblas_flags) INTERFACE64=1 LIBPREFIX=libopenblas64 + emake -C"${S}-index-64bit" INTERFACE64=1 LIBPREFIX=libopenblas64 fi } src_test() { - emake tests $(openblas_flags) + emake tests } src_install () { - emake install $(openblas_flags) + emake install DESTDIR="${D}" OPENBLAS_INCLUDE_DIR='$(PREFIX)'/include/${PN} \ + OPENBLAS_LIBRARY_DIR='$(PREFIX)'/$(get_libdir) dodoc GotoBLAS_*.txt *.md Changelog.txt if use eselect-ldso; then |