public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sebastien Fabbro" <bicatali@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/sci:master commit in: sci-libs/magma/
Date: Thu, 12 Jul 2012 20:43:22 +0000 (UTC)	[thread overview]
Message-ID: <1342119817.ae684d0dec8e6746c5e3ce7e685fe4019b32163d.bicatali@gentoo> (raw)

commit:     ae684d0dec8e6746c5e3ce7e685fe4019b32163d
Author:     Sebastien Fabbro <sfabbro <AT> uvic <DOT> ca>
AuthorDate: Thu Jul 12 19:03:37 2012 +0000
Commit:     Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
CommitDate: Thu Jul 12 19:03:37 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=ae684d0d

sci-libs/magma: Shared library fixes, prefix love and ebuild cleanup

(Portage version: 2.2.01.20757-prefix/git/Linux x86_64, RepoMan options: --force, unsigned Manifest commit)

---
 sci-libs/magma/ChangeLog          |    4 ++-
 sci-libs/magma/magma-1.2.1.ebuild |   41 +++++++++++++++++++++++-------------
 2 files changed, 29 insertions(+), 16 deletions(-)

diff --git a/sci-libs/magma/ChangeLog b/sci-libs/magma/ChangeLog
index 460bde8..fce27ef 100644
--- a/sci-libs/magma/ChangeLog
+++ b/sci-libs/magma/ChangeLog
@@ -2,6 +2,9 @@
 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
+  12 Jul 2012; Sébastien Fabbro <bicatali@gentoo.org> magma-1.2.1.ebuild:
+  sci-libs/magma: Shared library fixes, prefix love and ebuild cleanup
+
 *magma-1.2.1 (03 Jul 2012)
 
   03 Jul 2012; Sébastien Fabbro <bicatali@gentoo.org>
@@ -18,4 +21,3 @@
   +files/magma-1.2.0-duplicate-symbols.patch, +magma-1.2.0.ebuild,
   +metadata.xml:
   sci-libs/magma: Initial import
-

diff --git a/sci-libs/magma/magma-1.2.1.ebuild b/sci-libs/magma/magma-1.2.1.ebuild
index 65b822c..9710870 100644
--- a/sci-libs/magma/magma-1.2.1.ebuild
+++ b/sci-libs/magma/magma-1.2.1.ebuild
@@ -5,7 +5,7 @@
 EAPI=4
 
 FORTRAN_STANDARD="77 90"
-inherit eutils fortran-2 toolchain-funcs versionator
+inherit eutils fortran-2 toolchain-funcs versionator multilib
 
 DESCRIPTION="Matrix Algebra on GPU and Multicore Architectures"
 HOMEPAGE="http://icl.cs.utk.edu/magma/"
@@ -18,21 +18,32 @@ IUSE="fermi static-libs tesla"
 
 RDEPEND="dev-util/nvidia-cuda-toolkit
 	virtual/cblas
+	virtual/fortran
 	virtual/lapack"
 DEPEND="${RDEPEND}
 	virtual/pkgconfig"
 
-make_shared_lib() {
-	local libstatic=${1}
-	local soname=$(basename "${1%.a}").so.$(get_major_version)
-	shift
-	einfo "Making ${soname}"
-	${LINK:-$(tc-getCC)} ${LDFLAGS}  \
-		-shared -Wl,-soname="${soname}" \
-		-Wl,--whole-archive "${libstatic}" -Wl,--no-whole-archive \
-		"$@" -o $(dirname "${libstatic}")/"${soname}" \
-		|| die "${soname} failed"
-	ln -s "${soname}" $(dirname "${libstatic}")/"${soname%.*}"
+static_to_shared() {
+	local libstatic=${1}; shift
+	local libname=$(basename ${libstatic%.a})
+	local soname=${libname}$(get_libname $(get_version_component_range 1-2))
+	local libdir=$(dirname ${libstatic})
+
+	einfo "Making ${soname} from ${libstatic}"
+	if [[ ${CHOST} == *-darwin* ]] ; then
+		${LINK:-$(tc-getCC)} ${LDFLAGS}  \
+			-dynamiclib -install_name "${EPREFIX}"/usr/lib/"${soname}" \
+			-Wl,-all_load -Wl,${libstatic} \
+			"$@" -o ${libdir}/${soname} || die "${soname} failed"
+	else
+		${LINK:-$(tc-getCC)} ${LDFLAGS}  \
+			-shared -Wl,-soname=${soname} \
+			-Wl,--whole-archive ${libstatic} -Wl,--no-whole-archive \
+			"$@" -o ${libdir}/${soname} || die "${soname} failed"
+		[[ $(get_version_component_count) -gt 1 ]] && \
+			ln -s ${soname} ${libdir}/${libname}$(get_libname $(get_major_version))
+		ln -s ${soname} ${libdir}/${libname}$(get_libname)
+	fi
 }
 
 src_prepare() {
@@ -85,8 +96,8 @@ src_configure() {
 
 src_compile() {
 	emake lib
-	make_shared_lib lib/libmagma.a
-	make_shared_lib lib/libmagmablas.a
+	static_to_shared lib/libmagma.a -lm -lpthread -ldl -lcublas -lcudart
+	LINK=$(tc-getFC) static_to_shared lib/libmagmablas.a -lm -lpthread -ldl -lcublas -lcudart
 	if use static-libs; then
 		emake cleanall
 		sed 's/-fPIC//g' make.inc
@@ -101,7 +112,7 @@ src_test() {
 }
 
 src_install() {
-	dolib.so lib/lib*.so*
+	dolib.so lib/lib*$(get_libname)*
 	use static-libs && dolib.a lib/lib*.a
 	insinto /usr/include/${PN}
 	doins include/*.h



             reply	other threads:[~2012-07-12 20:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-12 20:43 Sebastien Fabbro [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-01-03  0:20 [gentoo-commits] proj/sci:master commit in: sci-libs/magma/ Sebastien Fabbro
2013-01-03  0:20 Sebastien Fabbro
2013-11-18  8:01 Justin Lecher
2013-12-28 18:59 Justin Lecher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1342119817.ae684d0dec8e6746c5e3ce7e685fe4019b32163d.bicatali@gentoo \
    --to=bicatali@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox