aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2015-09-19 09:14:19 +0200
committerJustin Lecher <jlec@gentoo.org>2015-11-28 18:25:09 +0100
commitbc36b5406f2bb289a3920ef13d50853a567bc83d (patch)
treeee431372f2726c8ffbc5ca294fd07076be18f737 /sci-libs/openblas
parentdev-util/amdapp: Version bump; Fixes issue #542 (diff)
downloadsci-bc36b5406f2bb289a3920ef13d50853a567bc83d.tar.gz
sci-bc36b5406f2bb289a3920ef13d50853a567bc83d.tar.bz2
sci-bc36b5406f2bb289a3920ef13d50853a567bc83d.zip
Large fix of numeric code
fortran-int64.eclass code has been splitted into numeric-int64-multibuild.eclass, fortran-2.eclass and numeric.eclass. Gentoo: https://bugs.gentoo.org/show_bug.cgi?id=563292 https://bugs.gentoo.org/show_bug.cgi?id=551764 https://bugs.gentoo.org/show_bug.cgi?id=555302 Github: resolves gentoo-science/sci#438 resolves gentoo-science/sci#443 resolves gentoo-science/sci#447 resolves gentoo-science/sci#450 resolves gentoo-science/sci#467 resolves gentoo-science/sci#492 resolves gentoo-science/sci#507 resolves gentoo-science/sci#508 resolves gentoo-science/sci#522 Signed-off-by: Justin Lecher <jlec@gentoo.org>
Diffstat (limited to 'sci-libs/openblas')
-rw-r--r--sci-libs/openblas/openblas-0.2.11.ebuild227
-rw-r--r--sci-libs/openblas/openblas-0.2.12.ebuild227
-rw-r--r--sci-libs/openblas/openblas-0.2.14.ebuild190
-rw-r--r--sci-libs/openblas/openblas-0.2.8.ebuild126
-rw-r--r--sci-libs/openblas/openblas-9999.ebuild190
5 files changed, 153 insertions, 807 deletions
diff --git a/sci-libs/openblas/openblas-0.2.11.ebuild b/sci-libs/openblas/openblas-0.2.11.ebuild
deleted file mode 100644
index 3b7d0b72b..000000000
--- a/sci-libs/openblas/openblas-0.2.11.ebuild
+++ /dev/null
@@ -1,227 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-EBASE_PROFNAME="openblas"
-inherit alternatives-2 eutils multilib fortran-2 multibuild multilib-build toolchain-funcs fortran-int64
-
-SRC_URI+="http://dev.gentoo.org/~gienah/distfiles/${PN}-0.2.11-gentoo.patch"
-if [[ ${PV} == "9999" ]] ; then
- EGIT_REPO_URI="https://github.com/xianyi/OpenBLAS.git"
- EGIT_BRANCH="develop"
- inherit git-r3
- KEYWORDS=""
-else
- SRC_URI+=" http://github.com/xianyi/OpenBLAS/tarball/v${PV} -> ${P}.tar.gz"
- KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~ppc-macos ~x64-macos"
-fi
-
-DESCRIPTION="Optimized BLAS library based on GotoBLAS2"
-HOMEPAGE="http://xianyi.github.com/OpenBLAS/"
-LICENSE="BSD"
-SLOT="0"
-IUSE="dynamic int64 openmp static-libs threads"
-
-RDEPEND=""
-DEPEND="${RDEPEND}
- virtual/pkgconfig"
-PDEPEND="
- >=virtual/blas-2.1-r2[int64?]
- >=virtual/cblas-2.0-r1[int64?]"
-
-MULTILIB_WRAPPED_HEADERS=(
- /usr/include/openblas/cblas.h
- /usr/include/openblas/f77blas.h
- /usr/include/openblas/openblas_config.h
-)
-
-get_openblas_flags() {
- local openblas_flags=""
- use dynamic && \
- openblas_flags+=" DYNAMIC_ARCH=1 TARGET=GENERIC NUM_THREADS=64 NO_AFFINITY=1"
- $(fortran-int64_is_int64_build) && \
- openblas_flags+=" INTERFACE64=1"
- # choose posix threads over openmp when the two are set
- # yet to see the need of having the two profiles simultaneously
- if use threads; then
- openblas_flags+=" USE_THREAD=1 USE_OPENMP=0"
- elif use openmp; then
- openblas_flags+=" USE_THREAD=0 USE_OPENMP=1"
- fi
- local profname=$(fortran-int64_get_profname)
- local libname="${profname//-/_}"
- local underscoresuffix="${libname#${PN}}"
- if [[ "${underscoresuffix}" != "_" ]]; then
- local libnamesuffix="${underscoresuffix#_}"
- openblas_flags+=" LIBNAMESUFFIX=${libnamesuffix}"
- fi
- echo "${openblas_flags}"
-}
-
-get_openblas_abi_cflags() {
- local openblas_abi_cflags=""
- if [[ "${ABI}" == "x86" ]]; then
- openblas_abi_cflags="-DOPENBLAS_ARCH_X86=1 -DOPENBLAS___32BIT__=1"
- else
- openblas_abi_cflags="-DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1"
- fi
- $(fortran-int64_is_int64_build) && \
- openblas_abi_cflags+=" -DOPENBLAS_USE64BITINT"
- echo "${openblas_abi_cflags}"
-}
-
-src_unpack() {
- if [[ ${PV} == "9999" ]] ; then
- git-r3_src_unpack
- else
- default
- if [[ ${PV} != "9999" ]] ; then
- find "${WORKDIR}" -maxdepth 1 -type d -name \*OpenBLAS\* && \
- mv "${WORKDIR}"/*OpenBLAS* "${S}"
- fi
- fi
-}
-
-src_prepare() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
- epatch "${DISTDIR}/${PN}-0.2.11-gentoo.patch"
- if [[ ${PV} == "0.2.11" ]] ; then
- epatch "${FILESDIR}/${PN}-0.2.11-cpuid_x86.patch"
- fi
- # lapack and lapacke are not modified from upstream lapack
- sed \
- -e "s:^#\s*\(NO_LAPACK\)\s*=.*:\1=1:" \
- -e "s:^#\s*\(NO_LAPACKE\)\s*=.*:\1=1:" \
- -i Makefile.rule || die
- multibuild_copy_sources
-}
-
-src_configure() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
- my_configure() {
- local openblas_abi_cflags="$(get_openblas_abi_cflags)"
- local internal_openblas_abi_cflags="${openblas_abi_cflags//OPENBLAS_}"
- sed \
- -e "s:^#\s*\(CC\)\s*=.*:\1=$(tc-getCC) $(get_abi_CFLAGS):" \
- -e "s:^#\s*\(FC\)\s*=.*:\1=$(tc-getFC) $(get_abi_CFLAGS):" \
- -e "s:^#\s*\(COMMON_OPT\)\s*=.*:\1=${CFLAGS} ${internal_openblas_abi_cflags}:" \
- -i Makefile.rule || die
- }
- multibuild_foreach_variant run_in_build_dir fortran-int64_multilib_multibuild_wrapper my_configure
-}
-
-src_compile() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
- # openblas already does multi-jobs
- MAKEOPTS+=" -j1"
- my_src_compile () {
- local openblas_flags=$(get_openblas_flags)
- local profname=$(fortran-int64_get_profname)
- local libname="${profname//-/_}"
- einfo "Compiling profile ${profname}"
- # cflags already defined twice
- unset CFLAGS
- emake clean
- emake libs shared ${openblas_flags}
- mkdir -p libs && mv libopenblas* libs/
- # avoid pic when compiling static libraries, so re-compiling
- if use static-libs; then
- emake clean
- emake libs ${openblas_flags} NO_SHARED=1 NEED_PIC=
- mv libopenblas* libs/
- fi
- # Fix Bug 524612 - [science overlay] sci-libs/openblas-0.2.11 - Assembler messages:
- # ../kernel/x86_64/gemm_kernel_8x4_barcelona.S:451: Error: missing ')'
- # The problem is applying this patch in src_prepare() causes build failures on
- # assembler code as the assembler does not understand sizeof(float). So
- # delay applying the patch until after building the libraries.
- epatch "${FILESDIR}/${PN}-0.2.11-openblas_config_header_same_between_ABIs.patch"
- rm -f config.h config_last.h
- # Note: prints this spurious warning: make: Nothing to be done for 'config.h'.
- emake config.h
- cp config.h config_last.h || die
- cat <<-EOF > ${profname}.pc
- prefix=${EPREFIX}/usr
- libdir=\${prefix}/$(get_libdir)
- includedir=\${prefix}/include
- Name: ${profname}
- Description: ${DESCRIPTION}
- Version: ${PV}
- URL: ${HOMEPAGE}
- Libs: -L\${libdir} -l${libname}
- Libs.private: -lm
- EOF
- local openblas_abi_cflags=$(get_openblas_abi_cflags)
- local openblas_abi_fflags=$(fortran-int64_get_fortran_int64_abi_fflags)
- cat <<-EOF >> ${profname}.pc
- Cflags: -I\${includedir}/${PN} ${openblas_abi_cflags}
- Fflags=${openblas_abi_fflags}
- EOF
- mv libs/libopenblas* . || die
- }
- multibuild_foreach_variant run_in_build_dir fortran-int64_multilib_multibuild_wrapper my_src_compile
-}
-
-src_test() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
- my_src_test () {
- local openblas_flags=$(get_openblas_flags)
- emake tests ${openblas_flags}
- }
- multibuild_foreach_variant run_in_build_dir fortran-int64_multilib_multibuild_wrapper my_src_test
-}
-
-src_install() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
- my_src_install() {
- local openblas_flags=$(get_openblas_flags)
- local profname=$(fortran-int64_get_profname)
- local pcfile
- for pcfile in *.pc; do
- local profname=${pcfile%.pc}
- # The file /usr/include/openblas/openblas_config.h is generated during the install.
- # The sed on config_last.h removes the #define's OPENBLAS_USE64BITINT
- # OPENBLASS__32BIT__ OPENBLASS__64BIT__ OPENBLAS__ARCH_X86 OPENBLAS__ARCH_X86_64
- # from /usr/include/openblas/openblas_config.h. We then specify it in Cflags in
- # the /usr/lib64/pkg-config/openblas-int64-{threads,openmp}.pc file.
- sed -e '/#define USE64BITINT/d' \
- -e '/#define ARCH_X86/d' \
- -e '/#define __\(32\|64\)BIT__/d' \
- -i config_last.h \
- || die "Could not ensure there is no definition of USE64BITINT in config_last.h"
- emake install \
- PREFIX="${ED}"usr ${openblas_flags} \
- OPENBLAS_INCLUDE_DIR="${ED}"usr/include/${PN} \
- OPENBLAS_LIBRARY_DIR="${ED}"usr/$(get_libdir)
- use static-libs || rm "${ED}"usr/$(get_libdir)/lib*.a
- alternatives_for $(fortran-int64_get_blas_provider) ${profname} 0 \
- /usr/$(get_libdir)/pkgconfig/$(fortran-int64_get_blas_provider).pc ${pcfile}
- alternatives_for $(fortran-int64_get_cblas_provider) ${profname} 0 \
- /usr/$(get_libdir)/pkgconfig/$(fortran-int64_get_cblas_provider).pc ${pcfile} \
- /usr/include/cblas.h ${PN}/cblas.h
- insinto /usr/$(get_libdir)/pkgconfig
- doins ${pcfile}
- done
-
- if [[ ${CHOST} == *-darwin* ]] ; then
- cd "${ED}"/usr/$(get_libdir)
- local d
- for d in *.dylib ; do
- ebegin "Correcting install_name of ${d}"
- install_name_tool -id "${EPREFIX}/usr/$(get_libdir)/${d}" "${d}"
- eend $?
- done
- fi
- if [[ ${#MULTIBUILD_VARIANTS[@]} -gt 1 ]]; then
- multilib_prepare_wrappers
- multilib_check_headers
- fi
- }
- multibuild_foreach_variant run_in_build_dir fortran-int64_multilib_multibuild_wrapper my_src_install
- multilib_install_wrappers
-
- dodoc GotoBLAS_{01Readme,03FAQ,04FAQ,05LargePage,06WeirdPerformance}.txt
- dodoc *md Changelog.txt
-}
diff --git a/sci-libs/openblas/openblas-0.2.12.ebuild b/sci-libs/openblas/openblas-0.2.12.ebuild
deleted file mode 100644
index 91736c817..000000000
--- a/sci-libs/openblas/openblas-0.2.12.ebuild
+++ /dev/null
@@ -1,227 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-EBASE_PROFNAME="openblas"
-inherit alternatives-2 eutils multilib fortran-2 multibuild multilib-build toolchain-funcs fortran-int64
-
-SRC_URI+="http://dev.gentoo.org/~gienah/distfiles/${PN}-0.2.11-gentoo.patch"
-if [[ ${PV} == "9999" ]] ; then
- EGIT_REPO_URI="https://github.com/xianyi/OpenBLAS.git"
- EGIT_BRANCH="develop"
- inherit git-r3
- KEYWORDS=""
-else
- SRC_URI+=" http://github.com/xianyi/OpenBLAS/tarball/v${PV} -> ${P}.tar.gz"
- KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~ppc-macos ~x64-macos"
-fi
-
-DESCRIPTION="Optimized BLAS library based on GotoBLAS2"
-HOMEPAGE="http://xianyi.github.com/OpenBLAS/"
-LICENSE="BSD"
-SLOT="0"
-IUSE="dynamic int64 openmp static-libs threads"
-
-RDEPEND=""
-DEPEND="${RDEPEND}
- virtual/pkgconfig"
-PDEPEND="
- >=virtual/blas-2.1-r2[int64?]
- >=virtual/cblas-2.0-r1[int64?]"
-
-MULTILIB_WRAPPED_HEADERS=(
- /usr/include/openblas/cblas.h
- /usr/include/openblas/f77blas.h
- /usr/include/openblas/openblas_config.h
-)
-
-get_openblas_flags() {
- local openblas_flags=""
- use dynamic && \
- openblas_flags+=" DYNAMIC_ARCH=1 TARGET=GENERIC NUM_THREADS=64 NO_AFFINITY=1"
- $(fortran-int64_is_int64_build) && \
- openblas_flags+=" INTERFACE64=1"
- # choose posix threads over openmp when the two are set
- # yet to see the need of having the two profiles simultaneously
- if use threads; then
- openblas_flags+=" USE_THREAD=1 USE_OPENMP=0"
- elif use openmp; then
- openblas_flags+=" USE_OPENMP=1"
- fi
- local profname=$(fortran-int64_get_profname)
- local libname="${profname//-/_}"
- local underscoresuffix="${libname#${PN}}"
- if [[ "${underscoresuffix}" != "_" ]]; then
- local libnamesuffix="${underscoresuffix#_}"
- openblas_flags+=" LIBNAMESUFFIX=${libnamesuffix}"
- fi
- echo "${openblas_flags}"
-}
-
-get_openblas_abi_cflags() {
- local openblas_abi_cflags=""
- if [[ "${ABI}" == "x86" ]]; then
- openblas_abi_cflags="-DOPENBLAS_ARCH_X86=1 -DOPENBLAS___32BIT__=1"
- else
- openblas_abi_cflags="-DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1"
- fi
- $(fortran-int64_is_int64_build) && \
- openblas_abi_cflags+=" -DOPENBLAS_USE64BITINT"
- echo "${openblas_abi_cflags}"
-}
-
-src_unpack() {
- if [[ ${PV} == "9999" ]] ; then
- git-r3_src_unpack
- else
- default
- if [[ ${PV} != "9999" ]] ; then
- find "${WORKDIR}" -maxdepth 1 -type d -name \*OpenBLAS\* && \
- mv "${WORKDIR}"/*OpenBLAS* "${S}"
- fi
- fi
-}
-
-src_prepare() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
- epatch "${DISTDIR}/${PN}-0.2.11-gentoo.patch"
- if [[ ${PV} == "0.2.11" ]] ; then
- epatch "${FILESDIR}/${PN}-0.2.11-cpuid_x86.patch"
- fi
- # lapack and lapacke are not modified from upstream lapack
- sed \
- -e "s:^#\s*\(NO_LAPACK\)\s*=.*:\1=1:" \
- -e "s:^#\s*\(NO_LAPACKE\)\s*=.*:\1=1:" \
- -i Makefile.rule || die
- multibuild_copy_sources
-}
-
-src_configure() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
- my_configure() {
- local openblas_abi_cflags="$(get_openblas_abi_cflags)"
- local internal_openblas_abi_cflags="${openblas_abi_cflags//OPENBLAS_}"
- sed \
- -e "s:^#\s*\(CC\)\s*=.*:\1=$(tc-getCC) $(get_abi_CFLAGS):" \
- -e "s:^#\s*\(FC\)\s*=.*:\1=$(tc-getFC) $(get_abi_CFLAGS):" \
- -e "s:^#\s*\(COMMON_OPT\)\s*=.*:\1=${CFLAGS} ${internal_openblas_abi_cflags}:" \
- -i Makefile.rule || die
- }
- multibuild_foreach_variant run_in_build_dir fortran-int64_multilib_multibuild_wrapper my_configure
-}
-
-src_compile() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
- # openblas already does multi-jobs
- MAKEOPTS+=" -j1"
- my_src_compile () {
- local openblas_flags=$(get_openblas_flags)
- local profname=$(fortran-int64_get_profname)
- local libname="${profname//-/_}"
- einfo "Compiling profile ${profname}"
- # cflags already defined twice
- unset CFLAGS
- emake clean
- emake libs shared ${openblas_flags}
- mkdir -p libs && mv libopenblas* libs/
- # avoid pic when compiling static libraries, so re-compiling
- if use static-libs; then
- emake clean
- emake libs ${openblas_flags} NO_SHARED=1 NEED_PIC=
- mv libopenblas* libs/
- fi
- # Fix Bug 524612 - [science overlay] sci-libs/openblas-0.2.11 - Assembler messages:
- # ../kernel/x86_64/gemm_kernel_8x4_barcelona.S:451: Error: missing ')'
- # The problem is applying this patch in src_prepare() causes build failures on
- # assembler code as the assembler does not understand sizeof(float). So
- # delay applying the patch until after building the libraries.
- epatch "${FILESDIR}/${PN}-0.2.11-openblas_config_header_same_between_ABIs.patch"
- rm -f config.h config_last.h
- # Note: prints this spurious warning: make: Nothing to be done for 'config.h'.
- emake config.h
- cp config.h config_last.h || die
- cat <<-EOF > ${profname}.pc
- prefix=${EPREFIX}/usr
- libdir=\${prefix}/$(get_libdir)
- includedir=\${prefix}/include
- Name: ${profname}
- Description: ${DESCRIPTION}
- Version: ${PV}
- URL: ${HOMEPAGE}
- Libs: -L\${libdir} -l${libname}
- Libs.private: -lm
- EOF
- local openblas_abi_cflags=$(get_openblas_abi_cflags)
- local openblas_abi_fflags=$(fortran-int64_get_fortran_int64_abi_fflags)
- cat <<-EOF >> ${profname}.pc
- Cflags: -I\${includedir}/${PN} ${openblas_abi_cflags}
- Fflags=${openblas_abi_fflags}
- EOF
- mv libs/libopenblas* . || die
- }
- multibuild_foreach_variant run_in_build_dir fortran-int64_multilib_multibuild_wrapper my_src_compile
-}
-
-src_test() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
- my_src_test () {
- local openblas_flags=$(get_openblas_flags)
- emake tests ${openblas_flags}
- }
- multibuild_foreach_variant run_in_build_dir fortran-int64_multilib_multibuild_wrapper my_src_test
-}
-
-src_install() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
- my_src_install() {
- local openblas_flags=$(get_openblas_flags)
- local profname=$(fortran-int64_get_profname)
- local pcfile
- for pcfile in *.pc; do
- local profname=${pcfile%.pc}
- # The file /usr/include/openblas/openblas_config.h is generated during the install.
- # The sed on config_last.h removes the #define's OPENBLAS_USE64BITINT
- # OPENBLASS__32BIT__ OPENBLASS__64BIT__ OPENBLAS__ARCH_X86 OPENBLAS__ARCH_X86_64
- # from /usr/include/openblas/openblas_config.h. We then specify it in Cflags in
- # the /usr/lib64/pkg-config/openblas-int64-{threads,openmp}.pc file.
- sed -e '/#define USE64BITINT/d' \
- -e '/#define ARCH_X86/d' \
- -e '/#define __\(32\|64\)BIT__/d' \
- -i config_last.h \
- || die "Could not ensure there is no definition of USE64BITINT in config_last.h"
- emake install \
- PREFIX="${ED}"usr ${openblas_flags} \
- OPENBLAS_INCLUDE_DIR="${ED}"usr/include/${PN} \
- OPENBLAS_LIBRARY_DIR="${ED}"usr/$(get_libdir)
- use static-libs || rm "${ED}"usr/$(get_libdir)/lib*.a
- alternatives_for $(fortran-int64_get_blas_provider) ${profname} 0 \
- /usr/$(get_libdir)/pkgconfig/$(fortran-int64_get_blas_provider).pc ${pcfile}
- alternatives_for $(fortran-int64_get_cblas_provider) ${profname} 0 \
- /usr/$(get_libdir)/pkgconfig/$(fortran-int64_get_cblas_provider).pc ${pcfile} \
- /usr/include/cblas.h ${PN}/cblas.h
- insinto /usr/$(get_libdir)/pkgconfig
- doins ${pcfile}
- done
-
- if [[ ${CHOST} == *-darwin* ]] ; then
- cd "${ED}"/usr/$(get_libdir)
- local d
- for d in *.dylib ; do
- ebegin "Correcting install_name of ${d}"
- install_name_tool -id "${EPREFIX}/usr/$(get_libdir)/${d}" "${d}"
- eend $?
- done
- fi
- if [[ ${#MULTIBUILD_VARIANTS[@]} -gt 1 ]]; then
- multilib_prepare_wrappers
- multilib_check_headers
- fi
- }
- multibuild_foreach_variant run_in_build_dir fortran-int64_multilib_multibuild_wrapper my_src_install
- multilib_install_wrappers
-
- dodoc GotoBLAS_{01Readme,03FAQ,04FAQ,05LargePage,06WeirdPerformance}.txt
- dodoc *md Changelog.txt
-}
diff --git a/sci-libs/openblas/openblas-0.2.14.ebuild b/sci-libs/openblas/openblas-0.2.14.ebuild
index 91736c817..3a92aef0f 100644
--- a/sci-libs/openblas/openblas-0.2.14.ebuild
+++ b/sci-libs/openblas/openblas-0.2.14.ebuild
@@ -4,32 +4,24 @@
EAPI=5
-EBASE_PROFNAME="openblas"
-inherit alternatives-2 eutils multilib fortran-2 multibuild multilib-build toolchain-funcs fortran-int64
-
-SRC_URI+="http://dev.gentoo.org/~gienah/distfiles/${PN}-0.2.11-gentoo.patch"
-if [[ ${PV} == "9999" ]] ; then
- EGIT_REPO_URI="https://github.com/xianyi/OpenBLAS.git"
- EGIT_BRANCH="develop"
- inherit git-r3
- KEYWORDS=""
-else
- SRC_URI+=" http://github.com/xianyi/OpenBLAS/tarball/v${PV} -> ${P}.tar.gz"
- KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~ppc-macos ~x64-macos"
-fi
+NUMERIC_MODULE_NAME="openblas"
+
+inherit alternatives-2 numeric numeric-int64-multibuild
DESCRIPTION="Optimized BLAS library based on GotoBLAS2"
HOMEPAGE="http://xianyi.github.com/OpenBLAS/"
+SRC_URI="
+ http://github.com/xianyi/OpenBLAS/tarball/v${PV} -> ${P}.tar.gz
+ http://dev.gentoo.org/~gienah/distfiles/${PN}-0.2.11-gentoo.patch"
+
LICENSE="BSD"
SLOT="0"
-IUSE="dynamic int64 openmp static-libs threads"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~ppc-macos ~x64-macos"
+IUSE="dynamic openmp static-libs threads"
RDEPEND=""
DEPEND="${RDEPEND}
virtual/pkgconfig"
-PDEPEND="
- >=virtual/blas-2.1-r2[int64?]
- >=virtual/cblas-2.0-r1[int64?]"
MULTILIB_WRAPPED_HEADERS=(
/usr/include/openblas/cblas.h
@@ -38,69 +30,59 @@ MULTILIB_WRAPPED_HEADERS=(
)
get_openblas_flags() {
- local openblas_flags=""
+ local openblas_flags=()
use dynamic && \
- openblas_flags+=" DYNAMIC_ARCH=1 TARGET=GENERIC NUM_THREADS=64 NO_AFFINITY=1"
- $(fortran-int64_is_int64_build) && \
- openblas_flags+=" INTERFACE64=1"
+ openblas_flags+=( DYNAMIC_ARCH=1 TARGET=GENERIC NUM_THREADS=64 NO_AFFINITY=1 )
+ $(numeric-int64_is_int64_build) && \
+ openblas_flags+=( INTERFACE64=1 )
# choose posix threads over openmp when the two are set
# yet to see the need of having the two profiles simultaneously
if use threads; then
- openblas_flags+=" USE_THREAD=1 USE_OPENMP=0"
+ openblas_flags+=( USE_THREAD=1 USE_OPENMP=0 )
elif use openmp; then
- openblas_flags+=" USE_OPENMP=1"
+ openblas_flags+=( USE_OPENMP=1 )
fi
- local profname=$(fortran-int64_get_profname)
+ local profname=$(numeric-int64_get_module_name)
local libname="${profname//-/_}"
local underscoresuffix="${libname#${PN}}"
if [[ "${underscoresuffix}" != "_" ]]; then
local libnamesuffix="${underscoresuffix#_}"
- openblas_flags+=" LIBNAMESUFFIX=${libnamesuffix}"
+ openblas_flags+=( LIBNAMESUFFIX=${libnamesuffix} )
fi
- echo "${openblas_flags}"
+ echo "${openblas_flags[@]}"
}
get_openblas_abi_cflags() {
- local openblas_abi_cflags=""
+ local openblas_abi_cflags=()
if [[ "${ABI}" == "x86" ]]; then
- openblas_abi_cflags="-DOPENBLAS_ARCH_X86=1 -DOPENBLAS___32BIT__=1"
+ openblas_abi_cflags=( -DOPENBLAS_ARCH_X86=1 -DOPENBLAS___32BIT__=1 )
else
- openblas_abi_cflags="-DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1"
+ openblas_abi_cflags=( -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 )
fi
- $(fortran-int64_is_int64_build) && \
- openblas_abi_cflags+=" -DOPENBLAS_USE64BITINT"
- echo "${openblas_abi_cflags}"
+ $(numeric-int64_is_int64_build) && \
+ openblas_abi_cflags+=( -DOPENBLAS_USE64BITINT )
+ echo "${openblas_abi_cflags[@]}"
}
src_unpack() {
- if [[ ${PV} == "9999" ]] ; then
- git-r3_src_unpack
- else
- default
- if [[ ${PV} != "9999" ]] ; then
- find "${WORKDIR}" -maxdepth 1 -type d -name \*OpenBLAS\* && \
- mv "${WORKDIR}"/*OpenBLAS* "${S}"
- fi
- fi
+ default
+ find "${WORKDIR}" -maxdepth 1 -type d -name \*OpenBLAS\* && \
+ mv "${WORKDIR}"/*OpenBLAS* "${S}" || die
}
src_prepare() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
epatch "${DISTDIR}/${PN}-0.2.11-gentoo.patch"
- if [[ ${PV} == "0.2.11" ]] ; then
- epatch "${FILESDIR}/${PN}-0.2.11-cpuid_x86.patch"
- fi
+
# lapack and lapacke are not modified from upstream lapack
sed \
-e "s:^#\s*\(NO_LAPACK\)\s*=.*:\1=1:" \
-e "s:^#\s*\(NO_LAPACKE\)\s*=.*:\1=1:" \
-i Makefile.rule || die
- multibuild_copy_sources
+ numeric-int64-multibuild_copy_sources
}
src_configure() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
- my_configure() {
+ blas_configure() {
local openblas_abi_cflags="$(get_openblas_abi_cflags)"
local internal_openblas_abi_cflags="${openblas_abi_cflags//OPENBLAS_}"
sed \
@@ -109,28 +91,23 @@ src_configure() {
-e "s:^#\s*\(COMMON_OPT\)\s*=.*:\1=${CFLAGS} ${internal_openblas_abi_cflags}:" \
-i Makefile.rule || die
}
- multibuild_foreach_variant run_in_build_dir fortran-int64_multilib_multibuild_wrapper my_configure
+ numeric-int64-multibuild_foreach_all_abi_variants run_in_build_dir blas_configure
}
src_compile() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
# openblas already does multi-jobs
MAKEOPTS+=" -j1"
my_src_compile () {
local openblas_flags=$(get_openblas_flags)
- local profname=$(fortran-int64_get_profname)
- local libname="${profname//-/_}"
- einfo "Compiling profile ${profname}"
# cflags already defined twice
- unset CFLAGS
- emake clean
- emake libs shared ${openblas_flags}
- mkdir -p libs && mv libopenblas* libs/
+ unset CFLAGS || die
+ emake clean && emake libs shared ${openblas_flags}
+ mkdir -p libs && mv libopenblas* libs/ || die
# avoid pic when compiling static libraries, so re-compiling
if use static-libs; then
emake clean
emake libs ${openblas_flags} NO_SHARED=1 NEED_PIC=
- mv libopenblas* libs/
+ mv libopenblas* libs/ || die
fi
# Fix Bug 524612 - [science overlay] sci-libs/openblas-0.2.11 - Assembler messages:
# ../kernel/x86_64/gemm_kernel_8x4_barcelona.S:451: Error: missing ')'
@@ -138,79 +115,64 @@ src_compile() {
# assembler code as the assembler does not understand sizeof(float). So
# delay applying the patch until after building the libraries.
epatch "${FILESDIR}/${PN}-0.2.11-openblas_config_header_same_between_ABIs.patch"
- rm -f config.h config_last.h
+ rm -f config.h config_last.h || die
# Note: prints this spurious warning: make: Nothing to be done for 'config.h'.
emake config.h
cp config.h config_last.h || die
- cat <<-EOF > ${profname}.pc
- prefix=${EPREFIX}/usr
- libdir=\${prefix}/$(get_libdir)
- includedir=\${prefix}/include
- Name: ${profname}
- Description: ${DESCRIPTION}
- Version: ${PV}
- URL: ${HOMEPAGE}
- Libs: -L\${libdir} -l${libname}
- Libs.private: -lm
- EOF
- local openblas_abi_cflags=$(get_openblas_abi_cflags)
- local openblas_abi_fflags=$(fortran-int64_get_fortran_int64_abi_fflags)
- cat <<-EOF >> ${profname}.pc
- Cflags: -I\${includedir}/${PN} ${openblas_abi_cflags}
- Fflags=${openblas_abi_fflags}
- EOF
+
mv libs/libopenblas* . || die
}
- multibuild_foreach_variant run_in_build_dir fortran-int64_multilib_multibuild_wrapper my_src_compile
+ numeric-int64-multibuild_foreach_all_abi_variants run_in_build_dir my_src_compile
}
src_test() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
my_src_test () {
local openblas_flags=$(get_openblas_flags)
emake tests ${openblas_flags}
}
- multibuild_foreach_variant run_in_build_dir fortran-int64_multilib_multibuild_wrapper my_src_test
+ numeric-int64-multibuild_foreach_all_abi_variants run_in_build_dir my_src_test
}
src_install() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
my_src_install() {
local openblas_flags=$(get_openblas_flags)
- local profname=$(fortran-int64_get_profname)
+ local profname=$(numeric-int64_get_module_name)
local pcfile
- for pcfile in *.pc; do
- local profname=${pcfile%.pc}
- # The file /usr/include/openblas/openblas_config.h is generated during the install.
- # The sed on config_last.h removes the #define's OPENBLAS_USE64BITINT
- # OPENBLASS__32BIT__ OPENBLASS__64BIT__ OPENBLAS__ARCH_X86 OPENBLAS__ARCH_X86_64
- # from /usr/include/openblas/openblas_config.h. We then specify it in Cflags in
- # the /usr/lib64/pkg-config/openblas-int64-{threads,openmp}.pc file.
- sed -e '/#define USE64BITINT/d' \
- -e '/#define ARCH_X86/d' \
- -e '/#define __\(32\|64\)BIT__/d' \
- -i config_last.h \
- || die "Could not ensure there is no definition of USE64BITINT in config_last.h"
- emake install \
- PREFIX="${ED}"usr ${openblas_flags} \
- OPENBLAS_INCLUDE_DIR="${ED}"usr/include/${PN} \
- OPENBLAS_LIBRARY_DIR="${ED}"usr/$(get_libdir)
- use static-libs || rm "${ED}"usr/$(get_libdir)/lib*.a
- alternatives_for $(fortran-int64_get_blas_provider) ${profname} 0 \
- /usr/$(get_libdir)/pkgconfig/$(fortran-int64_get_blas_provider).pc ${pcfile}
- alternatives_for $(fortran-int64_get_cblas_provider) ${profname} 0 \
- /usr/$(get_libdir)/pkgconfig/$(fortran-int64_get_cblas_provider).pc ${pcfile} \
- /usr/include/cblas.h ${PN}/cblas.h
- insinto /usr/$(get_libdir)/pkgconfig
- doins ${pcfile}
- done
+ # The file /usr/include/openblas/openblas_config.h is generated during the install.
+ # The sed on config_last.h removes the #define's OPENBLAS_USE64BITINT
+ # OPENBLASS__32BIT__ OPENBLASS__64BIT__ OPENBLAS__ARCH_X86 OPENBLAS__ARCH_X86_64
+ # from /usr/include/openblas/openblas_config.h. We then specify it in Cflags in
+ # the /usr/lib64/pkg-config/openblas-int64-{threads,openmp}.pc file.
+ sed -e '/#define USE64BITINT/d' \
+ -e '/#define ARCH_X86/d' \
+ -e '/#define __\(32\|64\)BIT__/d' \
+ -i config_last.h \
+ || die "Could not ensure there is no definition of USE64BITINT in config_last.h"
+ emake install \
+ PREFIX="${ED}"usr ${openblas_flags} \
+ OPENBLAS_INCLUDE_DIR="${ED}"usr/include/${PN} \
+ OPENBLAS_LIBRARY_DIR="${ED}"usr/$(get_libdir)
+ if ! use static-libs; then
+ rm "${ED}"usr/$(get_libdir)/lib*.a || die
+ fi
+
+ local openblas_abi_cflags=$(get_openblas_abi_cflags)
+ local openblas_abi_fflags=$(numeric-int64_get_fortran_int64_abi_fflags)
+ local libname="${profname//-/_}"
+
+ create_pkgconfig \
+ --name "${profname}" \
+ --libs "-L\${libdir} -l${libname}" \
+ --libs-private "-lm" \
+ --cflags "-I\${includedir}/${PN} ${openblas_abi_cflags}" \
+ ${profname}
if [[ ${CHOST} == *-darwin* ]] ; then
- cd "${ED}"/usr/$(get_libdir)
+ cd "${ED}"/usr/$(get_libdir) || die
local d
- for d in *.dylib ; do
+ for d in *.dylib; do
ebegin "Correcting install_name of ${d}"
- install_name_tool -id "${EPREFIX}/usr/$(get_libdir)/${d}" "${d}"
+ install_name_tool -id "${EPREFIX}/usr/$(get_libdir)/${d}" "${d}" || die
eend $?
done
fi
@@ -219,9 +181,13 @@ src_install() {
multilib_check_headers
fi
}
- multibuild_foreach_variant run_in_build_dir fortran-int64_multilib_multibuild_wrapper my_src_install
+ numeric-int64-multibuild_foreach_all_abi_variants run_in_build_dir my_src_install
+
+ printf "/usr/include/cblas.h ${PN}/cblas.h" > "${T}"/alternative-cblas-generic.sh || die
+ numeric-int64-multibuild_install_alternative blas ${NUMERIC_MODULE_NAME}
+ numeric-int64-multibuild_install_alternative cblas ${NUMERIC_MODULE_NAME}
+
multilib_install_wrappers
- dodoc GotoBLAS_{01Readme,03FAQ,04FAQ,05LargePage,06WeirdPerformance}.txt
- dodoc *md Changelog.txt
+ dodoc GotoBLAS_{01Readme,03FAQ,04FAQ,05LargePage,06WeirdPerformance}.txt *md Changelog.txt
}
diff --git a/sci-libs/openblas/openblas-0.2.8.ebuild b/sci-libs/openblas/openblas-0.2.8.ebuild
deleted file mode 100644
index 05c420fa3..000000000
--- a/sci-libs/openblas/openblas-0.2.8.ebuild
+++ /dev/null
@@ -1,126 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-inherit eutils multilib toolchain-funcs alternatives-2 multilib fortran-2
-
-DESCRIPTION="Optimized BLAS library based on GotoBLAS2"
-HOMEPAGE="http://xianyi.github.com/OpenBLAS/"
-SRC_URI="http://github.com/xianyi/OpenBLAS/tarball/v${PV} -> ${P}.tar.gz"
-KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~ppc-macos ~x64-macos"
-
-LICENSE="BSD"
-SLOT="0"
-
-IUSE="int64 dynamic openmp static-libs threads"
-
-RDEPEND=""
-DEPEND="${RDEPEND}"
-
-src_unpack() {
- default
- find "${WORKDIR}" -maxdepth 1 -type d -name \*OpenBLAS\* && \
- mv "${WORKDIR}"/*OpenBLAS* "${S}"
-}
-
-src_configure() {
- # lapack and lapacke are not modified from upstream lapack
- sed -i \
- -e "s:^#\s*\(CC\)\s*=.*:\1=$(tc-getCC):" \
- -e "s:^#\s*\(FC\)\s*=.*:\1=$(tc-getFC):" \
- -e "s:^#\s*\(COMMON_OPT\)\s*=.*:\1=${CFLAGS}:" \
- -e "s:^#\s*\(NO_LAPACK\)\s*=.*:\1=1:" \
- -e "s:^#\s*\(NO_LAPACKE\)\s*=.*:\1=1:" \
- Makefile.rule || die
-}
-
-openblas_compile() {
- local profname=$1
- einfo "Compiling profile ${profname}"
- # cflags already defined twice
- unset CFLAGS
- emake clean
- emake libs shared ${openblas_flags}
- mkdir -p libs && mv libopenblas* libs/
- # avoid pic when compiling static libraries, so re-compiling
- if use static-libs; then
- emake clean
- emake libs ${openblas_flags} NO_SHARED=1 NEED_PIC=
- mv libopenblas* libs/
- fi
- cat <<-EOF > ${profname}.pc
- prefix=${EPREFIX}/usr
- libdir=\${prefix}/$(get_libdir)
- includedir=\${prefix}/include
- Name: ${PN}
- Description: ${DESCRIPTION}
- Version: ${PV}
- URL: ${HOMEPAGE}
- Libs: -L\${libdir} -lopenblas
- Libs.private: -lm
- Cflags: -I\${includedir}/${PN}
- EOF
-}
-
-src_compile() {
- # openblas already does multi-jobs
- MAKEOPTS+=" -j1"
- openblas_flags=""
- local openblas_name=openblas
- use dynamic && \
- openblas_name+="-dynamic" && \
- openblas_flags+=" DYNAMIC_ARCH=1 TARGET=GENERIC NUM_THREADS=64 NO_AFFINITY=1"
- use int64 && \
- openblas_name+="-int64" && \
- openblas_flags+=" INTERFACE64=1"
-
- # choose posix threads over openmp when the two are set
- # yet to see the need of having the two profiles simultaneously
- if use threads; then
- openblas_name+="-threads"
- openblas_flags+=" USE_THREAD=1 USE_OPENMP=0"
- elif use openmp; then
- openblas_name+="-openmp"
- openblas_flags+=" USE_THREAD=0 USE_OPENMP=1"
- fi
- openblas_compile ${openblas_name}
- mv libs/libopenblas* . || die
-}
-
-src_test() {
- emake tests ${openblas_flags}
-}
-
-src_install() {
- local pcfile
- for pcfile in *.pc; do
- local profname=${pcfile%.pc}
- emake install \
- PREFIX="${ED}"usr ${openblas_flags} \
- OPENBLAS_INCLUDE_DIR="${ED}"usr/include/${PN} \
- OPENBLAS_LIBRARY_DIR="${ED}"usr/$(get_libdir)
- use static-libs || rm "${ED}"usr/$(get_libdir)/lib*.a
- alternatives_for blas ${profname} 0 \
- /usr/$(get_libdir)/pkgconfig/blas.pc ${pcfile}
- alternatives_for cblas ${profname} 0 \
- /usr/$(get_libdir)/pkgconfig/cblas.pc ${pcfile} \
- /usr/include/cblas.h ${PN}/cblas.h
- insinto /usr/$(get_libdir)/pkgconfig
- doins ${pcfile}
- done
-
- dodoc GotoBLAS_{01Readme,03FAQ,04FAQ,05LargePage,06WeirdPerformance}.txt
- dodoc *md Changelog.txt
-
- if [[ ${CHOST} == *-darwin* ]] ; then
- cd "${ED}"/usr/$(get_libdir)
- local d
- for d in *.dylib ; do
- ebegin "Correcting install_name of ${d}"
- install_name_tool -id "${EPREFIX}/usr/$(get_libdir)/${d}" "${d}"
- eend $?
- done
- fi
-}
diff --git a/sci-libs/openblas/openblas-9999.ebuild b/sci-libs/openblas/openblas-9999.ebuild
index 91736c817..25ccea3c8 100644
--- a/sci-libs/openblas/openblas-9999.ebuild
+++ b/sci-libs/openblas/openblas-9999.ebuild
@@ -4,32 +4,24 @@
EAPI=5
-EBASE_PROFNAME="openblas"
-inherit alternatives-2 eutils multilib fortran-2 multibuild multilib-build toolchain-funcs fortran-int64
-
-SRC_URI+="http://dev.gentoo.org/~gienah/distfiles/${PN}-0.2.11-gentoo.patch"
-if [[ ${PV} == "9999" ]] ; then
- EGIT_REPO_URI="https://github.com/xianyi/OpenBLAS.git"
- EGIT_BRANCH="develop"
- inherit git-r3
- KEYWORDS=""
-else
- SRC_URI+=" http://github.com/xianyi/OpenBLAS/tarball/v${PV} -> ${P}.tar.gz"
- KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~ppc-macos ~x64-macos"
-fi
+NUMERIC_MODULE_NAME="openblas"
+
+inherit alternatives-2 git-r3 numeric numeric-int64-multibuild
DESCRIPTION="Optimized BLAS library based on GotoBLAS2"
HOMEPAGE="http://xianyi.github.com/OpenBLAS/"
+SRC_URI="http://dev.gentoo.org/~gienah/distfiles/${PN}-0.2.11-gentoo.patch"
+EGIT_REPO_URI="https://github.com/xianyi/OpenBLAS.git"
+EGIT_BRANCH="develop"
+
LICENSE="BSD"
SLOT="0"
-IUSE="dynamic int64 openmp static-libs threads"
+KEYWORDS=""
+IUSE="dynamic openmp static-libs threads"
RDEPEND=""
DEPEND="${RDEPEND}
virtual/pkgconfig"
-PDEPEND="
- >=virtual/blas-2.1-r2[int64?]
- >=virtual/cblas-2.0-r1[int64?]"
MULTILIB_WRAPPED_HEADERS=(
/usr/include/openblas/cblas.h
@@ -38,69 +30,53 @@ MULTILIB_WRAPPED_HEADERS=(
)
get_openblas_flags() {
- local openblas_flags=""
+ local openblas_flags=()
use dynamic && \
- openblas_flags+=" DYNAMIC_ARCH=1 TARGET=GENERIC NUM_THREADS=64 NO_AFFINITY=1"
- $(fortran-int64_is_int64_build) && \
- openblas_flags+=" INTERFACE64=1"
+ openblas_flags+=( DYNAMIC_ARCH=1 TARGET=GENERIC NUM_THREADS=64 NO_AFFINITY=1 )
+ $(numeric-int64_is_int64_build) && \
+ openblas_flags+=( INTERFACE64=1 )
# choose posix threads over openmp when the two are set
# yet to see the need of having the two profiles simultaneously
if use threads; then
- openblas_flags+=" USE_THREAD=1 USE_OPENMP=0"
+ openblas_flags+=( USE_THREAD=1 USE_OPENMP=0 )
elif use openmp; then
- openblas_flags+=" USE_OPENMP=1"
+ openblas_flags+=( USE_OPENMP=1 )
fi
- local profname=$(fortran-int64_get_profname)
+ local profname=$(numeric-int64_get_module_name)
local libname="${profname//-/_}"
local underscoresuffix="${libname#${PN}}"
if [[ "${underscoresuffix}" != "_" ]]; then
local libnamesuffix="${underscoresuffix#_}"
- openblas_flags+=" LIBNAMESUFFIX=${libnamesuffix}"
+ openblas_flags+=( LIBNAMESUFFIX=${libnamesuffix} )
fi
- echo "${openblas_flags}"
+ echo "${openblas_flags[@]}"
}
get_openblas_abi_cflags() {
- local openblas_abi_cflags=""
+ local openblas_abi_cflags=()
if [[ "${ABI}" == "x86" ]]; then
- openblas_abi_cflags="-DOPENBLAS_ARCH_X86=1 -DOPENBLAS___32BIT__=1"
- else
- openblas_abi_cflags="-DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1"
- fi
- $(fortran-int64_is_int64_build) && \
- openblas_abi_cflags+=" -DOPENBLAS_USE64BITINT"
- echo "${openblas_abi_cflags}"
-}
-
-src_unpack() {
- if [[ ${PV} == "9999" ]] ; then
- git-r3_src_unpack
+ openblas_abi_cflags=( -DOPENBLAS_ARCH_X86=1 -DOPENBLAS___32BIT__=1 )
else
- default
- if [[ ${PV} != "9999" ]] ; then
- find "${WORKDIR}" -maxdepth 1 -type d -name \*OpenBLAS\* && \
- mv "${WORKDIR}"/*OpenBLAS* "${S}"
- fi
+ openblas_abi_cflags=( -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 )
fi
+ $(numeric-int64_is_int64_build) && \
+ openblas_abi_cflags+=( -DOPENBLAS_USE64BITINT )
+ echo "${openblas_abi_cflags[@]}"
}
src_prepare() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
epatch "${DISTDIR}/${PN}-0.2.11-gentoo.patch"
- if [[ ${PV} == "0.2.11" ]] ; then
- epatch "${FILESDIR}/${PN}-0.2.11-cpuid_x86.patch"
- fi
+
# lapack and lapacke are not modified from upstream lapack
sed \
-e "s:^#\s*\(NO_LAPACK\)\s*=.*:\1=1:" \
-e "s:^#\s*\(NO_LAPACKE\)\s*=.*:\1=1:" \
-i Makefile.rule || die
- multibuild_copy_sources
+ numeric-int64-multibuild_copy_sources
}
src_configure() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
- my_configure() {
+ blas_configure() {
local openblas_abi_cflags="$(get_openblas_abi_cflags)"
local internal_openblas_abi_cflags="${openblas_abi_cflags//OPENBLAS_}"
sed \
@@ -109,28 +85,23 @@ src_configure() {
-e "s:^#\s*\(COMMON_OPT\)\s*=.*:\1=${CFLAGS} ${internal_openblas_abi_cflags}:" \
-i Makefile.rule || die
}
- multibuild_foreach_variant run_in_build_dir fortran-int64_multilib_multibuild_wrapper my_configure
+ numeric-int64-multibuild_foreach_all_abi_variants run_in_build_dir blas_configure
}
src_compile() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
# openblas already does multi-jobs
MAKEOPTS+=" -j1"
my_src_compile () {
local openblas_flags=$(get_openblas_flags)
- local profname=$(fortran-int64_get_profname)
- local libname="${profname//-/_}"
- einfo "Compiling profile ${profname}"
# cflags already defined twice
- unset CFLAGS
- emake clean
- emake libs shared ${openblas_flags}
- mkdir -p libs && mv libopenblas* libs/
+ unset CFLAGS || die
+ emake clean && emake libs shared ${openblas_flags}
+ mkdir -p libs && mv libopenblas* libs/ || die
# avoid pic when compiling static libraries, so re-compiling
if use static-libs; then
emake clean
emake libs ${openblas_flags} NO_SHARED=1 NEED_PIC=
- mv libopenblas* libs/
+ mv libopenblas* libs/ || die
fi
# Fix Bug 524612 - [science overlay] sci-libs/openblas-0.2.11 - Assembler messages:
# ../kernel/x86_64/gemm_kernel_8x4_barcelona.S:451: Error: missing ')'
@@ -138,79 +109,64 @@ src_compile() {
# assembler code as the assembler does not understand sizeof(float). So
# delay applying the patch until after building the libraries.
epatch "${FILESDIR}/${PN}-0.2.11-openblas_config_header_same_between_ABIs.patch"
- rm -f config.h config_last.h
+ rm -f config.h config_last.h || die
# Note: prints this spurious warning: make: Nothing to be done for 'config.h'.
emake config.h
cp config.h config_last.h || die
- cat <<-EOF > ${profname}.pc
- prefix=${EPREFIX}/usr
- libdir=\${prefix}/$(get_libdir)
- includedir=\${prefix}/include
- Name: ${profname}
- Description: ${DESCRIPTION}
- Version: ${PV}
- URL: ${HOMEPAGE}
- Libs: -L\${libdir} -l${libname}
- Libs.private: -lm
- EOF
- local openblas_abi_cflags=$(get_openblas_abi_cflags)
- local openblas_abi_fflags=$(fortran-int64_get_fortran_int64_abi_fflags)
- cat <<-EOF >> ${profname}.pc
- Cflags: -I\${includedir}/${PN} ${openblas_abi_cflags}
- Fflags=${openblas_abi_fflags}
- EOF
+
mv libs/libopenblas* . || die
}
- multibuild_foreach_variant run_in_build_dir fortran-int64_multilib_multibuild_wrapper my_src_compile
+ numeric-int64-multibuild_foreach_all_abi_variants run_in_build_dir my_src_compile
}
src_test() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
my_src_test () {
local openblas_flags=$(get_openblas_flags)
emake tests ${openblas_flags}
}
- multibuild_foreach_variant run_in_build_dir fortran-int64_multilib_multibuild_wrapper my_src_test
+ numeric-int64-multibuild_foreach_all_abi_variants run_in_build_dir my_src_test
}
src_install() {
- local MULTIBUILD_VARIANTS=( $(fortran-int64_multilib_get_enabled_abis) )
my_src_install() {
local openblas_flags=$(get_openblas_flags)
- local profname=$(fortran-int64_get_profname)
+ local profname=$(numeric-int64_get_module_name)
local pcfile
- for pcfile in *.pc; do
- local profname=${pcfile%.pc}
- # The file /usr/include/openblas/openblas_config.h is generated during the install.
- # The sed on config_last.h removes the #define's OPENBLAS_USE64BITINT
- # OPENBLASS__32BIT__ OPENBLASS__64BIT__ OPENBLAS__ARCH_X86 OPENBLAS__ARCH_X86_64
- # from /usr/include/openblas/openblas_config.h. We then specify it in Cflags in
- # the /usr/lib64/pkg-config/openblas-int64-{threads,openmp}.pc file.
- sed -e '/#define USE64BITINT/d' \
- -e '/#define ARCH_X86/d' \
- -e '/#define __\(32\|64\)BIT__/d' \
- -i config_last.h \
- || die "Could not ensure there is no definition of USE64BITINT in config_last.h"
- emake install \
- PREFIX="${ED}"usr ${openblas_flags} \
- OPENBLAS_INCLUDE_DIR="${ED}"usr/include/${PN} \
- OPENBLAS_LIBRARY_DIR="${ED}"usr/$(get_libdir)
- use static-libs || rm "${ED}"usr/$(get_libdir)/lib*.a
- alternatives_for $(fortran-int64_get_blas_provider) ${profname} 0 \
- /usr/$(get_libdir)/pkgconfig/$(fortran-int64_get_blas_provider).pc ${pcfile}
- alternatives_for $(fortran-int64_get_cblas_provider) ${profname} 0 \
- /usr/$(get_libdir)/pkgconfig/$(fortran-int64_get_cblas_provider).pc ${pcfile} \
- /usr/include/cblas.h ${PN}/cblas.h
- insinto /usr/$(get_libdir)/pkgconfig
- doins ${pcfile}
- done
+ # The file /usr/include/openblas/openblas_config.h is generated during the install.
+ # The sed on config_last.h removes the #define's OPENBLAS_USE64BITINT
+ # OPENBLASS__32BIT__ OPENBLASS__64BIT__ OPENBLAS__ARCH_X86 OPENBLAS__ARCH_X86_64
+ # from /usr/include/openblas/openblas_config.h. We then specify it in Cflags in
+ # the /usr/lib64/pkg-config/openblas-int64-{threads,openmp}.pc file.
+ sed -e '/#define USE64BITINT/d' \
+ -e '/#define ARCH_X86/d' \
+ -e '/#define __\(32\|64\)BIT__/d' \
+ -i config_last.h \
+ || die "Could not ensure there is no definition of USE64BITINT in config_last.h"
+ emake install \
+ PREFIX="${ED}"usr ${openblas_flags} \
+ OPENBLAS_INCLUDE_DIR="${ED}"usr/include/${PN} \
+ OPENBLAS_LIBRARY_DIR="${ED}"usr/$(get_libdir)
+ if ! use static-libs; then
+ rm "${ED}"usr/$(get_libdir)/lib*.a || die
+ fi
+
+ local openblas_abi_cflags=$(get_openblas_abi_cflags)
+ local openblas_abi_fflags=$(numeric-int64_get_fortran_int64_abi_fflags)
+ local libname="${profname//-/_}"
+
+ create_pkgconfig \
+ --name "${profname}" \
+ --libs "-L\${libdir} -l${libname}" \
+ --libs-private "-lm" \
+ --cflags "-I\${includedir}/${PN} ${openblas_abi_cflags}" \
+ ${profname}
if [[ ${CHOST} == *-darwin* ]] ; then
- cd "${ED}"/usr/$(get_libdir)
+ cd "${ED}"/usr/$(get_libdir) || die
local d
- for d in *.dylib ; do
+ for d in *.dylib; do
ebegin "Correcting install_name of ${d}"
- install_name_tool -id "${EPREFIX}/usr/$(get_libdir)/${d}" "${d}"
+ install_name_tool -id "${EPREFIX}/usr/$(get_libdir)/${d}" "${d}" || die
eend $?
done
fi
@@ -219,9 +175,13 @@ src_install() {
multilib_check_headers
fi
}
- multibuild_foreach_variant run_in_build_dir fortran-int64_multilib_multibuild_wrapper my_src_install
+ numeric-int64-multibuild_foreach_all_abi_variants run_in_build_dir my_src_install
+
+ printf "/usr/include/cblas.h ${PN}/cblas.h" > "${T}"/alternative-cblas-generic.sh
+ numeric-int64-multibuild_install_alternative blas ${NUMERIC_MODULE_NAME}
+ numeric-int64-multibuild_install_alternative cblas ${NUMERIC_MODULE_NAME}
+
multilib_install_wrappers
- dodoc GotoBLAS_{01Readme,03FAQ,04FAQ,05LargePage,06WeirdPerformance}.txt
- dodoc *md Changelog.txt
+ dodoc GotoBLAS_{01Readme,03FAQ,04FAQ,05LargePage,06WeirdPerformance}.txt *md Changelog.txt
}