diff options
author | Sébastien Fabbro <bicatali@gentoo.org> | 2010-12-05 08:22:23 +0000 |
---|---|---|
committer | Sébastien Fabbro <bicatali@gentoo.org> | 2010-12-05 08:22:23 +0000 |
commit | ad4b67c1a382796e46605e5c18281701acd33541 (patch) | |
tree | aa2e77d7f3324bf266a07220d86faa7fc1e9c8b0 /sci-libs/atlas | |
parent | working lapacke (diff) | |
download | bicatali-ad4b67c1a382796e46605e5c18281701acd33541.tar.gz bicatali-ad4b67c1a382796e46605e5c18281701acd33541.tar.bz2 bicatali-ad4b67c1a382796e46605e5c18281701acd33541.zip |
bump atlas and fixed a few lapack problems
Diffstat (limited to 'sci-libs/atlas')
-rw-r--r-- | sci-libs/atlas/ChangeLog | 6 | ||||
-rw-r--r-- | sci-libs/atlas/Manifest | 6 | ||||
-rw-r--r-- | sci-libs/atlas/atlas-3.8.3.ebuild | 55 | ||||
-rw-r--r-- | sci-libs/atlas/atlas-3.9.32.ebuild | 167 |
4 files changed, 211 insertions, 23 deletions
diff --git a/sci-libs/atlas/ChangeLog b/sci-libs/atlas/ChangeLog index d2d2555..2b114f0 100644 --- a/sci-libs/atlas/ChangeLog +++ b/sci-libs/atlas/ChangeLog @@ -2,6 +2,12 @@ # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ +*atlas-3.9.32 (05 Dec 2010) + + 05 Dec 2010; Sébastien Fabbro <bicatali@gentoo.org> atlas-3.8.3.ebuild, + +atlas-3.9.32.ebuild: + Version bump. Still beta. + 03 Dec 2010; Sébastien Fabbro <bicatali@gentoo.org> atlas-3.8.3.ebuild, metadata.xml: Initial import. Ebuilds merged from blas-atlas and lapack-atlas. diff --git a/sci-libs/atlas/Manifest b/sci-libs/atlas/Manifest index c106980..b762312 100644 --- a/sci-libs/atlas/Manifest +++ b/sci-libs/atlas/Manifest @@ -1,5 +1,7 @@ DIST atlas3.8.3.tar.bz2 2527756 RMD160 0425e630d9d0c5b7aae81427a41b7eaa18447e90 SHA1 c7546210df4796457d9e96a00444adc4c0f2e77f SHA256 e537168f2022db98b9029c8064815b5581620c12d782016138b1bf0bbb01f473 +DIST atlas3.9.32.tar.bz2 5079409 RMD160 a6f7dbd1ee13c9b3e3b4e9e28b706d037f19fe99 SHA1 77a448ebe779745ee916dcd22922255c7dc340db SHA256 8aa87f1d72802de691d4366c3b579644c2073a2ace81959d6dff6d6717b1c8a9 DIST lapack-3.3.0.tgz 6064824 RMD160 cc72e7c93ab13464fd892d684b00b910cbbd3b3e SHA1 4f0b103da52110e7f60d1d7676727103aca9785e SHA256 bc531761287156e17476395c42664a15373723f54a6f80f192cda47771ec1225 -EBUILD atlas-3.8.3.ebuild 5521 RMD160 23b1fd8e756a8bb2082aeadbc8d9a1ed5c59ebd0 SHA1 fa75e624383cd2c32c967b8a0b49b3d636bcad12 SHA256 da8ce3e2f06e09fea19843b302a54397851bd8058ca3b17611ef23cbed9f868b -MISC ChangeLog 274 RMD160 a98961a6eced92d84bd44bec7e4025aa6ce0cfde SHA1 d5027258bb7e9b65054a8ca294285f79822ea572 SHA256 aea5c04a089257060d4f738699fc1ad78559e6b098c265569990af118da59555 +EBUILD atlas-3.8.3.ebuild 5771 RMD160 e2cb806239439467f79f81f4e1ddc72cd63652ab SHA1 eb3bf7c7100af2376789ceaa2bca5107d5f9f88c SHA256 1a34498d421a34d740ab87f880e9737a963457ce413cb8e7f4e2a8cf973e6d21 +EBUILD atlas-3.9.32.ebuild 4839 RMD160 1fe3ce54ae275c133ac39253c55df032133a88f4 SHA1 4a33b30b2ef6165e694db8485a2393e15d0b8cb7 SHA256 2a117968a9f9c1afe40956d2ac41d1c9f8efe6eed47d102e0fbe91013037397f +MISC ChangeLog 431 RMD160 5029ae5bb2dbcffadeb2485dc2d661e16c4bb7c8 SHA1 48b805b587c2d16f4994ab0a94f1199c9ca74528 SHA256 27c95c5cd6c008e15c7e0dae1b3c6acee327c2b17de8646cee33d3efd66331bc MISC metadata.xml 870 RMD160 aa455042843082a078fe05a0fc0946b30f59913c SHA1 78050266e8390d8ea9ecc3cd2e994df7f7cbb9b7 SHA256 9983d9a67dfcfee136da37d9d428a3c62679e5846f4fde7168cf347ab26e7dfd diff --git a/sci-libs/atlas/atlas-3.8.3.ebuild b/sci-libs/atlas/atlas-3.8.3.ebuild index c12ad0c..c4eae6e 100644 --- a/sci-libs/atlas/atlas-3.8.3.ebuild +++ b/sci-libs/atlas/atlas-3.8.3.ebuild @@ -47,7 +47,41 @@ pkg_setup() { fi } +lapack_compile() { + cd "${WORKDIR}/${LAPACKP}" + local timer=INT_CPU_TIME + case $(tc-getFC) in + *gfortran|*g77) timer=INT_ETIME ;; + *ifort) timer=EXT_ETIME ;; + esac + cat > make.inc <<-EOF + FORTRAN = $(tc-getFC) + OPTS = ${FFLAGS} + NOOPT = -O0 + LOADER = $(tc-getFC) + LOADEROPTS = ${LDFLAGS} + ARCH = $(tc-getAR) + ARCHFLAGS = cr + RANLIB = $(tc-getRANLIB) + TIMER = ${timer} + $(use xblas && echo "USEXBLAS = Yes") + EOF + if use static-libs; then + emake \ + LAPACKLIB=liblapack_nonpic.a \ + lapacklib || die "lapack static compilation failed" + emake clean + fi + emake \ + LAPACKLIB=liblapack_pic.a \ + OPTS="${FFLAGS} -fPIC" \ + NOOPT="-O0 -fPIC" \ + lapacklib || die "lapack pic compilation failed" +} + src_configure() { + # we need a pic static lapack lib before configuring + use inlapack && lapack_compile local myconf=( "--prefix=${ED}/usr" "--libdir=${ED}/usr/$(get_libdir)" @@ -98,28 +132,7 @@ src_configure() { || die "configure shared failed" } -lapack_compile() { - cd "${WORKDIR}/${LAPACKP}" - cat > make.inc <<-EOF - FORTRAN = $(tc-getFC) - OPTS = ${FFLAGS} - NOOPT = -O0 - LOADER = $(tc-getFC) - LOADEROPTS = ${LDFLAGS} - ARCH = $(tc-getAR) - ARCHFLAGS = cr - RANLIB = $(tc-getRANLIB) - $(use xblas && echo "USEXBLAS = Yes") - EOF - if use static-libs; then - emake PLAT=_nonpic lapacklib || die "lapack static compilation failed" - emake clean - fi - emake PLAT=_pic OPTS="${FFLAGS} -fPIC" NOOPT="-O0 -fPIC" lapacklib || die "lapack pic compilation failed" -} - src_compile() { - use inlapack && lapack_compile # atlas does its own parallel builds if use static-libs; then cd "${S}_build_static" diff --git a/sci-libs/atlas/atlas-3.9.32.ebuild b/sci-libs/atlas/atlas-3.9.32.ebuild new file mode 100644 index 0000000..02dc48a --- /dev/null +++ b/sci-libs/atlas/atlas-3.9.32.ebuild @@ -0,0 +1,167 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=3 +inherit eutils toolchain-funcs multilib + +LAPACKP=lapack-3.3.0 + +DESCRIPTION="Automatically Tuned Linear Algebra Software" +HOMEPAGE="http://math-atlas.sourceforge.net/" +SRC_URI="mirror://sourceforge/math-atlas/${PN}${PV}.tar.bz2 + inlapack? ( http://www.netlib.org/lapack/${LAPACKP}.tgz )" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="inblas doc inlapack static-libs xblas" + +RDEPEND="inlapack? ( xblas? ( sci-libs/xblas ) )" +DEPEND="${RDEPEND} + app-admin/eselect-cblas + inblas? ( app-admin/eselect-blas ) + inlapack? ( app-admin/eselect-lapack )" + +S="${WORKDIR}/ATLAS" + +pkg_setup() { + if [[ -n $(type -P cpufreq-info) ]]; then + [[ -z $(cpufreq-info -d) ]] && return + local ncpu=$(LANG=C cpufreq-info | grep -c "analyzing CPU") + local cpu=0 + while [[ ${cpu} -lt ${ncpu} ]] ; do + if "$(LANG=C cpufreq-info -p -c ${cpu} | grep -q performance)"; then + ewarn "CPU $cpu is not set to performance" + ewarn "Run sudo cpufreq-set -g performance -c <CPU #> for all CPUs" + die "${PN} needs all cpu set to performance" + fi + cpu=$(( cpu + 1 )) + done + else + ewarn "Please make sure to disable CPU throttling completely" + ewarn "during the compile of ${PN}. Otherwise, all ${PN}" + ewarn "generated timings will be completely random and the" + ewarn "performance of the resulting libraries will be degraded" + ewarn "considerably." + fi +} + +src_configure() { + local myconf=( + "--prefix=${ED}/usr" + "--libdir=${ED}/usr/$(get_libdir)" + "--incdir=${ED}/usr/include" + "--cc=$(tc-getCC)" + "-C ac $(tc-getCC)" + "-C if $(tc-getFC)" + "-D c -DWALL" + "-F ac '${CFLAGS}'" + "-F if '${FFLAGS}'" + "-Si cputhrchk 0" + "-Ss pmake '\$(MAKE) ${MAKEOPTS}'" + $(use inlapack && echo "--with-netlib-lapack-tarfile=${DISTDIR}/${LAPACKP}.tgz") + ) + if use amd64 || use ppc64 || use sparc; then + if [ ${ABI} = amd64 ] || [ ${ABI} = ppc64 ] || [ ${ABI} = sparc64 ] ; then + myconf+=( "-b 64" ) + elif [ ${ABI} = x86 ] || [ ${ABI} = ppc ] || [ ${ABI} = sparc32 ] ; then + myconf+=( "-b 32" ) + else + myconf+=( "-b 64" ) + fi + elif use ppc || use x86; then + myconf+=( "-b 32" ) + elif use ia64; then + myconf+=( "-b 64" ) + else #hppa alpha ... + myconf+=( "" ) + fi + ! use inblas && ! use inlapack && myconf+=( "--nof77" ) + + if use static-libs; then + mkdir "${S}_build_static" && cd "${S}_build_static" + "${S}"/configure ${myconf[@]} || die "configure static failed" + fi + + mkdir "${S}_build_shared" && cd "${S}_build_shared" + myconf+=( "-Fa alg -fPIC" ) + "${S}"/configure ${myconf[@]} || die "configure shared failed" +} + +src_compile() { + # atlas does its own parallel builds + if use static-libs; then + cd "${S}_build_static" + emake -j1 build || die "emake static failed" + fi + cd "${S}_build_shared" + emake -j1 build || die "emake static with PIC failed" + cd lib + local alibs=shared + [[ -e libptcblas.a ]] && alibs="${alibs} ptshared" + emake ${alibs} || die "emake shared libs failed" +} + +src_test() { + cd "${S}_build_shared" + emake -j1 check || die "emake check failed" + emake -j1 time || die "emake time failed" +} + +# atlas_install <blas|cblas|lapack> <lib> +atlas_install() { + dolib.so "${S}_build_shared"/lib/lib${2}.so || die + if use static-libs; then + dolib.a "${S}_build_static"/lib/lib${2}.a || die + fi + local prof=${PN}-${1} ptlibs= + if [[ ${2:0:2} == pt ]]; then + prof=${prof}-threads + ptlibs="-lthreads" + fi + cat <<-EOF > ${prof}.pc + prefix=${EPREFIX}/usr + libdir=\${prefix}/$(get_libdir) + includedir=\${prefix}/include + Name: ${prof} + Description: ${DESCRIPTION} ${1} implementation + Version: ${PV} + URL: ${HOMEPAGE} + Libs: -L\${libdir} -latlas -l${2} ${ptlibs} + Private: -lm + Cflags: -I\${includedir} + $([[ ${1} == lapack ]] && echo "Requires: blas") + EOF + echo > eselect.${1}.${prof} \ + "${prof}.pc ${EPREFIX}/usr/$(get_libdir)/pkgconfig/${l}.pc" + if [[ ${1} == cblas ]]; then + echo >> eselect.${1}.${prof} \ + "${PN}/cblas.h ${EPREFIX}/usr/include/cblas.h" + fi + eselect ${1} add $(get_libdir) eselect.${1}.${prof} ${prof} +} + +src_install() { + rename cblas acblas "${S}"_build*/lib/libcblas.* + rename clapack alapack "${S}"_build*/lib/liblapack.* + atlas_install cblas acblas + use inblas && atlas_install blas f77blas + use inlapack && atlas_install lapack alapack + if [[ -d "${S}_build_shared"/lib/libptcblas.so ]]; then + atlas_install cblas ptcblas + use inblas && atlas_install blas ptf77blas + fi + insinto /usr/include/${PN} + doins include/*.h || die + use inlapack && dosym atlas/clapack.h /usr/include/clapack.h + + cd doc + dodoc INDEX.txt AtlasCredits.txt ChangeLog + if use doc; then + insinto /usr/share/doc/${PF} + doins atlas*pdf cblas.pdf cblasqref.pdf || die "doins docs failed" + use inblas && doins f77blas*pdf + use inlapack && doins lapack*pdf + fi +} |