aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-libs/mkl')
-rw-r--r--sci-libs/mkl/Manifest20
-rw-r--r--sci-libs/mkl/files/blas.pc.in10
-rw-r--r--sci-libs/mkl/files/cblas.pc.in11
-rw-r--r--sci-libs/mkl/files/digest-mkl-9.1.0213
-rw-r--r--sci-libs/mkl/files/lapack.pc.in11
-rw-r--r--sci-libs/mkl/mkl-9.1.021.ebuild288
6 files changed, 343 insertions, 0 deletions
diff --git a/sci-libs/mkl/Manifest b/sci-libs/mkl/Manifest
new file mode 100644
index 000000000..2d87527c8
--- /dev/null
+++ b/sci-libs/mkl/Manifest
@@ -0,0 +1,20 @@
+AUX blas.pc.in 272 RMD160 6cda1e3b357cd20f9d11cace684eb052e7cb20e1 SHA1 5a93a650c3fe32adc8de432d94ea9037d3a97cea SHA256 21ae12b8f1ca4f01b7ce046276a0558ad03b79a6f511cbdd5e20f80530326160
+MD5 f37aa52613f32364296f5adef64029c5 files/blas.pc.in 272
+RMD160 6cda1e3b357cd20f9d11cace684eb052e7cb20e1 files/blas.pc.in 272
+SHA256 21ae12b8f1ca4f01b7ce046276a0558ad03b79a6f511cbdd5e20f80530326160 files/blas.pc.in 272
+AUX cblas.pc.in 296 RMD160 006666d64f4a623c65975a5f9f541588796aff73 SHA1 4930a616d6c6ce4218c95e9b54e7f59671bd585f SHA256 73d5e224fd48c7c7b3a36a2d7ecae2ada6ae1635b9893cfbd7d69e11b1775380
+MD5 57b2d177663b4182e7c4c43001f9fa61 files/cblas.pc.in 296
+RMD160 006666d64f4a623c65975a5f9f541588796aff73 files/cblas.pc.in 296
+SHA256 73d5e224fd48c7c7b3a36a2d7ecae2ada6ae1635b9893cfbd7d69e11b1775380 files/cblas.pc.in 296
+AUX lapack.pc.in 280 RMD160 29c8001a4939e550f29f44ae49c66bcf2faae038 SHA1 bf66106da2b4b017f588ecf916260e52d2c11d64 SHA256 e2201c50675f5e4636e8c5d19ba6a9fba3904789a35369ec8bbed83b8c493a2c
+MD5 18e0d606b5e2065c44e06ea054bc7e62 files/lapack.pc.in 280
+RMD160 29c8001a4939e550f29f44ae49c66bcf2faae038 files/lapack.pc.in 280
+SHA256 e2201c50675f5e4636e8c5d19ba6a9fba3904789a35369ec8bbed83b8c493a2c files/lapack.pc.in 280
+DIST l_mkl_enh_p_9.1.021.tgz 315862164 RMD160 fc9f14524cd44e76ac69506141aa8b6e78d4995d SHA1 96eafab1a1619a51b7faeda969939360972b245b SHA256 782ae0a8979c83610ba2dec3c55d932d7203b73a167226066788101f7957865a
+EBUILD mkl-9.1.021.ebuild 7447 RMD160 f4fdf0c0e827f1554d50fe713325ef094bb3f3c6 SHA1 75234c43437dfb6c24e618e45f4c1df9a4046eb2 SHA256 e8f248a086d7249ed30e6aa87b24935fc4b54b8c10ea7a818777638bb329459c
+MD5 9ad9ced840c4ea935562805a6c30eab5 mkl-9.1.021.ebuild 7447
+RMD160 f4fdf0c0e827f1554d50fe713325ef094bb3f3c6 mkl-9.1.021.ebuild 7447
+SHA256 e8f248a086d7249ed30e6aa87b24935fc4b54b8c10ea7a818777638bb329459c mkl-9.1.021.ebuild 7447
+MD5 5277e1494714b111af3290faca8e9705 files/digest-mkl-9.1.021 259
+RMD160 1faff5072544958e224437f0a7fc50c92b11b7b3 files/digest-mkl-9.1.021 259
+SHA256 c49d4ff5fd3ea1be9b6b08bd87a0d830aba832d24d928eeec02b7642f87ed927 files/digest-mkl-9.1.021 259
diff --git a/sci-libs/mkl/files/blas.pc.in b/sci-libs/mkl/files/blas.pc.in
new file mode 100644
index 000000000..b9bd2e3b3
--- /dev/null
+++ b/sci-libs/mkl/files/blas.pc.in
@@ -0,0 +1,10 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=/usr/@LIBDIR@
+includedir=/usr/include
+
+Name: blas
+Description: MKL implementations of the F77 Basic Linear Algebra Subroutines
+Version: @PV@
+URL: http://developer.intel.com/software/products/mkl/
+Libs: -L${libdir} -lblas @EXTLIBS@
diff --git a/sci-libs/mkl/files/cblas.pc.in b/sci-libs/mkl/files/cblas.pc.in
new file mode 100644
index 000000000..eea3d786f
--- /dev/null
+++ b/sci-libs/mkl/files/cblas.pc.in
@@ -0,0 +1,11 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=/usr/@LIBDIR@
+includedir=/usr/include
+
+Name: cblas
+Description: MKL implementations of the C Basic Linear Algebra Subroutines
+Version: @PV@
+URL: http://developer.intel.com/software/products/mkl/
+Libs: -L${libdir} -lcblas @EXTLIBS@
+Cflags: -I${includedir}
diff --git a/sci-libs/mkl/files/digest-mkl-9.1.021 b/sci-libs/mkl/files/digest-mkl-9.1.021
new file mode 100644
index 000000000..5d4c92a94
--- /dev/null
+++ b/sci-libs/mkl/files/digest-mkl-9.1.021
@@ -0,0 +1,3 @@
+MD5 1694ca067d26c624858fcc2595522174 l_mkl_enh_p_9.1.021.tgz 315862164
+RMD160 fc9f14524cd44e76ac69506141aa8b6e78d4995d l_mkl_enh_p_9.1.021.tgz 315862164
+SHA256 782ae0a8979c83610ba2dec3c55d932d7203b73a167226066788101f7957865a l_mkl_enh_p_9.1.021.tgz 315862164
diff --git a/sci-libs/mkl/files/lapack.pc.in b/sci-libs/mkl/files/lapack.pc.in
new file mode 100644
index 000000000..5b88c64a0
--- /dev/null
+++ b/sci-libs/mkl/files/lapack.pc.in
@@ -0,0 +1,11 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=/usr/@LIBDIR@
+includedir=/usr/include
+
+Name: cblas
+Description: MKL implementations of the F77 Linear Algebra PACKage
+Version: @PV@
+URL: http://developer.intel.com/software/products/mkl/
+Requires: blas
+Libs: -L${libdir} -llapack @EXTLIBS@
diff --git a/sci-libs/mkl/mkl-9.1.021.ebuild b/sci-libs/mkl/mkl-9.1.021.ebuild
new file mode 100644
index 000000000..ab7d9f202
--- /dev/null
+++ b/sci-libs/mkl/mkl-9.1.021.ebuild
@@ -0,0 +1,288 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit eutils toolchain-funcs fortran versionator
+
+MYPV="$(get_major_version ${PV}).$(get_version_component_range 2 ${PV})"
+MYP="${PN}-${MYPV}"
+
+DESCRIPTION="Intel(R) Math Kernel Library: linear algebra, fft, random number generators."
+HOMEPAGE="http://developer.intel.com/software/products/mkl/"
+SRC_URI="l_${PN}_enh_p_${PV}.tgz"
+
+LICENSE="${MYP}"
+
+# slotting mechanism would need to select proper env-variables
+# which could require a mkl-config like pkg.
+#SLOT="${MYPV}"
+SLOT="0"
+RESTRICT="strip fetch"
+KEYWORDS="~x86 ~amd64 ~ia64"
+IUSE="threads int64 fortran95 fftw doc examples"
+
+DEPEND="app-admin/eselect-blas
+ app-admin/eselect-cblas
+ app-admin/eselect-lapack"
+
+RDEPEND="${DEPEND}
+ dev-util/pkgconfig
+ doc? ( app-doc/blas-docs app-doc/lapack-docs )"
+
+MKL_DIR=/opt/intel/${PN}/${MYPV}
+
+pkg_nofetch() {
+ einfo "Please download the intel mkl from:"
+ einfo "http://www.intel.com/software/products/mkl/downloads/lin_mkl.htm"
+ einfo "and place it in ${DISTDIR}"
+ einfo "Also you need to register in ${HOMEPAGE}"
+ einfo "and keep the license Intel sent you"
+ einfo "SRC=${A}"
+}
+
+pkg_setup() {
+ # setting up license
+ [[ -z "${MKL_LICENSE}" ]] && MKL_LICENSE="$(find /opt/intel/licenses -name *MKL*.lic)"
+ if [[ -z "${MKL_LICENSE}" ]]; then
+ eerror "Did not find any valid mkl license."
+ eerror "Please locate your license file and run:"
+ eerror "\t MKL_LICENSE=/my/license/dir emerge ${PN}"
+ eerror "or place your license in /opt/intel/licenses"
+ eerror "Hint: the license file is in the email Intel sent you"
+ die "setup mkl license failed"
+ fi
+
+ # setting up compilers
+ MKL_CC=gnu
+ [[ "$(tc-getCC)" == "icc" ]] && MKL_CC=icc
+ FORTRAN="gfortran ifc g77"
+ use fortran95 && FORTRAN="gfortran ifc"
+ use int64 && FORTRAN="gfortran ifc"
+ fortran_pkg_setup
+}
+
+src_unpack() {
+
+ ewarn
+ ewarn "Intel ${PN} requires in average 400Mb of disk space"
+ ewarn "Make sure you have them on ${PORTAGE_TMPDIR} and in /opt"
+ ewarn
+ unpack ${A}
+
+ cd l_${PN}_*_${PV}/install
+
+ # need to make a file to install non-interactively.
+ # to produce such a file, first do it interactively
+ # tar xf l_*; ./install.sh --duplicate mkl.ini;
+ # the file will be instman/mkl.ini
+
+ # binary blob extractor installs log crap in /opt/intel
+ #addwrite /opt/intel
+ cp ${MKL_LICENSE} ${WORKDIR}/
+ MKL_LICENSE="$(basename ${MKL_LICENSE})"
+ cat > mkl.ini << EOF
+[MKL]
+EULA_ACCEPT_REJECT=ACCEPT
+FLEXLM_LICENSE_LOCATION=${WORKDIR}/${MKL_LICENSE}
+INSTALLMODE=NONRPM
+INSTALL_DESTINATION=${S}
+EOF
+ einfo "Extracting ..."
+ ./install \
+ --silent ${PWD}/mkl.ini \
+ --log log.txt &> /dev/null
+
+ [[ -z $(find "${S}" -name libmkl.so) ]] \
+ && die "extracting failed"
+
+ # remove unused stuff and set up intel names
+ rm -rf "${WORKDIR}"/l_*
+ case ${ARCH} in
+ x86) MKL_ARCH=32
+ MKL_KERN=ia32
+ rm -rf "${S}"/lib*/*64*
+ ;;
+ amd64) MKL_ARCH=em64t
+ MKL_KERN=em64t
+ rm -rf "${S}"/lib*/32 "${S}"/lib*/64
+ ;;
+ ia64) MKL_ARCH=64
+ MKL_KERN=ipf
+ rm -rf "${S}"/lib*/32 "${S}"/lib*/em64t
+ ;;
+ esac
+
+ MKL_PROF="serial"
+
+ if use threads; then
+ MKL_PROF="${MKL_PROF} regular"
+ else
+ rm -rf "${S}"/lib
+ fi
+
+ if use int64; then
+ MKL_PROF="${MKL_PROF} ilp64"
+ else
+ rm -rf "${S}"/lib_ilp64
+ fi
+
+ # fix a bad makefile in the test
+ if [[ ${FORTRANC} == gfortran ]] || [[ ${FORTRANC} == if* ]]; then
+ sed -i \
+ -e "s/g77/${FORTRANC}/" \
+ -e 's/-DGNU_USE//' \
+ "${S}"/tests/fftf/makefile \
+ || die "sed fftf test failed"
+ fi
+}
+
+src_compile() {
+
+ if use fortran95; then
+ for p in ${MKL_PROF}; do
+ einfo "Compiling fortan95 wrappers for ${p}"
+ for x in blas95 lapack95; do
+ cd "${S}"/interfaces/${x}
+ emake \
+ FC=${FORTRANC} \
+ MKL_SUBVERS=${p} \
+ lib${MKL_ARCH} \
+ || die "emake $(basename ${x}) failed"
+ done
+ done
+ fi
+
+ if use fftw; then
+ for p in ${MKL_PROF}; do
+ einfo "Compiling fftw wrappers for ${p}"
+ for x in "${S}"/interfaces/fft*; do
+ cd "${x}"
+ emake \
+ F=${MKL_CC} \
+ MKL_SUBVERS=${p} \
+ lib${MKL_ARCH} \
+ || die "emake $(basename ${x}) failed"
+ done
+ done
+ fi
+}
+
+src_test() {
+ local usegnu
+ [ ${FORTRANC} = g77 -o ${MKL_CC} = gnu ] && usegnu=gnu
+ for testdir in blas cblas fftc fftf; do
+ cd "${S}"/tests/${testdir}
+ for p in ${MKL_PROF}; do
+ einfo "Testing ${testdir} for ${p}"
+ emake -j1 \
+ F=${usegnu} \
+ FC=${FORTRANC} \
+ MKL_SUBVERS=${p} \
+ lib${MKL_ARCH} \
+ || die "emake ${testdir} failed"
+ done
+ done
+}
+
+# usage: mkl_install_lib <serial|regular|ilp64>
+mkl_install_lib() {
+
+ local proflib=lib_${1}
+ [[ "${1}" == "regular" ]] && proflib=lib
+ local libdir="${MKL_DIR}/${proflib}/${MKL_ARCH}"
+ local prof=${PN}
+ local extlibs
+ [[ "${FORTRANC}" == "gfortran" ]] && \
+ extlibs="${extlibs} -L${libdir} -lmkl_gfortran"
+ if [[ "${1}" == "regular" ]]; then
+ extlibs="${extlibs} -L${libdir} -lguide -lpthread"
+ prof=${prof}-threads
+ fi
+ [[ "${1}" == "ilp64" ]] && prof=${prof}-int64
+
+ cp -pPR "${S}"/${proflib} "${D}"${MKL_DIR}
+
+ for x in blas cblas; do
+ cat > eselect.${x}.${prof} << EOF
+${libdir}/libmkl_${MKL_KERN}.a /usr/@LIBDIR@/lib${x}.a
+${libdir}/libmkl.so /usr/@LIBDIR@/lib${x}.so
+${libdir}/libmkl.so /usr/@LIBDIR@/lib${x}.so.0
+${libdir}/${x}.pc /usr/@LIBDIR@/pkgconfig/${x}.pc
+EOF
+
+ [[ ${x} == cblas ]] && \
+ echo "${MKL_DIR}/include/mkl_cblas.h /usr/include/cblas.h" >> eselect.${x}.${prof}
+ eselect ${x} add $(get_libdir) eselect.${x}.${prof} ${prof}
+ sed -e "s:@LIBDIR@:$(get_libdir):" \
+ -e "s:@PV@:${PV}:" \
+ -e "s:@EXTLIBS@:${extlibs}:g" \
+ "${FILESDIR}"/${x}.pc.in > ${x}.pc || die "sed ${x}.pc failed"
+ insinto ${libdir}
+ doins ${x}.pc
+ done
+
+ cat > eselect.lapack.${prof} << EOF
+${libdir}/libmkl_lapack.a /usr/@LIBDIR@/liblapack.a
+${libdir}/libmkl_lapack.so /usr/@LIBDIR@/liblapack.so
+${libdir}/libmkl_lapack.so /usr/@LIBDIR@/liblapack.so.0
+${libdir}/lapack.pc /usr/@LIBDIR@/pkgconfig/lapack.pc
+EOF
+ sed -e "s:@LIBDIR@:$(get_libdir):" \
+ -e "s:@PV@:${PV}:" \
+ -e "s:@EXTLIBS@:${extlibs}:g" \
+ "${FILESDIR}"/lapack.pc.in > lapack.pc || die "sed lapack.pc failed"
+ insinto ${libdir}
+ doins lapack.pc
+
+ eselect lapack add $(get_libdir) eselect.lapack.${prof} ${prof}
+ echo "LDPATH=${libdir}" > 35mkl
+}
+
+src_install() {
+
+ # install license
+ if [ ! -f "/opt/intel/licenses/${MKL_LICENSE}" ]; then
+ insinto /opt/intel/licenses
+ doins ${WORKDIR}/${MKL_LICENSE}
+ fi
+
+ # keep intel dir in /opt as default install
+ insinto ${MKL_DIR}
+ doins -r include man tools || die "doins include|man|tools failed"
+
+ use examples && doins -r examples
+
+ insinto ${MKL_DIR}/doc
+ doins doc/*.txt
+ use doc && doins doc/*.pdf doc/*.htm
+
+ # take care of lib and eselect files
+ for p in ${MKL_PROF}; do
+ mkl_install_lib ${p}
+ done
+
+ echo "MANPATH=${MKL_DIR}/man" >> 35mkl
+ echo "INCLUDE=${MKL_DIR}/include" >> 35mkl
+ doenvd 35mkl || die "doenvd failed"
+}
+
+pkg_postinst() {
+ # set default profile according to upstream
+ local defprof="${PN}-${FORTRANC}"
+ if use int64; then
+ defprof="${defprof}-int64"
+ elif use threads; then
+ defprof="${defprof}-threads"
+ fi
+
+ for x in blas cblas lapack; do
+ if [[ -z "$(eselect ${x} show)" ]]; then
+ eselect ${x} set ${defprof}
+ fi
+ done
+ # some useful info
+ elog "Use 'eselect <lib>' (as root) to select one of the"
+ elog "MKL <lib> profiles, where lib = blas, cblas or lapack"
+ elog "Once selected, use 'pkg-config --libs <lib>' to link with MKL."
+ elog "With C, add 'pkg-config --cflags <lib>' to compile."
+}