diff options
author | gienah <gienah@gentoo.org> | 2014-09-07 02:45:21 +1000 |
---|---|---|
committer | gienah <gienah@gentoo.org> | 2014-09-27 21:10:07 +1000 |
commit | 75c97de4f10002856e8a7964c9123856e6aadf38 (patch) | |
tree | 58200fdeb5608b1cb37c8d42d9534c27bcf81009 /sci-libs/openblas | |
parent | Add int64 use flag for separate eselect modules for int64 providers (diff) | |
download | sci-75c97de4f10002856e8a7964c9123856e6aadf38.tar.gz sci-75c97de4f10002856e8a7964c9123856e6aadf38.tar.bz2 sci-75c97de4f10002856e8a7964c9123856e6aadf38.zip |
Add >=virtual/blas-2.1-r2[int64?] and >=virtual/cblas-2.0-r1[int64?] to RDEPEND. Use separate eselect modules for blas, blas-int64, cblas and cblas-int64. Bump to 0.2.11 using multi build. Remove openblas-9999-cpuid_x86.patch as a similar change has been applied by upstream. Tweak the openblas_config.h file to be the same between ABIs.
Diffstat (limited to 'sci-libs/openblas')
-rw-r--r-- | sci-libs/openblas/ChangeLog | 18 | ||||
-rw-r--r-- | sci-libs/openblas/Manifest | 3 | ||||
-rw-r--r-- | sci-libs/openblas/files/openblas-0.2.11-openblas_config_header_same_between_ABIs.patch | 21 | ||||
l--------- | sci-libs/openblas/openblas-0.2.11.ebuild | 1 | ||||
-rw-r--r-- | sci-libs/openblas/openblas-9999.ebuild | 104 |
5 files changed, 121 insertions, 26 deletions
diff --git a/sci-libs/openblas/ChangeLog b/sci-libs/openblas/ChangeLog index 68e095525..9f9c82ebc 100644 --- a/sci-libs/openblas/ChangeLog +++ b/sci-libs/openblas/ChangeLog @@ -2,6 +2,24 @@ # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 06 Sep 2014; Mark Wright <gienah@gentoo.org> +openblas-0.2.11.ebuild, + openblas-9999.ebuild, + +files/openblas-0.2.11-openblas_config_header_same_between_ABIs.patch, + -files/openblas-9999-cpuid_x86.patch: + Remove openblas-9999-cpuid_x86.patch as a similar change has been applied by + upstream. Tweak the openblas_config.h file to be the same between ABIs. + +*openblas-0.2.11 (30 Aug 2014) + + 30 Aug 2014; Mark Wright <gienah@gentoo.org> +openblas-0.2.11.ebuild, + openblas-9999.ebuild: + Bump to 0.2.11 using multi build + + 26 Apr 2014; Mark Wright <gienah@gentoo.org> openblas-9999.ebuild: + Add >=virtual/blas-2.1-r2[int64?] and >=virtual/cblas-2.0-r1[int64?] to + RDEPEND. Use separate eselect modules for blas, blas-int64, cblas and + cblas-int64. + 19 Feb 2014; Mark Wright <gienah@gentoo.org> openblas-9999.ebuild: Thanks to sfabbro: dodoc should be outside the function, they do not change diff --git a/sci-libs/openblas/Manifest b/sci-libs/openblas/Manifest index 2353709fe..3ac2f965a 100644 --- a/sci-libs/openblas/Manifest +++ b/sci-libs/openblas/Manifest @@ -1,2 +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.8.tar.gz 9471072 SHA256 048986f4e0a8d480c5e6d439915738f3298f2629d6a399a1ddb16e1629b07901 SHA512 590ffc77377e3d40f91bd91156554140da0f3eee334098cfdbd53d427173cd4374eca0f8f9a167054ea88bdcc1b3a685a6ecdc5fd70f3df0ad267d569049db79 WHIRLPOOL 550fab60c2dc8e6e94b7d5d6c5e05b19c297b63495521667e5abde087713fcc678f4be31641eaf5354a6dae1f8229cade361c35f70309f947c02fb8c5fe49f59 -DIST openblas-gentoo.patch 252572 SHA256 284ff5a5d89cdf80688d923a54ca78fb714063ec49388853145acde606d255e9 SHA512 36b090bec3572af06c506ef92b93bc70f1a81e63d9dbf7babef518af70aff75022c34156ac62792193a1d90bbcc2789eb806f0d05f1f1fb03cd18006bab55e33 WHIRLPOOL f2a09aa4e7166cff158ff0863a176fb1521ba00e4b4bc826d750ff9c7350b04342a15750c8b9d5b34eec2f3aed75d27c4a03e6885af42f04200b2403eadd7100 diff --git a/sci-libs/openblas/files/openblas-0.2.11-openblas_config_header_same_between_ABIs.patch b/sci-libs/openblas/files/openblas-0.2.11-openblas_config_header_same_between_ABIs.patch new file mode 100644 index 000000000..7a851116c --- /dev/null +++ b/sci-libs/openblas/files/openblas-0.2.11-openblas_config_header_same_between_ABIs.patch @@ -0,0 +1,21 @@ +--- openblas-0.2.11-orig/getarch_2nd.c 2014-08-18 13:16:14.000000000 +1000 ++++ openblas-0.2.11/getarch_2nd.c 2014-09-01 23:44:07.070560148 +1000 +@@ -64,13 +64,13 @@ + + + if ((argc >= 2) && (*argv[1] == '1')) { +- printf("#define SLOCAL_BUFFER_SIZE\t%ld\n", (SGEMM_DEFAULT_Q * SGEMM_DEFAULT_UNROLL_N * 4 * 1 * sizeof(float))); +- printf("#define DLOCAL_BUFFER_SIZE\t%ld\n", (DGEMM_DEFAULT_Q * DGEMM_DEFAULT_UNROLL_N * 2 * 1 * sizeof(double))); +- printf("#define CLOCAL_BUFFER_SIZE\t%ld\n", (CGEMM_DEFAULT_Q * CGEMM_DEFAULT_UNROLL_N * 4 * 2 * sizeof(float))); +- printf("#define ZLOCAL_BUFFER_SIZE\t%ld\n", (ZGEMM_DEFAULT_Q * ZGEMM_DEFAULT_UNROLL_N * 2 * 2 * sizeof(double))); ++ printf("#define SLOCAL_BUFFER_SIZE\t(SGEMM_DEFAULT_Q*SGEMM_DEFAULT_UNROLL_N*4*1*sizeof(float))\n"); ++ printf("#define DLOCAL_BUFFER_SIZE\t(DGEMM_DEFAULT_Q*DGEMM_DEFAULT_UNROLL_N*2*1*sizeof(double))\n"); ++ printf("#define CLOCAL_BUFFER_SIZE\t(CGEMM_DEFAULT_Q*CGEMM_DEFAULT_UNROLL_N*4*2*sizeof(float))\n"); ++ printf("#define ZLOCAL_BUFFER_SIZE\t(ZGEMM_DEFAULT_Q*ZGEMM_DEFAULT_UNROLL_N*2*2*sizeof(double))\n"); + + #ifdef USE64BITINT +- printf("#define USE64BITINT\n"); ++/* printf("#define USE64BITINT\n"); */ + #endif + printf("#define GEMM_MULTITHREAD_THRESHOLD\t%ld\n", (long int)GEMM_MULTITHREAD_THRESHOLD); + } diff --git a/sci-libs/openblas/openblas-0.2.11.ebuild b/sci-libs/openblas/openblas-0.2.11.ebuild new file mode 120000 index 000000000..2381753b7 --- /dev/null +++ b/sci-libs/openblas/openblas-0.2.11.ebuild @@ -0,0 +1 @@ +openblas-9999.ebuild
\ No newline at end of file diff --git a/sci-libs/openblas/openblas-9999.ebuild b/sci-libs/openblas/openblas-9999.ebuild index f012efdb5..e809907ef 100644 --- a/sci-libs/openblas/openblas-9999.ebuild +++ b/sci-libs/openblas/openblas-9999.ebuild @@ -4,18 +4,30 @@ EAPI=5 -inherit alternatives-2 eutils fortran-2 git-r3 multibuild multilib-build toolchain-funcs +inherit alternatives-2 eutils fortran-2 multibuild multilib-build toolchain-funcs + +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/" -SRC_URI="http://dev.gentoo.org/~bicatali/distfiles/${PN}-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="" + +RDEPEND=" + >=virtual/blas-2.1-r2[int64?] + >=virtual/cblas-2.0-r1[int64?]" +DEPEND="${RDEPEND} + virtual/pkgconfig" INT64_SUFFIX="int64" BASE_PROFNAME="openblas" @@ -60,7 +72,23 @@ get_profname() { echo "${profname}" } -get_libname() { +get_blas_module() { + local module_name="blas" + if [[ "${MULTIBUILD_ID}" =~ "_${INT64_SUFFIX}" ]]; then + module_name+="-${INT64_SUFFIX}" + fi + echo "${module_name}" +} + +get_cblas_module() { + local module_name="cblas" + if [[ "${MULTIBUILD_ID}" =~ "_${INT64_SUFFIX}" ]]; then + module_name+="-${INT64_SUFFIX}" + fi + echo "${module_name}" +} + +get_openblas_libname() { local libname="${BASE_PROFNAME}" if [[ "${MULTIBUILD_ID}" =~ "_${INT64_SUFFIX}" ]]; then libname+="_${INT64_SUFFIX}" @@ -69,11 +97,6 @@ get_libname() { } int64_multilib_get_enabled_abis() { - # The file /usr/include/openblas/openblas_config.h is generated during the install. - # By listing the int64 variant first, the int64 variant /usr/include/openblas/openblas_config.h - # will be overwritten by the normal variant in the install, which removes the - # #define OPENBLAS_USE64BITINT for us. We then specify it in Cflags in the - # /usr/lib64/pkg-config/openblas-int64-{threads,openmp}.pc file. local MULTILIB_VARIANTS=( $(multilib_get_enabled_abis) ) local MULTIBUILD_VARIANTS=( ) for i in "${MULTILIB_VARIANTS[@]}"; do @@ -114,8 +137,26 @@ int64_multilib_copy_sources() { multibuild_copy_sources } +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() { - epatch "${FILESDIR}/${PN}-9999-cpuid_x86.patch" + epatch "${DISTDIR}/${PN}-0.2.11-gentoo.patch" + epatch "${FILESDIR}/${PN}-0.2.11-openblas_config_header_same_between_ABIs.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 local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) ) int64_multilib_copy_sources } @@ -123,13 +164,10 @@ src_prepare() { src_configure() { local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) ) my_configure() { - # lapack and lapacke are not modified from upstream lapack sed \ - -e "s:^#\s*\(CC\)\s*=.*:\1=$(tc-getCC):" \ - -e "s:^#\s*\(FC\)\s*=.*:\1=$(tc-getFC):" \ + -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}:" \ - -e "s:^#\s*\(NO_LAPACK\)\s*=.*:\1=1:" \ - -e "s:^#\s*\(NO_LAPACKE\)\s*=.*:\1=1:" \ -i Makefile.rule || die } multibuild_foreach_variant run_in_build_dir _int64_multilib_multibuild_wrapper my_configure @@ -142,7 +180,7 @@ src_compile() { my_src_compile () { local openblas_flags=$(get_openblas_flags) local profname=$(get_profname) - local libname=$(get_libname) + local libname=$(get_openblas_libname) einfo "Compiling profile ${profname}" # cflags already defined twice unset CFLAGS @@ -166,14 +204,20 @@ src_compile() { Libs: -L\${libdir} -l${libname} Libs.private: -lm EOF + local openblas_abi_defs="" + if [[ "${ABI}" == "x86" ]]; then + openblas_abi_defs="-DOPENBLAS_ARCH_X86=1 -DOPENBLAS___32BIT__=1" + else + openblas_abi_defs="-DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1" + fi if [[ "${MULTIBUILD_ID}" =~ "_${INT64_SUFFIX}" ]]; then cat <<-EOF >> ${profname}.pc - Cflags: -DOPENBLAS_USE64BITINT -I\${includedir}/${PN} + Cflags: -DOPENBLAS_USE64BITINT ${openblas_abi_defs} -I\${includedir}/${PN} Fflags=-fdefault-integer-8 EOF else cat <<-EOF >> ${profname}.pc - Cflags: -I\${includedir}/${PN} + Cflags: -I\${includedir}/${PN} ${openblas_abi_defs} Fflags= EOF fi @@ -199,15 +243,25 @@ src_install() { 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 blas ${profname} 0 \ - /usr/$(get_libdir)/pkgconfig/blas.pc ${pcfile} - alternatives_for cblas ${profname} 0 \ - /usr/$(get_libdir)/pkgconfig/cblas.pc ${pcfile} \ + alternatives_for $(get_blas_module) ${profname} 0 \ + /usr/$(get_libdir)/pkgconfig/$(get_blas_module).pc ${pcfile} + alternatives_for $(get_cblas_module) ${profname} 0 \ + /usr/$(get_libdir)/pkgconfig/$(get_cblas_module).pc ${pcfile} \ /usr/include/cblas.h ${PN}/cblas.h insinto /usr/$(get_libdir)/pkgconfig doins ${pcfile} |