From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 7B95B138265 for ; Thu, 3 Jan 2013 00:20:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 614AF21C07C; Thu, 3 Jan 2013 00:20:17 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9903821C07C for ; Thu, 3 Jan 2013 00:20:16 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 55ADF33D9EC for ; Thu, 3 Jan 2013 00:20:15 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id AE911E5439 for ; Thu, 3 Jan 2013 00:20:12 +0000 (UTC) From: "Sebastien Fabbro" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sebastien Fabbro" Message-ID: <1356717910.a513b8f9516ed9e75a4245444d510d9bcc9c5061.bicatali@gentoo> Subject: [gentoo-commits] proj/sci:master commit in: sci-libs/magma/ X-VCS-Repository: proj/sci X-VCS-Files: sci-libs/magma/ChangeLog sci-libs/magma/magma-1.3.0.ebuild sci-libs/magma/metadata.xml X-VCS-Directories: sci-libs/magma/ X-VCS-Committer: bicatali X-VCS-Committer-Name: Sebastien Fabbro X-VCS-Revision: a513b8f9516ed9e75a4245444d510d9bcc9c5061 X-VCS-Branch: master Date: Thu, 3 Jan 2013 00:20:12 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: e55dbd13-adba-455c-a2c3-6e1fdf22f080 X-Archives-Hash: 668a9dd0ec9683c2322d0c607d2a12e6 commit: a513b8f9516ed9e75a4245444d510d9bcc9c5061 Author: Olivier Huber inria fr> AuthorDate: Fri Dec 28 17:56:03 2012 +0000 Commit: Sebastien Fabbro gentoo org> CommitDate: Fri Dec 28 18:05:10 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=a513b8f9 sci-libs/magma: Bump --- sci-libs/magma/ChangeLog | 6 ++ sci-libs/magma/magma-1.3.0.ebuild | 141 +++++++++++++++++++++++++++++++++++++ sci-libs/magma/metadata.xml | 1 + 3 files changed, 148 insertions(+), 0 deletions(-) diff --git a/sci-libs/magma/ChangeLog b/sci-libs/magma/ChangeLog index 97d8d1a..0039878 100644 --- a/sci-libs/magma/ChangeLog +++ b/sci-libs/magma/ChangeLog @@ -2,6 +2,12 @@ # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ +*magma-1.3.0 (28 Dec 2012) + + 28 Dec 2012; Olivier Huber +magma-1.3.0.ebuild, + metadata.xml: + sci-libs/magma Bump + 24 Nov 2012; Olivier Huber magma-1.2.1.ebuild, metadata.xml: Fix shared lib creation, fix tests and remove the tesla useflag, since this diff --git a/sci-libs/magma/magma-1.3.0.ebuild b/sci-libs/magma/magma-1.3.0.ebuild new file mode 100644 index 0000000..7a413f5 --- /dev/null +++ b/sci-libs/magma/magma-1.3.0.ebuild @@ -0,0 +1,141 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=4 + +FORTRAN_STANDARD="77 90" +inherit eutils fortran-2 toolchain-funcs versionator multilib + +DESCRIPTION="Matrix Algebra on GPU and Multicore Architectures" +HOMEPAGE="http://icl.cs.utk.edu/magma/" +SRC_URI="http://icl.cs.utk.edu/projectsfiles/${PN}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="fermi kepler static-libs" + +RDEPEND="dev-util/nvidia-cuda-toolkit + virtual/cblas + virtual/fortran + virtual/lapack" +DEPEND="${RDEPEND} + virtual/pkgconfig" + +# We have to have write acccess /dev/nvidia0 and /dev/nvidiactl and the portage +# user is (usually) not in the video group +RESTRICT="userpriv" + +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() { + epatch "${FILESDIR}"/${PN}-1.2.1-no-cuda-driver.patch + + # http://icl.cs.utk.edu/magma/forum/viewtopic.php?f=2&t=789 + sed -i -e 's/void magmaSetDevice/static void magmaSetDevice/' src/*getrf2_mgpu.cpp + + # distributed pc file not so useful so replace it + cat <<-EOF > ${PN}.pc + prefix=${EPREFIX}/usr + libdir=\${prefix}/$(get_libdir) + includedir=\${prefix}/include/${PN} + Name: ${PN} + Description: ${DESCRIPTION} + Version: ${PV} + URL: ${HOMEPAGE} + Libs: -L\${libdir} -lmagma -lmagmablas + Libs.private: -lm -lpthread -ldl -lcublas -lcudart + Cflags: -I\${includedir} + Requires: cblas lapack + EOF +} + +src_configure() { + cat <<-EOF > make.inc + ARCH = $(tc-getAR) + ARCHFLAGS = cr + RANLIB = $(tc-getRANLIB) + NVCC = nvcc + CC = $(tc-getCXX) + FORT = $(tc-getFC) + INC = -I${EPREFIX}/opt/cuda/include -DADD_ -DCUBLAS_GFORTRAN + OPTS = ${CFLAGS} -fPIC + FOPTS = ${FFLAGS} -fPIC -x f95-cpp-input + F77OPTS = ${FFLAGS} -fPIC + NVOPTS = -DADD_ --compiler-options '-fPIC ${CFLAGS}' -DUNIX + LOADER = $(tc-getFC) + LIBBLAS = $(pkg-config --libs cblas) + LIBLAPACK = $(pkg-config --libs lapack) + CUDADIR = ${EPREFIX}/opt/cuda + LIBCUDA = -L\$(CUDADIR)/$(get_libdir) -lcublas -lcudart + LIB = -pthread -lm -ldl \$(LIBCUDA) \$(LIBBLAS) \$(LIBLAPACK) -lstdc++ + EOF + if use kepler; then + echo >> make.inc "GPU_TARGET = Kepler" + elif use fermi; then + echo >> make.inc "GPU_TARGET = Fermi" + else # See http://icl.cs.utk.edu/magma/forum/viewtopic.php?f=2&t=227 + echo >> make.inc "GPU_TARGET = Tesla" + fi + + # see http://icl.cs.utk.edu/magma/forum/viewtopic.php?f=2&t=532 +# sed -i -e 's:[cz]heevd_m.cpp::g' src/Makefile.src src/Makefile + sed -i -e 's:[cz]hegvd_m.cpp::g' src/Makefile.src src/Makefile +} + +src_compile() { + # restrict to -j1 otherwise the static archive is not complete + emake -j1 lib + LINK=$(tc-getFC) static_to_shared lib/libmagmablas.a -lm -lpthread -ldl \ + -lcublas -lcudart -L"${EPREFIX}"/opt/cuda/$(get_libdir) -lstdc++ \ + $(pkg-config --libs cblas) $(pkg-config --libs lapack) + static_to_shared lib/libmagma.a -lm -lpthread -ldl -lcublas -lcudart \ + -L"${EPREFIX}"/opt/cuda/$(get_libdir) -lmagmablas \ + -Llib $(pkg-config --libs cblas) $(pkg-config --libs lapack) + if use static-libs; then + emake cleanall + sed 's/-fPIC//g' make.inc + emake lib + fi +} + +src_test() { + emake test lapacktest + cd testing/lin + # we need to access this while running the tests + addwrite /dev/nvidiactl + addwrite /dev/nvidia0 + LD_LIBRARY_PATH=${S}/lib python lapack_testing.py || die +} + +src_install() { + dolib.so lib/lib*$(get_libname)* + use static-libs && dolib.a lib/lib*.a + insinto /usr/include/${PN} + doins include/*.h + insinto /usr/$(get_libdir)/pkgconfig + doins ${PN}.pc + dodoc README ReleaseNotes +} diff --git a/sci-libs/magma/metadata.xml b/sci-libs/magma/metadata.xml index ef88ac6..70c7d66 100644 --- a/sci-libs/magma/metadata.xml +++ b/sci-libs/magma/metadata.xml @@ -10,5 +10,6 @@ Compile for GPU NVIDIA Fermi family (2.x cards) + Compile for GPU NVIDIA Kepler family (GF 6xx cards)