# ChangeLog for sci-libs/mkl
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/mkl/ChangeLog,v 1.45 2011/10/21 16:40:44 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/mkl/ChangeLog,v 1.46 2011/10/23 21:21:28 jlec Exp $
+
+ 23 Oct 2011; Justin Lecher <jlec@gentoo.org> -mkl-10.0.2.018-r2.ebuild,
+ -mkl-9.1.023.ebuild, metadata.xml, mkl-10.0.5.025.ebuild:
+ Fixed check-reqs.eclass usage, #388237; cleaned old
21 Jun 2011; Justin Lecher <jlec@gentoo.org> mkl-9.1.023.ebuild,
mkl-10.0.2.018-r2.ebuild, mkl-10.0.5.025.ebuild:
-----BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
+Hash: SHA512
AUX blas.pc.in 288 RMD160 f4398c1cdebed7dbbf881b1aa55ee9c638526110 SHA1 11212030183e53093043c5ed8fa0b048600e5054 SHA256 94eb01ae01b2d77e6961501cc12013c38324747226bb6857016a2f3af7858275
AUX cblas.pc.in 306 RMD160 ec34e5cfc9a60064bfa9cf14a4acabb78a6d709c SHA1 a91c8e40ac4696e102a5040bd6a1a4f7e306b2c3 SHA256 ab5066a967f2d75aa3c16447940413d05f02b1ed82da06b94aa5982da6d4d90a
AUX lapack.pc.in 297 RMD160 2e0c015255711fc6f166402787f449c081fffbb0 SHA1 9ab6b431665345c1d80fc9cb998f8c6c18bea1a9 SHA256 b158edeef6796fb84c40b3d6d483144e655139d6cf92f8a738d1765ddaaa0b80
AUX mkl-10.0.2.018-openmpi.patch 332 RMD160 255a2cb3fdba6fd1803d830e9cd791da954d958f SHA1 6a3a7b690873c9bc4c003f47739dfa9394ab9627 SHA256 758c3aef0124932426002aa502c0e7b721a026d6c54c37c679d3ee7eb607b58c
AUX mkl-10.0.2.018-tests.patch 528 RMD160 15f11a38567bd533626008fce62e6021372bfc53 SHA1 8c9358d798f597e87d8a62fff27b79123273ebe3 SHA256 f65a074c64a3969b08d41f88874f25fdc06693b5a5aee930bd7ef9763e94e71d
-DIST l_mkl_enh_p_9.1.023.tgz 316915220 RMD160 afdcb8ef28053e9ee5b1a3f8b9e6126c58b94f4b SHA1 9b03333627ab69cf9139838444e6e43d0b7404c8 SHA256 609ba57261b4959dfc8e6e56959f93ff7dba7b568ca5c80e09f4013df0207106
-DIST l_mkl_p_10.0.2.018.tgz 227440983 RMD160 0c28416597ef917328193fa0c6403d7c0e7b971d SHA1 1aa8c47701b142ab52ebcda27fdda4c5d0903471 SHA256 311d2885a33d553a2d1b1370eed1e3e9bccc246f2dcd20e3558ed492443ba20f
DIST l_mkl_p_10.0.5.025.tgz 230389719 RMD160 b961c3ce36795b3aae2d22badbcf1bbb5bd29d63 SHA1 a052b3ad6163dab7a29911eb408ca6577507f492 SHA256 c98f2c5c652c02ac7200cba40d996b1f11b567278d849016b7ee3b0320e26e3c
-DIST l_mkl_p_9.1.023.tgz 155907883 RMD160 f5d34a170c77fe9929daf6a83bade6d845ada2ad SHA1 52693b9aca15d43a890af92e0686b651834baace SHA256 7315e35a48b8cbe5af4cdcd24b2ccbd3971048b40e965ccaf9b4d655d98bdecd
-EBUILD mkl-10.0.2.018-r2.ebuild 9898 RMD160 9d4e890ff98522ddd3bccee0127f3785288d5abd SHA1 ccaeca650821d7d6b3219c0e3e4b3f48c6fcaa51 SHA256 ce1ea000d4926721ad1ea48e0aae667d45b26c177ee04bfb91b3c4996813c3dd
-EBUILD mkl-10.0.5.025.ebuild 10052 RMD160 8552d5242c19434e82bd74b0c99edb260627ed1d SHA1 57305b071d097a0c8720785c55e4679d4cc865c9 SHA256 c4ad55337d3086c050c40b0115b8c6c10cfe2b52a0524eee8df1b1cfd085f59b
-EBUILD mkl-9.1.023.ebuild 8942 RMD160 1028ad9d0d9aba54bd6bdea710a1265a2cac165f SHA1 d5730bf6ddba630a7308c63fb9364a06f7265faa SHA256 374bbd87286a25629ad4b0d19efc40c81e58a487b699a25873a0e96745e7451a
-MISC ChangeLog 9173 RMD160 7c1ebde851c549b0538c9fcc84abc9893fb2ffb4 SHA1 d4436f779b51187623127d25ef8f8f8a11a6eff9 SHA256 1516d20189aae12cc56839cf83d7e29b7789d545f3e9e75c5daa16e62a5f9fe4
-MISC metadata.xml 858 RMD160 40285d03152575e5d0cb91abc9fb61c1af3e7abc SHA1 88f8f122cfdf350a8fcff81f72b2c056438ffe37 SHA256 fcff9afd76b48ea7e812ea8a32a78ab8325379ce28e0893032d46c06d00a5a8a
+EBUILD mkl-10.0.5.025.ebuild 10059 RMD160 437576395781d6cd2384a6270afee8a3e41d3603 SHA1 7cbb18b0917d1b5052e07af6e90cc4ff512af225 SHA256 d7978093a0e2802940fad7e1d7f8ce295f44ac51e176753006616f4fa918b5af
+MISC ChangeLog 9357 RMD160 632a790bc461b5569912b2a9bee75520b1458ba8 SHA1 829cb58688a0233e37a78a1ef569c74b7080cc9f SHA256 78f2c88f8ce5db63ff7fdb3f80e66a257a46ce83dee2ab2ff3d24bd3aeab1bf7
+MISC metadata.xml 862 RMD160 9670bea3fe0538b49d064c82ed36da9086bbaf6f SHA1 477dd1ef8cee8c011eb0bdc8bbaad899a252e565 SHA256 3a5871b25b1fdc8209cbd56eed9316ced3c580c05701dd82a5dc5ccf65c87777
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
-iQEcBAEBAgAGBQJOoaBoAAoJEEdUh39IaPFNTl4H+wdJ3uqiz3NrhpYTdv+Cm4vx
-CIGmqtOlBiA7eTF2SQMs2+5GA+r1fUJ3u7kQOklFZJ7lelCucZSVT+3mP9C4VMJN
-O5ALsfWXqHr8FSgaHn3KNO8XSSunQLwe7GjS5BIRqFddEgcj+IcztCGDi4x3v5s7
-MoTuQCcdLv7ygK/1Kjalw9dwrAVpJsRsfuZtG+HGUxoz/bN8i/0538XEhyfWgOEd
-mJTArTC7sFbCQKCkdQH1IlQGmEwLowZKolZl2xnWg1hgC8aY9CdiE4t+HTa98hTD
-+bTQOiHZ9gRd5x4YG591zCUyXAiqpQy349+HGiU01DeooWq3d9gxHGQjZ4NkRF0=
-=3nY9
+iEYEAREKAAYFAk6khWIACgkQgAnW8HDreRYWAwCfb6ZCo9FaZbxWVeRHJYg3k9la
+ZzMAoNH/r1AY+xJLgc38WZZ3eB0JisO9
+=D3Kc
-----END PGP SIGNATURE-----
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
-<herd>sci</herd>
-<longdescription lang="en">
+ <herd>sci</herd>
+ <longdescription lang="en">
The Intel(R) Math Kernel Library is a mathematical library mostly
optimized for Intel processors (also works on AMDs). It contains BLAS
and LAPACK implementations, Fast Fourier Transforms, a vector math
capacities. The package is installed as binary and has a restrictive
license. Please see license terms and home page for proper use.
</longdescription>
-<use>
- <flag name='fortran95'>Installs the BLAS/LAPACK FORTRAN95 static libraries</flag>
- <flag name='int64'>Installs the 64 bits integer libraries</flag>
- <flag name='serial'>Installs the serial (as non-threaded) libraries</flag>
-</use>
+ <use>
+ <flag name="fortran95">Installs the BLAS/LAPACK FORTRAN95 static libraries</flag>
+ <flag name="int64">Installs the 64 bits integer libraries</flag>
+ <flag name="serial">Installs the serial (as non-threaded) libraries</flag>
+ </use>
</pkgmetadata>
+++ /dev/null
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/mkl/mkl-10.0.2.018-r2.ebuild,v 1.10 2011/06/21 15:12:15 jlec Exp $
-
-inherit eutils fortran-2 toolchain-funcs check-reqs
-
-PID=967
-PB=${PN}
-DESCRIPTION="Intel(R) Math Kernel Library: linear algebra, fft, math functions"
-HOMEPAGE="http://developer.intel.com/software/products/mkl/"
-
-KEYWORDS="~amd64 ~ia64 ~x86"
-SRC_URI="http://registrationcenter-download.intel.com/irc_nas/${PID}/l_${PN}_p_${PV}.tgz"
-
-SLOT="0"
-LICENSE="Intel-SDP"
-
-IUSE="doc fftw fortran95 int64 mpi"
-RESTRICT="strip mirror"
-
-DEPEND="
- app-admin/eselect-blas
- app-admin/eselect-cblas
- app-admin/eselect-lapack
- virtual/fortran"
-
-RDEPEND="${DEPEND}
- doc? ( app-doc/blas-docs app-doc/lapack-docs )
- mpi? ( virtual/mpi )"
-
-MKL_DIR=/opt/intel/${PN}/${PV}
-INTEL_LIC_DIR=/opt/intel/licenses
-
-get_fcomp() {
- case $(tc-getFC) in
- *gfortran* )
- FCOMP="gfortran" ;;
- ifort )
- FCOMP="ifc" ;;
- * )
- FCOMP=$(tc-getFC) ;;
- esac
-}
-
-pkg_setup() {
- fortran-2_pkg_setup
- # Check the license
- if [[ -z ${MKL_LICENSE} ]]; then
- MKL_LICENSE="$(grep -ls MKern ${ROOT}${INTEL_LIC_DIR}/* | tail -n 1)"
- MKL_LICENSE=${MKL_LICENSE/${ROOT}/}
- fi
- if [[ -z ${MKL_LICENSE} ]]; then
- eerror "Did not find any valid mkl license."
- eerror "Register at ${HOMEPAGE} to receive a license"
- eerror "and place it in ${INTEL_LIC_DIR} or run:"
- eerror "export MKL_LICENSE=/my/license/file emerge mkl"
- die "license setup failed"
- fi
-
- # Check if we have enough free diskspace to install
- CHECKREQS_DISK_BUILD="1100"
- check_reqs
-
- # Check and setup fortran
- if use fortran95; then
- # blas95 and lapack95 don't compile with gfortran < 4.2
- [[ $(tc-getFC) =~ (gfortran|g77) ]] && [[ $(gcc-major-version)$(gcc-minor-version) -lt 42 ]] &&
- die "blas95 and lapack95 don't compile with gfortran < 4.2"
- fi
- MKL_FC="gnu"
- [[ $(tc-getFC) =~ if ]] && MKL_FC="intel"
-
- # build profiles according to what compiler is installed
- MKL_CC="gnu"
- [[ $(tc-getCC) == icc ]] && MKL_CC="intel"
-
- if has_version sys-cluster/mpich; then
- MKL_MPI=mpich
- elif has_version sys-cluster/mpich2; then
- MKL_MPI=mpich2
- elif has_version sys-cluster/openmpi; then
- MKL_MPI=openmpi
- else
- MKL_MPI=intelmpi
- fi
- get_fcomp
-}
-
-src_unpack() {
-
- unpack ${A}
- cd l_${PN}_*_${PV}/install
-
- cp ${MKL_LICENSE} "${WORKDIR}"/
- MKL_LIC="$(basename ${MKL_LICENSE})"
-
- # binary blob extractor installs rpm leftovers in /opt/intel
- addwrite /opt/intel
- # undocumented features: INSTALLMODE_mkl=NONRPM
-
- # We need to install mkl non-interactively.
- # If things change between versions, first do it interactively:
- # tar xf l_*; ./install.sh --duplicate mkl.ini;
- # The file will be instman/mkl.ini
- # Then check it and modify the ebuild-created one below
- # --norpm is required to be able to install 10.x
- cat > mkl.ini <<-EOF
- [MKL]
- EULA_ACCEPT_REJECT=ACCEPT
- FLEXLM_LICENSE_LOCATION=${WORKDIR}/${MKL_LIC}
- INSTALLMODE_mkl=NONRPM
- INSTALL_DESTINATION=${S}
- EOF
- einfo "Extracting ..."
- ./install \
- --silent ./mkl.ini \
- --installpath "${S}" \
- --log log.txt &> /dev/null
-
- if [[ -z $(find "${S}" -name libmkl.so) ]]; then
- eerror "Could not find extracted files"
- eerror "See ${PWD}/log.txt to see why"
- die "extracting failed"
- fi
- # remove left over
- rm -f /opt/intel/.*mkl*.log /opt/intel/intel_sdp_products.db
-
- # remove unused stuff and set up intel names
- rm -rf "${WORKDIR}"/l_*
-
- cd "${S}"
- # allow openmpi to work
- epatch "${FILESDIR}"/${P}-openmpi.patch
- # make scalapack tests work for gfortran
- epatch "${FILESDIR}"/${P}-tests.patch
- case ${ARCH} in
- x86) MKL_ARCH=32
- MKL_KERN=ia32
- rm -rf lib*/{em64t,64}
- ;;
-
- amd64) MKL_ARCH=em64t
- MKL_KERN=em64t
- rm -rf lib*/{32,64}
- ;;
-
- ia64) MKL_ARCH=64
- MKL_KERN=ipf
- rm -rf lib*/{32,em64t}
- ;;
- esac
- MKL_LIBDIR=${MKL_DIR}/lib/${MKL_ARCH}
-}
-
-src_compile() {
- cd "${S}"/interfaces
- if use fortran95; then
- einfo "Compiling fortan95 static lib wrappers"
- local myconf="lib${MKL_ARCH}"
- [[ $(tc-getFC) =~ gfortran ]] && \
- myconf="${myconf} FC=gfortran"
- if use int64; then
- myconf="${myconf} interface=ilp64"
- [[ $(tc-getFC) =~ gfortran ]] && \
- myconf="${myconf} FOPTS=-fdefault-integer-8"
- fi
- for x in blas95 lapack95; do
- pushd ${x}
- emake ${myconf} || die "emake ${x} failed"
- popd
- done
- fi
-
- if use fftw; then
- local fftwdirs="fftw2xc fftw2xf fftw3xc fftw3xf"
- local myconf="lib${MKL_ARCH} compiler=${MKL_CC}"
- if use mpi; then
- fftwdirs="${fftwdirs} fftw2x_cdft"
- myconf="${myconf} mpi=${MKL_MPI}"
- fi
- einfo "Compiling fftw static lib wrappers"
- for x in ${fftwdirs}; do
- pushd ${x}
- emake ${myconf} || die "emake ${x} failed"
- popd
- done
- fi
-}
-
-src_test() {
- cd "${S}"/tests
- local myconf
- local testdirs="blas cblas"
- use int64 && myconf="${myconf} interface=ilp64"
- if use mpi; then
- testdirs="${testdirs} scalapack"
- myconf="${myconf} mpi=${MKL_MPI}"
- fi
- for x in ${testdirs}; do
- pushd ${x}
- einfo "Testing ${x}"
- emake \
- compiler=${MKL_FC} \
- ${myconf} \
- so${MKL_ARCH} \
- || die "emake ${x} failed"
- popd
- done
-}
-
-mkl_make_generic_profile() {
- cd "${S}"
- # produce eselect files
- # don't make them in FILESDIR, it changes every major version
- cat > eselect.blas <<-EOF
- ${MKL_LIBDIR}/libmkl_${MKL_KERN}.a /usr/@LIBDIR@/libblas.a
- ${MKL_LIBDIR}/libmkl.so /usr/@LIBDIR@/libblas.so
- ${MKL_LIBDIR}/libmkl.so /usr/@LIBDIR@/libblas.so.0
- EOF
- cat > eselect.cblas <<-EOF
- ${MKL_LIBDIR}/libmkl_${MKL_KERN}.a /usr/@LIBDIR@/libcblas.a
- ${MKL_LIBDIR}/libmkl.so /usr/@LIBDIR@/libcblas.so
- ${MKL_LIBDIR}/libmkl.so /usr/@LIBDIR@/libcblas.so.0
- ${MKL_DIR}/include/mkl_cblas.h /usr/include/cblas.h
- EOF
- cat > eselect.lapack <<-EOF
- ${MKL_LIBDIR}/libmkl_lapack.a /usr/@LIBDIR@/liblapack.a
- ${MKL_LIBDIR}/libmkl_lapack.so /usr/@LIBDIR@/liblapack.so
- ${MKL_LIBDIR}/libmkl_lapack.so /usr/@LIBDIR@/liblapack.so.0
- EOF
-}
-
-# usage: mkl_add_profile <profile> <interface_lib> <thread_lib> <rtl_lib>
-mkl_add_profile() {
- cd "${S}"
- local prof=${1}
- for x in blas cblas lapack; do
- cat > ${x}-${prof}.pc <<-EOF
- prefix=${MKL_DIR}
- libdir=${MKL_LIBDIR}
- includedir=\${prefix}/include
- Name: ${x}
- Description: Intel(R) Math Kernel Library implementation of ${x}
- Version: ${PV}
- URL: ${HOMEPAGE}
- EOF
- done
- cat >> blas-${prof}.pc <<-EOF
- Libs: -Wl,--no-as-needed -L\${libdir} ${2} ${3} -lmkl_core ${4} -lpthread
- EOF
- cat >> cblas-${prof}.pc <<-EOF
- Requires: blas
- Libs: -Wl,--no-as-needed -L\${libdir} ${2} ${3} -lmkl_core ${4} -lpthread
- Cflags: -I\${includedir}
- EOF
- cat >> lapack-${prof}.pc <<-EOF
- Requires: blas
- Libs: -Wl,--no-as-needed -L\${libdir} ${2} ${3} -lmkl_core -lmkl_lapack ${4} -lpthread
- EOF
- insinto ${MKL_LIBDIR}
- for x in blas cblas lapack; do
- doins ${x}-${prof}.pc
- cp eselect.${x} eselect.${x}.${prof}
- echo "${MKL_LIBDIR}/${x}-${prof}.pc /usr/@LIBDIR@/pkgconfig/${x}.pc" \
- >> eselect.${x}.${prof}
- eselect ${x} add $(get_libdir) eselect.${x}.${prof} ${prof}
- done
-}
-
-mkl_make_profiles() {
- local clib
- has_version 'dev-lang/ifc' && clib="intel"
- built_with_use sys-devel/gcc fortran && clib="${clib} gf"
- local slib="-lmkl_sequential"
- local rlib="-liomp5"
- local pbase=${PN}
- for c in ${clib}; do
- local ilib="-lmkl_${c}_lp64"
- use x86 && ilib="-lmkl_${c}"
- local tlib="-lmkl_${c/gf/gnu}_thread"
- local comp="${c/gf/gfortran}"
- comp="${comp/intel/ifort}"
- mkl_add_profile ${pbase}-${comp} ${ilib} ${slib}
- mkl_add_profile ${pbase}-${comp}-threads ${ilib} ${tlib} ${rlib}
- if use int64; then
- ilib="-lmkl_${c}_ilp64"
- mkl_add_profile ${pbase}-${comp}-int64 ${ilib} ${slib}
- mkl_add_profile ${pbase}-${comp}-threads-int64 ${ilib} ${tlib} ${rlib}
- fi
- done
-}
-
-src_install() {
- dodir ${MKL_DIR}
- # upstream installs a link, no idea why
- dosym ${MKL_DIR} ${MKL_DIR/mkl/cmkl}
-
- # install license
- if [[ ! -f ${INTEL_LIC_DIR}/${MKL_LIC} ]]; then
- insinto ${INTEL_LIC_DIR}
- doins "${WORKDIR}"/${MKL_LIC} || die "install license failed"
- fi
-
- # install main stuff: cp faster than doins
- einfo "Installing files..."
- local cpdirs="benchmarks doc examples include interfaces lib man tests"
- local doinsdirs="tools"
- cp -pPR ${cpdirs} "${D}"${MKL_DIR} \
- || die "installing mkl failed"
- insinto ${MKL_DIR}
- doins -r ${doinsdirs} || die "doins ${doinsdirs} failed"
- dosym mkl_cblas.h ${MKL_DIR}/include/cblas.h
-
- # install blas/lapack profiles
- mkl_make_generic_profile
- mkl_make_profiles
-
- # install env variables
- local env_file=35mkl
- echo "LDPATH=${MKL_LIBDIR}" > ${env_file}
- echo "MANPATH=${MKL_DIR}/man" >> ${env_file}
- doenvd ${env_file} || die "doenvd failed"
-}
-
-pkg_postinst() {
- # if blas profile is mkl, set lapack and cblas profiles as mkl
- local blas_prof=$(eselect blas show | cut -d' ' -f2)
- local def_prof="mkl-gfortran-threads"
- has_version 'dev-lang/ifc' && def_prof="mkl-ifort-threads"
- use int64 && def_prof="${def_prof}-int64"
- for x in blas cblas lapack; do
- local cur_prof=$(eselect ${x} show | cut -d' ' -f2)
- if [[ -z ${cur_prof} || ${cur_prof} == ${def_prof} ]]; then
- # work around eselect bug #189942
- local configfile="${ROOT}"/etc/env.d/${x}/$(get_libdir)/config
- [[ -e ${configfile} ]] && rm -f ${configfile}
- eselect ${x} set ${def_prof}
- elog "${x} has been eselected to ${def_prof}"
- else
- elog "Current eselected ${x} is ${current_lib}"
- elog "To use one of mkl profiles, issue (as root):"
- elog "\t eselect ${x} set <profile>"
- fi
- if [[ ${blas_prof} == mkl* && ${cur_prof} != ${blas_prof} ]]; then
- eselect blas set ${def_prof}
- elog "${x} is now set to ${def_prof} for consistency"
- fi
- done
- if [[ $(gcc-major-version)$(gcc-minor-version) -lt 42 ]]; then
- elog "Multi-threading OpenMP for GNU compilers only available"
- elog "with gcc >= 4.2. Make sure you have a compatible version"
- elog "and select it with gcc-config before selecting gnu profiles"
- fi
-}
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/mkl/mkl-10.0.5.025.ebuild,v 1.14 2011/10/21 16:40:44 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-libs/mkl/mkl-10.0.5.025.ebuild,v 1.15 2011/10/23 21:21:28 jlec Exp $
inherit eutils fortran-2 toolchain-funcs check-reqs
PID=1232
PB=${PN}
+
DESCRIPTION="Intel(R) Math Kernel Library: linear algebra, fft, math functions"
HOMEPAGE="http://developer.intel.com/software/products/mkl/"
SRC_URI="http://registrationcenter-download.intel.com/irc_nas/${PID}/l_${PN}_p_${PV}.tgz"
fi
# Check if we have enough free diskspace to install
- CHECKREQS_DISK_BUILD="1100"
- check_reqs
+ CHECKREQS_DISK_BUILD="1100M"
+ check_reqs_pkg_setup
# Check and setup fortran
if use fortran95; then
+++ /dev/null
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-libs/mkl/mkl-9.1.023.ebuild,v 1.16 2011/06/21 15:12:15 jlec Exp $
-
-inherit eutils fortran-2 versionator toolchain-funcs
-
-PID=779
-PB=${PN}
-DESCRIPTION="Intel(R) Math Kernel Library: linear algebra, fft, random number generators."
-HOMEPAGE="http://developer.intel.com/software/products/mkl/"
-
-KEYWORDS="~x86 ~amd64 ~ia64"
-SRC_URI="!int64? ( !serial? ( http://registrationcenter-download.intel.com/irc_nas/${PID}/l_${PN}_p_${PV}.tgz ) )
- int64? ( http://registrationcenter-download.intel.com/irc_nas/${PID}/l_${PN}_enh_p_${PV}.tgz )
- serial? ( http://registrationcenter-download.intel.com/irc_nas/${PID}/l_${PN}_enh_p_${PV}.tgz )"
-
-MAJOR=$(get_major_version ${PV})
-MINOR=$(get_version_component_range 2 ${PV})
-
-#slotting not yet supported
-#SLOT="${MAJOR}.${MINOR}"
-SLOT="0"
-LICENSE="Intel-SDP"
-
-IUSE="serial int64 fortran95 fftw doc examples"
-RESTRICT="strip mirror"
-
-DEPEND="
- app-admin/eselect-blas
- app-admin/eselect-cblas
- app-admin/eselect-lapack
- virtual/fortran"
-
-RDEPEND="${DEPEND}
- doc? ( app-doc/blas-docs app-doc/lapack-docs )"
-
-MKL_DIR=/opt/intel/${PN}/${MAJOR}.${MINOR}
-
-get_fcomp() {
- case $(tc-getFC) in
- *gfortran* )
- FCOMP="gfortran" ;;
- ifort )
- FCOMP="ifc" ;;
- * )
- FCOMP=$(tc-getFC) ;;
- esac
-}
-
-pkg_setup() {
- fortran-2_pkg_setup
- # setting up license
- [[ -z ${MKL_LICENSE} && -d /opt/intel/licenses ]] && \
- 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
- get_fcomp
-}
-
-src_unpack() {
-
- ewarn
- local dp=950
- ! use serial && ! use int64 && dp=400
- ewarn "Intel ${PN} requires ${dp}Mb of disk space"
- ewarn "Make sure you have enough in ${PORTAGE_TMPDIR}, /tmp 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 rpm leftovers in /opt/intel
- addwrite /opt/intel
- cp ${MKL_LICENSE} "${WORKDIR}"/
- MKL_LIC="$(basename ${MKL_LICENSE})"
- cat > mkl.ini <<- EOF
- [MKL]
- EULA_ACCEPT_REJECT=ACCEPT
- FLEXLM_LICENSE_LOCATION=${WORKDIR}/${MKL_LIC}
- INSTALLMODE=NONRPM
- INSTALL_DESTINATION=${S}
- EOF
- einfo "Extracting ..."
- ./install \
- --silent ${PWD}/mkl.ini \
- --log log.txt &> /dev/null
-
- if [[ -z $(find "${S}" -name libmkl.so) ]]; then
- eerror "could not find extracted files"
- eerror "see ${PWD}/log.txt to see why"
- die "extracting failed"
- fi
-
- # 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
-
- cd "${S}"
-
- # default profile regular is threaded
- MKL_PROF="regular"
- if use serial; then
- MKL_PROF="${MKL_PROF} serial"
- else
- [[ -d lib_serial ]] && rm -rf lib_serial
- fi
- if use int64; then
- MKL_PROF="${MKL_PROF} ilp64"
- else
- [[ -d lib_ilp64 ]] && rm -rf lib_ilp64
- fi
-
- # fix a bad makefile in the test
- if [[ $(tc-getFC) =~ gfortran ]] || [[ $(tc-getFC) =~ if ]]; then
- sed -i \
- -e "s/g77/$(tc-getFC)/" \
- -e 's/-DGNU_USE//' \
- tests/fftf/makefile || die "sed fftf test failed"
- fi
- # fix bad permissions on tools
- find tools -type f -perm /a+w ! -perm /a+x -exec chmod 644 '{}' \; \
- || die "permissions fix failed"
-}
-
-src_compile() {
-
- if use fortran95; then
- for p in ${MKL_PROF}; do
- einfo "Compiling fortan95 static lib wrappers for ${p}"
- for x in blas95 lapack95; do
- cd "${S}"/interfaces/${x}
- emake \
- FC=$(tc-getFC) \
- 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 static lib wrappers for ${p}"
- for x in "${S}"/interfaces/fft*; do
- cd "${x}"
- emake -j1 \
- F=${MKL_CC} \
- MKL_SUBVERS=${p} \
- lib${MKL_ARCH} \
- || die "emake $(basename ${x}) failed"
- done
- done
- fi
-}
-
-src_test() {
- local usegnu
- [[ $(tc-getFC) =~ (gfortran|g77) ]] && usegnu=gnu
- # restrict tests for blas and cblas for now.
- # for t in blas cblas fft*; do
- for t in blas lapack; do
- cd "${S}"/tests/${t}
- for p in ${MKL_PROF}; do
- einfo "Testing ${t} for ${p}"
- emake -j1 \
- F=${usegnu} \
- FC=$(tc-getFC) \
- MKL_SUBVERS=${p} \
- lib${MKL_ARCH} \
- || die "emake ${t} failed"
- done
- done
-}
-
-# usage: mkl_install_lib <serial|regular|ilp64>
-mkl_install_lib() {
-
- local proflib=lib_${1}
- local prof=${PN}-${1}
- [[ "${1}" == "regular" ]] && proflib=lib && prof=${PN}-threads
- local libdir="${MKL_DIR}/${proflib}/${MKL_ARCH}"
- local extlibs="-L${libdir} -lguide -lpthread"
- [[ "${1}" == "serial" ]] && extlibs=""
-
- [[ $(tc-getFC) =~ gfortran ]] && \
- gfortranlibs="-L${libdir} -lmkl_gfortran"
-
- 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:@INCDIR@:${MKL_DIR}/include:" \
- -e "s:@PV@:${PV}:" \
- -e "s:@EXTLIBS@:${extlibs}:g" \
- -e "s:@GFORTRANLIBS@:${gfortranlibs}: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" \
- -e "s:@GFORTRANLIBS@:${gfortranlibs}: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}"
-}
-
-src_install() {
-
- # install license
- if [[ ! -f /opt/intel/licenses/${MKL_LIC} ]]; then
- insinto /opt/intel/licenses
- doins "${WORKDIR}"/${MKL_LIC} || die "install license failed"
- fi
-
- dodir ${MKL_DIR}
- # keep intel dir in /opt as default install
- einfo "Installing headers, man pages and tools"
- # use cp, too slow with doins
- cp -pPR include man tools "${D}"${MKL_DIR} || die "install include|man|tools failed"
-
- if use examples; then
- einfo "Installing examples"
- cp -pPR examples "${D}"${MKL_DIR} || die "install examples failed"
- fi
-
- insinto ${MKL_DIR}/doc
- doins doc/*.txt || die "basic doc install failed"
- if use doc; then
- einfo "Installing documentation"
- cp -pPR doc/*.pdf doc/*.htm "${D}"${MKL_DIR}/doc || die "doc failed"
- fi
-
- # take care of lib and eselect files
- local env_file=35mkl
- for p in ${MKL_PROF}; do
- einfo "Installing profile: ${p}"
- mkl_install_lib ${p} > ${env_file}
- done
-
- echo "MANPATH=${MKL_DIR}/man" >> ${env_file}
- doenvd ${env_file} || die "doenvd failed"
-}
-
-pkg_postinst() {
- # set default profile according to upstream
- local ext=threads
- if use int64; then
- ext=int64
- elif use serial; then
- ext=serial
- fi
- ESELECT_PROF="${PN}-${FCOMP}-${ext}"
- # if blas profile is mkl, set lapack and cblas profiles as mkl
- local blas_lib=$(eselect blas show | cut -d' ' -f2)
- for p in blas cblas lapack; do
- local current_lib=$(eselect ${p} show | cut -d' ' -f2)
- if [[ -z ${current_lib} || \
- ${current_lib} == ${ESELECT_PROF} || \
- ${blas_lib} == ${ESELECT_PROF} ]]; then
- # work around eselect bug #189942
- local configfile="${ROOT}"/etc/env.d/${p}/$(get_libdir)/config
- [[ -e ${configfile} ]] && rm -f ${configfile}
- eselect ${p} set ${ESELECT_PROF}
- elog "${p} has been eselected to ${ESELECT_PROF}"
- if [[ ${current_lib} != ${blas_lib} ]]; then
- eselect blas set ${ESELECT_PROF}
- elog "${p} has been eselected to ${ESELECT_PROF} for consistency"
- fi
- else
- elog "Current eselected ${p} is ${current_lib}"
- elog "To use ${p} ${ESELECT_PROF} implementation, you have to issue (as root):"
- elog "\t eselect ${p} set ${ESELECT_PROF}"
- fi
- done
-}