aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2015-11-30 10:53:04 +0100
committerJustin Lecher <jlec@gentoo.org>2015-11-30 10:53:04 +0100
commitb732e197ccd3fac26ad8fe3d74864688471b9128 (patch)
tree60bec8ec241b5a97cba22c087020f77c39d2b600
parentalternatives-2.eclass: Fix docs string for man pages (diff)
downloadsci-b732e197.tar.gz
sci-b732e197.tar.bz2
sci-b732e197.zip
sci-libs/openblas: Version Bump
Package-Manager: portage-2.2.25 Signed-off-by: Justin Lecher <jlec@gentoo.org>
-rw-r--r--sci-libs/openblas/Manifest4
-rw-r--r--sci-libs/openblas/openblas-0.2.15.ebuild193
2 files changed, 194 insertions, 3 deletions
diff --git a/sci-libs/openblas/Manifest b/sci-libs/openblas/Manifest
index c32e9aeaf..30a864f7d 100644
--- a/sci-libs/openblas/Manifest
+++ b/sci-libs/openblas/Manifest
@@ -1,5 +1,3 @@
DIST openblas-0.2.11-gentoo.patch 246353 SHA256 68c13526f37bf510f02961eb3a7918feb98f6bb10a0d888b8575b9146fd56c09 SHA512 4d8fcec9e44f873c31214d48492a171dd00dc18524a7ab51e51fa27c038b62bfd07be281b5af899943e10fb45c6d0b5b704ba3fa93c6bec74aca0a3a6c0f48ab WHIRLPOOL a4b1078f6ba06a6530a9267d950df8824abccd41aa432ce6568641329f828cc1abea7324f588b0b3d1d3339c36b79ea7147d64f0c8b27d12f87bf8be2a97e92a
-DIST openblas-0.2.11.tar.gz 9765198 SHA256 babe5898c05da8a95249c1b038f7fbe14a95e35fee75358d649009f93ef444ed SHA512 4b7928613356848628c0230dc5990d269a3899beb700617cd385529aa5c26f0d0063081a25cbd8ab924d41b5f8a079385e12da3e156d784406290c5c0c40a0e2 WHIRLPOOL 66d0895c76b02625354db157319ee12be62928d2f9ea4241e898e227f466fcbed496e934f413a570c3a105e7d75973b2af9cbabc8a9c78922f240f6bddf36160
-DIST openblas-0.2.12.tar.gz 9852709 SHA256 0f1727700e3991aea6d4dab11daa1254603b19a73df0a2eb474f6db7bc6d090d SHA512 ab00eecef89fc40d7b298958b261d76fcb1d8f26970d24d663bf27f1c6b258d952da6bc2565d905e9267cd97e5450025f2a80a8bffabd202e99f35d40c1e412d WHIRLPOOL 253617f204564b480ac96e53e3edfee4044537c26e98bafee47226dc619852910dbc548a44cdf9c78aa044e05930c295b127accd816778d65987bc9d11a7f2f4
DIST openblas-0.2.14.tar.gz 9862952 SHA256 aba5088534719cefd77e4155c281c56a3accd3eea218574c2c3d236952bb632b SHA512 5028c0cae1eea168593d951c053d2c3692ea4bf34257b2d6cd533d43dd98d1e4ab982f56c57232e53dcc358a2f8e1e51e15a746235ff6eb64d427a97b1449b60 WHIRLPOOL 2fe8a6afee19327deb962dd9f270b2c3dbf0ee8c92d59050fec4f0d4bacdf1d97801f28a1127804e8464c3c19d7e40b293c3b4d5b5b7e43f0061346c03909e64
-DIST openblas-0.2.8.tar.gz 9471072 SHA256 048986f4e0a8d480c5e6d439915738f3298f2629d6a399a1ddb16e1629b07901 SHA512 590ffc77377e3d40f91bd91156554140da0f3eee334098cfdbd53d427173cd4374eca0f8f9a167054ea88bdcc1b3a685a6ecdc5fd70f3df0ad267d569049db79 WHIRLPOOL 550fab60c2dc8e6e94b7d5d6c5e05b19c297b63495521667e5abde087713fcc678f4be31641eaf5354a6dae1f8229cade361c35f70309f947c02fb8c5fe49f59
+DIST openblas-0.2.15.tar.gz 9968430 SHA256 fe32d7977e9a2dddcd6e9c5350683b5e3cc3d59afdd432e9a5989449e536aecc SHA512 7c95de975b4dc4a1277289be4f44e8af01eea93886fd1f278c28ffa7d543310ec7b81c897928f7c6a0905bc6f9aa6f63cb18e2843cf5b47806379a4e499577b7 WHIRLPOOL ba9b39a9f0708608213bc681808c1c36922606bc6180961b53c7d67d9429bb6fc59bd91f44158eb5cafbb5242a0c53b2b95935ba1f0bbf504f869ec7fd57dc96
diff --git a/sci-libs/openblas/openblas-0.2.15.ebuild b/sci-libs/openblas/openblas-0.2.15.ebuild
new file mode 100644
index 000000000..3a92aef0f
--- /dev/null
+++ b/sci-libs/openblas/openblas-0.2.15.ebuild
@@ -0,0 +1,193 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+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"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~ppc-macos ~x64-macos"
+IUSE="dynamic openmp static-libs threads"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+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 )
+ $(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 )
+ elif use openmp; then
+ openblas_flags+=( USE_OPENMP=1 )
+ fi
+ local profname=$(numeric-int64_get_module_name)
+ 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
+ $(numeric-int64_is_int64_build) && \
+ openblas_abi_cflags+=( -DOPENBLAS_USE64BITINT )
+ echo "${openblas_abi_cflags[@]}"
+}
+
+src_unpack() {
+ default
+ find "${WORKDIR}" -maxdepth 1 -type d -name \*OpenBLAS\* && \
+ mv "${WORKDIR}"/*OpenBLAS* "${S}" || die
+}
+
+src_prepare() {
+ epatch "${DISTDIR}/${PN}-0.2.11-gentoo.patch"
+
+ # 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
+ numeric-int64-multibuild_copy_sources
+}
+
+src_configure() {
+ blas_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
+ }
+ numeric-int64-multibuild_foreach_all_abi_variants run_in_build_dir blas_configure
+}
+
+src_compile() {
+ # openblas already does multi-jobs
+ MAKEOPTS+=" -j1"
+ my_src_compile () {
+ local openblas_flags=$(get_openblas_flags)
+ # cflags already defined twice
+ 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/ || 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 ')'
+ # 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 || die
+ # Note: prints this spurious warning: make: Nothing to be done for 'config.h'.
+ emake config.h
+ cp config.h config_last.h || die
+
+ mv libs/libopenblas* . || die
+ }
+ numeric-int64-multibuild_foreach_all_abi_variants run_in_build_dir my_src_compile
+}
+
+src_test() {
+ my_src_test () {
+ local openblas_flags=$(get_openblas_flags)
+ emake tests ${openblas_flags}
+ }
+ numeric-int64-multibuild_foreach_all_abi_variants run_in_build_dir my_src_test
+}
+
+src_install() {
+ my_src_install() {
+ local openblas_flags=$(get_openblas_flags)
+ local profname=$(numeric-int64_get_module_name)
+ local pcfile
+ # 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) || die
+ local d
+ for d in *.dylib; do
+ ebegin "Correcting install_name of ${d}"
+ install_name_tool -id "${EPREFIX}/usr/$(get_libdir)/${d}" "${d}" || die
+ eend $?
+ done
+ fi
+ if [[ ${#MULTIBUILD_VARIANTS[@]} -gt 1 ]]; then
+ multilib_prepare_wrappers
+ multilib_check_headers
+ fi
+ }
+ 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 *md Changelog.txt
+}