aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGergely Nagy <ngg@tresorit.com>2017-06-26 12:49:26 +0200
committerJustin Lecher <jlec@gentoo.org>2017-06-27 10:49:39 +0100
commit248cdac8246c9b43b970bca62e4ea70808c47cb1 (patch)
tree810a03b75074527b18ccb9cd63f10fee265db31c
parentsci-libs/atlas: Sanitize default USE combination (diff)
downloadsci-248cdac8246c9b43b970bca62e4ea70808c47cb1.zip
sci-248cdac8246c9b43b970bca62e4ea70808c47cb1.tar.gz
sci-248cdac8246c9b43b970bca62e4ea70808c47cb1.tar.bz2
sci-libs/atlas: version bump to 3.11.39
Patch from upstream is required to build the shared library: https://sourceforge.net/p/math-atlas/bugs/260/ Closes: https://github.com/gentoo/sci/pull/794
-rw-r--r--sci-libs/atlas/Manifest2
-rw-r--r--sci-libs/atlas/atlas-3.11.39.ebuild285
-rw-r--r--sci-libs/atlas/files/atlas-3.11.39-dolastcomp.patch13
3 files changed, 300 insertions, 0 deletions
diff --git a/sci-libs/atlas/Manifest b/sci-libs/atlas/Manifest
index 288bf07..1ef7d42 100644
--- a/sci-libs/atlas/Manifest
+++ b/sci-libs/atlas/Manifest
@@ -2,5 +2,7 @@ DIST atlas3.10.1.tar.bz2 4900179 SHA256 a215b492204aae0205f4028e7c4076492a5d6a56
DIST atlas3.10.2.tar.bz2 4904923 SHA256 3aab139b118bf3fcdb4956fbd71676158d713ab0d3bccb2ae1dc3769db22102f SHA512 9fe04cfa1f89449db047d1a4659a656964d13117c783cbbe43344eb32555736f037d9cd30c5ae1514c08ad5b8949a3982d7fe102d707ddb62288e76b2607fbb1 WHIRLPOOL e56936da713b0a1eb560d993bd29da0ac65923bdd2298c0a240a933fbf8961cd151020756ab550e716eae153d97c96d713512cda208a9c1a7c34467bd591fcd5
DIST atlas3.10.3.tar.bz2 5156852 SHA256 2688eb733a6c5f78a18ef32144039adcd62fabce66f2eb51dd59dde806a6d2b7 SHA512 bf17306f09f2aa973cb776e2c9eacfb2409ad4d95d19802e1c4e0597d0a099fccdb5eaafe273c2682a41e41a3c6fabc8bbba4ce03180cffea40ede5df1d1f56e WHIRLPOOL edd5d7035332747ac796f5c8716609196903c56dc0f1e0471f4a3f11ded9e66e7c0bf47c32ddb612a834aa541198e95eaf972a02a5fc41824cfb1f9a66dd9620
DIST atlas3.11.38.tar.bz2 5399435 SHA256 95ba430e959a3a9f209a0876019355550ea2ef181f7e95f87158f421eacda5d2 SHA512 4ca54b741228523d344bae86ef3ac8c7d54cbb610624d1db1403c59aa5cbcb4b2af509ea435204bf8f65d823349314013d8cc1494243723ce9fa89e9fc2802ce WHIRLPOOL a6c536e164e9dabdadf03bfa2dadc512fb9f16efd91e497f6825018351f464f23a3b9056214d82ddb5668ec38810cb916314df2791f49fc6c79cc2bd460f961c
+DIST atlas3.11.39.tar.bz2 5821852 SHA256 584bd44572746142bf19348139530c18f4538ce41d94330ff86ede38c36eddc9 SHA512 bdb64e2a0a7ce4142182a5e6cdb52d44f6e99963392b5daa4b0ea1659c8b6fff93b61119ce83386c4e81b1cd63009df334aa95971a7b0a5c6eb27537a05855e9 WHIRLPOOL 675fe6adbed7cc9f9fe65a7a45babedc21ac76af542ea7950e5d270c1e0059a96c1263455c09bcc5c4f2ba84aa1462ff5a4f1e13db69ebab32e463fd0b1be597
DIST lapack-3.5.0.tgz 6313139 SHA256 9ad8f0d3f3fb5521db49f2dd716463b8fb2b6bc9dc386a9956b8c6144f726352 SHA512 b948a0a0db032bda455ec4f519d4e89e4c29e29cecb5b6258ca61f68faaeeac9fdf4ece5c39ffcd0154c5505facbc392c7d09c8348b1d60bdd2685153ab2543f WHIRLPOOL c97a3e843bbef0b79e47cf13a7b2173eeaada52f6059492edeb1a6558ecfb33c637c6f62ad77bfd2c468884becf7becb87bb476f6f5f41572d374dc1bd745c52
DIST lapack-3.6.0.tgz 6792324 SHA256 a9a0082c918fe14e377bbd570057616768dca76cbdc713457d8199aaa233ffc3 SHA512 bc50441d415ef8896dd7626d77c6104184b996e758704366288089f03d4c99d068e33153b0d13305310886017e5d2e716130f812a95cfcad36ef37fe20417ab8 WHIRLPOOL 5576d0a81b2645fe95ef7011cc398f31142b8dcd01cdf5945e3db0e73ae1768766ea54254b40f4c6a581a6fb77b911595fccd597be0536833118af5877bb0c64
+DIST lapack-3.7.0.tgz 7359812 SHA256 ed967e4307e986474ab02eb810eed1d1adc73f5e1e3bc78fb009f6fe766db3be SHA512 e4f4c7d0ba8a096eeb813160c6dbcdd535647df6b2ad5beac9181908158956b31d1a9554ec9b9836fd44fe7404c1f377b297cbb20d744f20d70e357fd246c91b WHIRLPOOL d536508015e081395bda83b84bf4e5b1d6e8e517ea38f6afcaf40e96d892b26b8b1034954d5cd79cce5033d6653e178b5d27a46deecfa7466cd0bdaafcf9f18f
diff --git a/sci-libs/atlas/atlas-3.11.39.ebuild b/sci-libs/atlas/atlas-3.11.39.ebuild
new file mode 100644
index 0000000..f4b6514
--- /dev/null
+++ b/sci-libs/atlas/atlas-3.11.39.ebuild
@@ -0,0 +1,285 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+FORTRAN_NEEDED=fortran
+
+inherit alternatives-2 eutils fortran-2 linux-info multilib numeric toolchain-funcs versionator
+
+LAPACKP=lapack-3.7.0.tgz
+
+DESCRIPTION="Automatically Tuned Linear Algebra Software"
+HOMEPAGE="http://math-atlas.sourceforge.net/"
+SRC_URI="mirror://sourceforge/math-atlas/${PN}${PV}.tar.bz2
+ fortran? ( lapack? ( http://www.netlib.org/lapack/${LAPACKP} ) )"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="+deprecated doc +fortran generic ifko +lapack static-libs threads"
+
+REQUIRED_USE="
+ deprecated? ( lapack )
+ lapack? ( fortran )"
+
+S="${WORKDIR}/ATLAS"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-dolastcomp.patch
+)
+
+pkg_setup() {
+ local _cpufreq
+ for _cpufreq in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do
+ if [ -f ${_cpufreq} ]; then
+ if ! grep -q performance ${_cpufreq}; then
+ echo 2> /dev/null performance > ${_cpufreq} || \
+ die "${PN} needs all cpu set to performance"
+ fi
+ fi
+ done
+ [[ -e /sys/devices/system/cpu/intel_pstate ]] \
+ && die "Intel P-State driver detected. Please reboot with 'intel_pstate=disable' in your cmdline"
+ use fortran && fortran-2_pkg_setup
+ CONFIG_CHECK="
+ !~X86_P4_CLOCKMOD
+ !~X86_INTEL_PSTATE
+ "
+ ERROR_KERNEL_X86_P4_CLOCKMOD="P4 Clockmod frequency scaling influences tuning and needs to be disabled at compile time."
+ ERROR_KERNEL_X86_INTEL_PSTATE="Intel Pstate frequency scaling influences tuning and needs to be disabled at compile time."
+ linux-info_pkg_setup
+}
+
+src_configure() {
+ # hack needed to trick the flaky gcc detection
+ local mycc="$(type -P $(tc-getCC))"
+ [[ ${mycc} == *gcc* ]] && mycc=gcc
+ atlas_configure() {
+ local myconf=(
+ --prefix="${ED}/usr"
+ --libdir="${ED}/usr/$(get_libdir)"
+ --incdir="${ED}/usr/include"
+ --cc="$(tc-getCC)"
+ "-D c -DWALL"
+ "-C acg '${mycc}'"
+ "-F acg '${CFLAGS}'"
+ "-Ss pmake '\$(MAKE) ${MAKEOPTS}'"
+ )
+
+ # OpenMP shown to decreased performance over POSIX threads
+ # (at least in 3.9.x, see atlas-dev mailing list)
+ if use threads; then
+ if use generic; then # 2 threads is most generic
+ myconf+=( "-t 2" "-Si omp 0" )
+ else
+ myconf+=( "-t -1" "-Si omp 0" )
+ fi
+ else
+ myconf+=( "-t 0" "-Si omp 0" )
+ fi
+
+ 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" )
+ elif [ ${ABI} = x32 ] ; then
+ myconf+=( "-b 48" )
+ else
+ myconf+=( "-b 64" )
+ fi
+ elif use ppc || use x86; then
+ myconf+=( "-b 32" )
+ elif use ia64; then
+ myconf+=( "-b 64" )
+ fi
+ if use fortran; then
+ myconf+=(
+ "-C if '$(type -P $(tc-getFC))'"
+ "-F if '${FFLAGS}'"
+ )
+ if use lapack; then
+ myconf+=(
+ "-Si latune 1"
+ "--with-netlib-lapack-tarfile=${DISTDIR}/${LAPACKP}"
+ )
+ else
+ myconf+=( "-Si latune 0" )
+ fi
+ else
+ myconf+=( "-Si latune 0" "--nof77" )
+ fi
+ # generic stuff found by make make xprint_enums in atlas build dir
+ # basically assuming sse2+sse1 and 2 threads max
+ use generic && use x86 && myconf+=( "-V 384 -A 13")
+ use generic && use amd64 && myconf+=( "-V 384 -A 24")
+
+ local confdir="${S}_${1}"; shift
+ myconf+=( $(usex ifko "--use-ifko" "") )
+ myconf+=( $@ )
+ mkdir "${confdir}" && cd "${confdir}" || die
+ # for debugging
+ echo ${myconf[@]} > myconf.out
+ "${S}"/configure ${myconf[@]} || die "configure in ${confdir} failed"
+
+ if use deprecated; then
+ echo "BUILD_DEPRECATED=1" >> src/lapack/reference/make.inc.example || die
+ fi
+ }
+
+ atlas_configure shared "-Fa alg -fPIC" ${EXTRA_ECONF}
+ use static-libs && atlas_configure static ${EXTRA_ECONF}
+}
+
+src_compile() {
+ atlas_compile() {
+ pushd "${S}_${1}" > /dev/null || die
+ # atlas does its own parallel builds
+ emake -j1 build
+ cd lib || die
+ emake libclapack.a
+ [[ -e libptcblas.a ]] && emake libptclapack.a
+ popd > /dev/null || die
+ }
+
+ atlas_compile shared
+ use static-libs && atlas_compile static
+}
+
+src_test() {
+ cd "${S}_shared" || die
+ emake -j1 check time
+}
+
+# transform a static archive into a shared library and install them
+# atlas_install_libs <mylib.a> [extra link flags]
+atlas_install_libs() {
+ local libname=$(basename ${1%.*})
+ einfo "Installing ${libname}"
+ local soname=${libname}.so.$(get_major_version)
+ local _cmd
+ shift
+ pushd "${S}_shared"/lib > /dev/null
+ _cmd="${LINK:-$(tc-getCC)}"
+ _cmd+=" ${LDFLAGS} -shared -Wl,--no-undefined -Wl,-soname=${soname}"
+ _cmd+=" -Wl,--whole-archive ${libname}.a -Wl,--no-whole-archive"
+ _cmd+=" $@ -o ${soname}"
+ einfo "${_cmd}"
+ ${_cmd} || die "Creating ${soname} failed"
+ dolib.so ${soname}
+ dosym ${soname} /usr/$(get_libdir)/${soname%.*}
+ popd > /dev/null || die
+ use static-libs && dolib.a "${S}_static"/lib/${libname}.a
+}
+
+# create and install a pkgconfig file
+# atlas_install_pc <libname> <pkg name> [extra link flags]
+atlas_install_pc() {
+ local libname=${1} ; shift
+ local pcname=${1} ; shift
+ local extra=()
+ [[ ${PCREQ} ]] && extra+=( --requires "${PCREQ}" )
+ create_pkgconfig \
+ --name "${pcname}" \
+ --description "${PN} ${pcname}" \
+ --libs "-L\${libdir} -l${libname} $@" \
+ --libs-private "-L\${libdir} -latlas -lm ${PTLIBS}" \
+ --cflags "-I\${includedir}/${PN}" \
+ "${extra[@]}" \
+ ${pcname}
+}
+
+src_install() {
+ cd "${S}_shared/lib" || die
+ # rename to avoid collision with other packages
+ local l
+ for l in {,c}{blas,lapack}; do
+ if [[ -e lib${l}.a ]]; then
+ mv lib{,atl}${l}.a || die
+ if use static-libs; then
+ mv "${S}"_static/lib/lib{,atl}${l}.a || die
+ fi
+ fi
+ done
+
+ [[ -e libptcblas.a ]] && PTLIBS="-lpthread"
+
+ # atlas
+ atlas_install_libs libatlas.a -lm ${PTLIBS}
+
+ # cblas
+ atlas_install_libs libatlcblas.a -L. -latlas -lm
+ atlas_install_pc atlcblas atlas-cblas
+ alternatives_for cblas atlas 0 \
+ /usr/$(get_libdir)/pkgconfig/cblas.pc atlas-cblas.pc \
+ /usr/include/cblas.h atlas/cblas.h
+
+ # cblas threaded
+ if [[ -e libptcblas.a ]]; then
+ atlas_install_libs libptcblas.a -L. -latlas -lm ${PTLIBS}
+ atlas_install_pc ptcblas atlas-cblas-threads
+ alternatives_for cblas atlas-threads 0 \
+ /usr/$(get_libdir)/pkgconfig/cblas.pc atlas-cblas-threads.pc \
+ /usr/include/cblas.h atlas/cblas.h
+ fi
+
+ if use lapack; then
+ PCREQ="cblas"
+ # clapack
+ atlas_install_libs libatlclapack.a -L. -latlcblas -latlas -lm
+ atlas_install_pc atlclapack atlas-clapack
+
+ # clapack threaded
+ if [[ -e libptclapack.a ]]; then
+ atlas_install_libs libptclapack.a -L. -lptcblas -latlas -lm ${PTLIBS}
+ atlas_install_pc ptclapack atlas-clapack-threads
+ fi
+ fi
+
+ if use fortran; then
+ LINK=$(tc-getF77) PCREQ=
+
+ # blas
+ atlas_install_libs libf77blas.a -L. -latlas -lm
+ atlas_install_pc f77blas atlas-blas
+ alternatives_for blas atlas 0 \
+ /usr/$(get_libdir)/pkgconfig/blas.pc atlas-blas.pc
+
+ # blas threaded
+ if [[ -e libptf77blas.a ]]; then
+ atlas_install_libs libptf77blas.a -L. -latlas -lm ${PTLIBS}
+ atlas_install_pc ptf77blas atlas-blas-threads
+ alternatives_for blas atlas-threads 0 \
+ /usr/$(get_libdir)/pkgconfig/blas.pc atlas-blas-threads.pc
+ fi
+
+ if use lapack; then
+ PCREQ="blas cblas"
+ # lapack
+ atlas_install_libs libatllapack.a \
+ -L. -latlcblas -lf77blas -latlas -lm
+ atlas_install_pc atllapack atlas-lapack
+ alternatives_for lapack atlas 0 \
+ /usr/$(get_libdir)/pkgconfig/lapack.pc atlas-lapack.pc
+ # lapack threaded
+ if [[ -e libptlapack.a ]]; then
+ atlas_install_libs libptlapack.a \
+ -L. -lptcblas -lptf77blas -latlas -lm ${PTLIBS}
+ atlas_install_pc ptlapack atlas-lapack-threads
+ alternatives_for lapack atlas-threads 0 \
+ /usr/$(get_libdir)/pkgconfig/lapack.pc atlas-lapack-threads.pc
+ fi
+ fi
+ fi
+
+ cd "${S}" || die
+ insinto /usr/include/${PN}
+ doins include/*.h
+
+ cd "${S}/doc" || die
+ dodoc INDEX.txt AtlasCredits.txt ChangeLog
+ use doc && dodoc atlas*pdf cblas.pdf cblasqref.pdf
+ use doc && use fortran && dodoc f77blas*pdf
+ use doc && use fortran && use lapack && dodoc *lapack*pdf
+}
diff --git a/sci-libs/atlas/files/atlas-3.11.39-dolastcomp.patch b/sci-libs/atlas/files/atlas-3.11.39-dolastcomp.patch
new file mode 100644
index 0000000..3cd554c
--- /dev/null
+++ b/sci-libs/atlas/files/atlas-3.11.39-dolastcomp.patch
@@ -0,0 +1,13 @@
+diff --git a/src/threads/blas/level3/ATL_tammm_G.c b/src/threads/blas/level3/ATL_tammm_G.c
+index a43a08b..77c78f4 100644
+--- a/src/threads/blas/level3/ATL_tammm_G.c
++++ b/src/threads/blas/level3/ATL_tammm_G.c
+@@ -479,7 +479,7 @@ static void DoCompNoCopy(ATL_tamm_gOOO_t *pd, ATL_UINT rank, TYPE *wC)
+ #ifndef TCPLX
+ #undef rC
+ #endif
+-void DoLastComp(ATL_tamm_gOOO_t *pd, ATL_UINT rank, TYPE *wC)
++static void DoLastComp(ATL_tamm_gOOO_t *pd, ATL_UINT rank, TYPE *wC)
+ {
+ ipinfo_t *ip=pd->ip;
+ TYPE *wA=pd->wA, *wB=pd->wB, *C=pd->C;