public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/sci:lapack-multibuild commit in: sci-libs/openblas/, sci-libs/openblas/files/
@ 2014-02-23 12:29 Mark Wright
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Wright @ 2014-02-23 12:29 UTC (permalink / raw
  To: gentoo-commits

commit:     f0cad413cc0ca8ca505652fda0d4cb154d631e4c
Author:     gienah <gienah <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 23 12:29:29 2014 +0000
Commit:     Mark Wright <gienah <AT> gentoo <DOT> org>
CommitDate: Sun Feb 23 12:29:29 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=f0cad413

multilib as well for openblas

---
 .../openblas/files/openblas-9999-cpuid_x86.patch   | 27 ++++++++
 sci-libs/openblas/openblas-9999.ebuild             | 78 +++++++++++++++++++---
 2 files changed, 95 insertions(+), 10 deletions(-)

diff --git a/sci-libs/openblas/files/openblas-9999-cpuid_x86.patch b/sci-libs/openblas/files/openblas-9999-cpuid_x86.patch
new file mode 100644
index 0000000..c6f2991
--- /dev/null
+++ b/sci-libs/openblas/files/openblas-9999-cpuid_x86.patch
@@ -0,0 +1,27 @@
+--- openblas-9999-orig/cpuid_x86.c	2014-02-23 15:25:22.199394761 +1100
++++ openblas-9999/cpuid_x86.c	2014-02-23 16:41:02.727372869 +1100
+@@ -57,9 +57,23 @@
+ void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx);
+ #else
+ static inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx){
++#if __x86_64
+   __asm__ __volatile__
+     ("cpuid": "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx) : "a" (op) : "cc");
+-
++#else
++  __asm volatile(
++    "push %%ebx\n\t"
++    "cpuid\n\t"
++    "mov %%ebx, (%4)\n\t"
++    "pop %%ebx"
++    :"=a" (*eax),
++    "=c" (*ecx),
++    "=d" (*edx)
++    :"a" (op),
++    "cc"
++    "S" (ebx)
++    :"memory");
++#endif
+ }
+ #endif
+ 

diff --git a/sci-libs/openblas/openblas-9999.ebuild b/sci-libs/openblas/openblas-9999.ebuild
index 3e3cd52..1c2b6c6 100644
--- a/sci-libs/openblas/openblas-9999.ebuild
+++ b/sci-libs/openblas/openblas-9999.ebuild
@@ -4,7 +4,7 @@
 
 EAPI=5
 
-inherit alternatives-2 eutils fortran-2 git-r3 multilib multibuild toolchain-funcs
+inherit alternatives-2 eutils fortran-2 git-r3 multibuild multilib-build toolchain-funcs
 
 DESCRIPTION="Optimized BLAS library based on GotoBLAS2"
 HOMEPAGE="http://xianyi.github.com/OpenBLAS/"
@@ -20,6 +20,12 @@ KEYWORDS=""
 INT64_SUFFIX="int64"
 BASE_PROFNAME="openblas"
 
+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 && \
@@ -54,23 +60,66 @@ get_profname() {
 	echo "${profname}"
 }
 
-pkg_setup() {
+get_libname() {
+	local libname="${BASE_PROFNAME}"
+	if [[ "${MULTIBUILD_ID}" =~ "_${INT64_SUFFIX}" ]]; then
+		libname+="_${INT64_SUFFIX}"
+	fi
+	echo "${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.
-	MULTIBUILD_VARIANTS=()
+	local MULTIBUILD_VARIANTS=( )
 	use int64 && \
 		MULTIBUILD_VARIANTS+=( ${BASE_PROFNAME}_${INT64_SUFFIX} )
-	MULTIBUILD_VARIANTS+=( ${BASE_PROFNAME} )
+	MULTIBUILD_VARIANTS+=( $(multilib_get_enabled_abis) )
+	echo "${MULTIBUILD_VARIANTS[*]}"
 }
 
-src_prepare() {
+# @FUNCTION: _int64_multilib_multibuild_wrapper
+# @USAGE: <argv>...
+# @INTERNAL
+# @DESCRIPTION:
+# Initialize the environment for ABI selected for multibuild.
+_int64_multilib_multibuild_wrapper() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	if [[ ! "${MULTIBUILD_ID}" =~ "_${INT64_SUFFIX}" ]]; then
+		local ABI=${MULTIBUILD_VARIANT}
+		multilib_toolchain_setup "${ABI}"
+		export FC="$(tc-getFC) $(get_abi_CFLAGS)"
+		export F77="$(tc-getF77) $(get_abi_CFLAGS)"
+	fi
+	"${@}"
+}
+
+# @FUNCTION: int64_multilib_copy_sources
+# @DESCRIPTION:
+# Create a single copy of the package sources for each enabled ABI.
+#
+# The sources are always copied from initial BUILD_DIR (or S if unset)
+# to ABI-specific build directory matching BUILD_DIR used by
+# multilib_foreach_abi().
+int64_multilib_copy_sources() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) )
 	multibuild_copy_sources
 }
 
+src_prepare() {
+	epatch "${FILESDIR}/${PN}-9999-cpuid_x86.patch"
+	local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) )
+	int64_multilib_copy_sources
+}
+
 src_configure() {
+	local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) )
 	my_configure() {
 		# lapack and lapacke are not modified from upstream lapack
 		sed \
@@ -81,15 +130,17 @@ src_configure() {
 			-e "s:^#\s*\(NO_LAPACKE\)\s*=.*:\1=1:" \
 			-i Makefile.rule || die
 	}
-	multibuild_foreach_variant run_in_build_dir my_configure
+	multibuild_foreach_variant run_in_build_dir _int64_multilib_multibuild_wrapper my_configure
 }
 
 src_compile() {
+	local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) )
 	# openblas already does multi-jobs
 	MAKEOPTS+=" -j1"
 	my_src_compile () {
 		local openblas_flags=$(get_openblas_flags)
 		local profname=$(get_profname)
+		local libname=$(get_libname)
 		einfo "Compiling profile ${profname}"
 		# cflags already defined twice
 		unset CFLAGS
@@ -110,7 +161,7 @@ src_compile() {
 			Description: ${DESCRIPTION}
 			Version: ${PV}
 			URL: ${HOMEPAGE}
-			Libs: -L\${libdir} -l${MULTIBUILD_ID}
+			Libs: -L\${libdir} -l${libname}
 			Libs.private: -lm
 		EOF
 		if [[ "${MULTIBUILD_ID}" =~ "_${INT64_SUFFIX}" ]]; then
@@ -126,18 +177,20 @@ src_compile() {
 		fi
 		mv libs/libopenblas* . || die
 	}
-	multibuild_foreach_variant run_in_build_dir my_src_compile
+	multibuild_foreach_variant run_in_build_dir _int64_multilib_multibuild_wrapper my_src_compile
 }
 
 src_test() {
+	local MULTIBUILD_VARIANTS=( $(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 my_src_test
+	multibuild_foreach_variant run_in_build_dir _int64_multilib_multibuild_wrapper my_src_test
 }
 
 src_install() {
+	local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) )
 	my_src_install () {
 		local openblas_flags=$(get_openblas_flags)
 		local profname=$(get_profname)
@@ -167,8 +220,13 @@ src_install() {
 				eend $?
 			done
 		fi
+		if [[ ${#MULTIBUILD_VARIANTS[@]} -gt 1 ]]; then
+			multilib_prepare_wrappers
+			multilib_check_headers
+		fi
 	}
-	multibuild_foreach_variant run_in_build_dir my_src_install
+	multibuild_foreach_variant run_in_build_dir _int64_multilib_multibuild_wrapper my_src_install
+	multilib_install_wrappers
 
 	dodoc GotoBLAS_{01Readme,03FAQ,04FAQ,05LargePage,06WeirdPerformance}.txt
 	dodoc *md Changelog.txt


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/sci:lapack-multibuild commit in: sci-libs/openblas/, sci-libs/openblas/files/
@ 2014-09-06 16:47 Mark Wright
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Wright @ 2014-09-06 16:47 UTC (permalink / raw
  To: gentoo-commits

commit:     f1953be6a6913f6a22f4c4056c492466343f2702
Author:     gienah <gienah <AT> gentoo <DOT> org>
AuthorDate: Sat Sep  6 16:45:21 2014 +0000
Commit:     Mark Wright <gienah <AT> gentoo <DOT> org>
CommitDate: Sat Sep  6 16:47:17 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=f1953be6

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.

---
 sci-libs/openblas/ChangeLog                        |  18 ++++
 ...-openblas_config_header_same_between_ABIs.patch |  21 +++++
 sci-libs/openblas/openblas-0.2.11.ebuild           |   1 +
 sci-libs/openblas/openblas-9999.ebuild             | 104 ++++++++++++++++-----
 4 files changed, 119 insertions(+), 25 deletions(-)

diff --git a/sci-libs/openblas/ChangeLog b/sci-libs/openblas/ChangeLog
index 68e0955..9f9c82e 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/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 0000000..7a85111
--- /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 0000000..2381753
--- /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 f012efd..e809907 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}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/sci:lapack-multibuild commit in: sci-libs/openblas/, sci-libs/openblas/files/
@ 2014-09-09 22:57 Mark Wright
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Wright @ 2014-09-09 22:57 UTC (permalink / raw
  To: gentoo-commits

commit:     09a3df15b9f14966df5fef9daa3a27d005b0dde7
Author:     gienah <gienah <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 23 12:29:29 2014 +0000
Commit:     Mark Wright <gienah <AT> gentoo <DOT> org>
CommitDate: Sun Sep  7 09:43:47 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=09a3df15

multilib as well for openblas

---
 .../openblas/files/openblas-9999-cpuid_x86.patch   | 27 ++++++++
 sci-libs/openblas/openblas-9999.ebuild             | 78 +++++++++++++++++++---
 2 files changed, 95 insertions(+), 10 deletions(-)

diff --git a/sci-libs/openblas/files/openblas-9999-cpuid_x86.patch b/sci-libs/openblas/files/openblas-9999-cpuid_x86.patch
new file mode 100644
index 0000000..c6f2991
--- /dev/null
+++ b/sci-libs/openblas/files/openblas-9999-cpuid_x86.patch
@@ -0,0 +1,27 @@
+--- openblas-9999-orig/cpuid_x86.c	2014-02-23 15:25:22.199394761 +1100
++++ openblas-9999/cpuid_x86.c	2014-02-23 16:41:02.727372869 +1100
+@@ -57,9 +57,23 @@
+ void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx);
+ #else
+ static inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx){
++#if __x86_64
+   __asm__ __volatile__
+     ("cpuid": "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx) : "a" (op) : "cc");
+-
++#else
++  __asm volatile(
++    "push %%ebx\n\t"
++    "cpuid\n\t"
++    "mov %%ebx, (%4)\n\t"
++    "pop %%ebx"
++    :"=a" (*eax),
++    "=c" (*ecx),
++    "=d" (*edx)
++    :"a" (op),
++    "cc"
++    "S" (ebx)
++    :"memory");
++#endif
+ }
+ #endif
+ 

diff --git a/sci-libs/openblas/openblas-9999.ebuild b/sci-libs/openblas/openblas-9999.ebuild
index 3e3cd52..1c2b6c6 100644
--- a/sci-libs/openblas/openblas-9999.ebuild
+++ b/sci-libs/openblas/openblas-9999.ebuild
@@ -4,7 +4,7 @@
 
 EAPI=5
 
-inherit alternatives-2 eutils fortran-2 git-r3 multilib multibuild toolchain-funcs
+inherit alternatives-2 eutils fortran-2 git-r3 multibuild multilib-build toolchain-funcs
 
 DESCRIPTION="Optimized BLAS library based on GotoBLAS2"
 HOMEPAGE="http://xianyi.github.com/OpenBLAS/"
@@ -20,6 +20,12 @@ KEYWORDS=""
 INT64_SUFFIX="int64"
 BASE_PROFNAME="openblas"
 
+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 && \
@@ -54,23 +60,66 @@ get_profname() {
 	echo "${profname}"
 }
 
-pkg_setup() {
+get_libname() {
+	local libname="${BASE_PROFNAME}"
+	if [[ "${MULTIBUILD_ID}" =~ "_${INT64_SUFFIX}" ]]; then
+		libname+="_${INT64_SUFFIX}"
+	fi
+	echo "${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.
-	MULTIBUILD_VARIANTS=()
+	local MULTIBUILD_VARIANTS=( )
 	use int64 && \
 		MULTIBUILD_VARIANTS+=( ${BASE_PROFNAME}_${INT64_SUFFIX} )
-	MULTIBUILD_VARIANTS+=( ${BASE_PROFNAME} )
+	MULTIBUILD_VARIANTS+=( $(multilib_get_enabled_abis) )
+	echo "${MULTIBUILD_VARIANTS[*]}"
 }
 
-src_prepare() {
+# @FUNCTION: _int64_multilib_multibuild_wrapper
+# @USAGE: <argv>...
+# @INTERNAL
+# @DESCRIPTION:
+# Initialize the environment for ABI selected for multibuild.
+_int64_multilib_multibuild_wrapper() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	if [[ ! "${MULTIBUILD_ID}" =~ "_${INT64_SUFFIX}" ]]; then
+		local ABI=${MULTIBUILD_VARIANT}
+		multilib_toolchain_setup "${ABI}"
+		export FC="$(tc-getFC) $(get_abi_CFLAGS)"
+		export F77="$(tc-getF77) $(get_abi_CFLAGS)"
+	fi
+	"${@}"
+}
+
+# @FUNCTION: int64_multilib_copy_sources
+# @DESCRIPTION:
+# Create a single copy of the package sources for each enabled ABI.
+#
+# The sources are always copied from initial BUILD_DIR (or S if unset)
+# to ABI-specific build directory matching BUILD_DIR used by
+# multilib_foreach_abi().
+int64_multilib_copy_sources() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) )
 	multibuild_copy_sources
 }
 
+src_prepare() {
+	epatch "${FILESDIR}/${PN}-9999-cpuid_x86.patch"
+	local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) )
+	int64_multilib_copy_sources
+}
+
 src_configure() {
+	local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) )
 	my_configure() {
 		# lapack and lapacke are not modified from upstream lapack
 		sed \
@@ -81,15 +130,17 @@ src_configure() {
 			-e "s:^#\s*\(NO_LAPACKE\)\s*=.*:\1=1:" \
 			-i Makefile.rule || die
 	}
-	multibuild_foreach_variant run_in_build_dir my_configure
+	multibuild_foreach_variant run_in_build_dir _int64_multilib_multibuild_wrapper my_configure
 }
 
 src_compile() {
+	local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) )
 	# openblas already does multi-jobs
 	MAKEOPTS+=" -j1"
 	my_src_compile () {
 		local openblas_flags=$(get_openblas_flags)
 		local profname=$(get_profname)
+		local libname=$(get_libname)
 		einfo "Compiling profile ${profname}"
 		# cflags already defined twice
 		unset CFLAGS
@@ -110,7 +161,7 @@ src_compile() {
 			Description: ${DESCRIPTION}
 			Version: ${PV}
 			URL: ${HOMEPAGE}
-			Libs: -L\${libdir} -l${MULTIBUILD_ID}
+			Libs: -L\${libdir} -l${libname}
 			Libs.private: -lm
 		EOF
 		if [[ "${MULTIBUILD_ID}" =~ "_${INT64_SUFFIX}" ]]; then
@@ -126,18 +177,20 @@ src_compile() {
 		fi
 		mv libs/libopenblas* . || die
 	}
-	multibuild_foreach_variant run_in_build_dir my_src_compile
+	multibuild_foreach_variant run_in_build_dir _int64_multilib_multibuild_wrapper my_src_compile
 }
 
 src_test() {
+	local MULTIBUILD_VARIANTS=( $(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 my_src_test
+	multibuild_foreach_variant run_in_build_dir _int64_multilib_multibuild_wrapper my_src_test
 }
 
 src_install() {
+	local MULTIBUILD_VARIANTS=( $(int64_multilib_get_enabled_abis) )
 	my_src_install () {
 		local openblas_flags=$(get_openblas_flags)
 		local profname=$(get_profname)
@@ -167,8 +220,13 @@ src_install() {
 				eend $?
 			done
 		fi
+		if [[ ${#MULTIBUILD_VARIANTS[@]} -gt 1 ]]; then
+			multilib_prepare_wrappers
+			multilib_check_headers
+		fi
 	}
-	multibuild_foreach_variant run_in_build_dir my_src_install
+	multibuild_foreach_variant run_in_build_dir _int64_multilib_multibuild_wrapper my_src_install
+	multilib_install_wrappers
 
 	dodoc GotoBLAS_{01Readme,03FAQ,04FAQ,05LargePage,06WeirdPerformance}.txt
 	dodoc *md Changelog.txt


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/sci:lapack-multibuild commit in: sci-libs/openblas/, sci-libs/openblas/files/
@ 2014-09-09 22:57 Mark Wright
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Wright @ 2014-09-09 22:57 UTC (permalink / raw
  To: gentoo-commits

commit:     bdd11e54b969288c7af5e3ff9226446d76cfafe9
Author:     gienah <gienah <AT> gentoo <DOT> org>
AuthorDate: Sat Sep  6 16:45:21 2014 +0000
Commit:     Mark Wright <gienah <AT> gentoo <DOT> org>
CommitDate: Sun Sep  7 09:43:47 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=bdd11e54

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.

---
 sci-libs/openblas/ChangeLog                        |  18 ++++
 ...-openblas_config_header_same_between_ABIs.patch |  21 +++++
 sci-libs/openblas/openblas-0.2.11.ebuild           |   1 +
 sci-libs/openblas/openblas-9999.ebuild             | 104 ++++++++++++++++-----
 4 files changed, 119 insertions(+), 25 deletions(-)

diff --git a/sci-libs/openblas/ChangeLog b/sci-libs/openblas/ChangeLog
index 68e0955..9f9c82e 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/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 0000000..7a85111
--- /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 0000000..2381753
--- /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 f012efd..e809907 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}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-09-09 22:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-06 16:47 [gentoo-commits] proj/sci:lapack-multibuild commit in: sci-libs/openblas/, sci-libs/openblas/files/ Mark Wright
  -- strict thread matches above, loose matches on Subject: below --
2014-09-09 22:57 Mark Wright
2014-09-09 22:57 Mark Wright
2014-02-23 12:29 Mark Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox