diff options
author | Sebastien Fabbro <bicatali@gentoo.org> | 2008-03-29 09:12:27 +0000 |
---|---|---|
committer | Sebastien Fabbro <bicatali@gentoo.org> | 2008-03-29 09:12:27 +0000 |
commit | d4b588414b7a750dd7451e97648255a846d5c780 (patch) | |
tree | 884e2916ff9ed13ec444b034329dcdc56738693b /sci-libs/mkl | |
parent | Changed sed separator to : for robust path string substitution (BLAS_LIBS) (diff) | |
download | historical-d4b588414b7a750dd7451e97648255a846d5c780.tar.gz historical-d4b588414b7a750dd7451e97648255a846d5c780.tar.bz2 historical-d4b588414b7a750dd7451e97648255a846d5c780.zip |
Version bump. Much rewriting for new linking framework in layers, and eselect profiles. Closing bug #201465, thanks Eric Thibodeau for his initial work
Package-Manager: portage-2.1.4.4
Diffstat (limited to 'sci-libs/mkl')
-rw-r--r-- | sci-libs/mkl/ChangeLog | 11 | ||||
-rw-r--r-- | sci-libs/mkl/Manifest | 16 | ||||
-rw-r--r-- | sci-libs/mkl/files/mkl-10.0.2.018-openmpi.patch | 18 | ||||
-rw-r--r-- | sci-libs/mkl/files/mkl-10.0.2.018-tests.patch | 21 | ||||
-rw-r--r-- | sci-libs/mkl/mkl-10.0.2.018.ebuild | 328 |
5 files changed, 392 insertions, 2 deletions
diff --git a/sci-libs/mkl/ChangeLog b/sci-libs/mkl/ChangeLog index 840e87ff5544..a95af7dea822 100644 --- a/sci-libs/mkl/ChangeLog +++ b/sci-libs/mkl/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for sci-libs/mkl # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-libs/mkl/ChangeLog,v 1.22 2008/01/08 09:53:37 bicatali Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-libs/mkl/ChangeLog,v 1.23 2008/03/29 09:12:26 bicatali Exp $ + +*mkl-10.0.2.018 (29 Mar 2008) + + 29 Mar 2008; Sébastien Fabbro <bicatali@gentoo.org> + +files/mkl-10.0.2.018-openmpi.patch, +files/mkl-10.0.2.018-tests.patch, + +mkl-10.0.2.018.ebuild: + Version bump. Much rewriting for new linking framework in layers, and + eselect profiles. Closing bug #201465, thanks Eric Thibodeau for his + initial work 08 Jan 2008; Sébastien Fabbro <bicatali@gentoo.org> files/blas.pc.in, files/cblas.pc.in, files/lapack.pc.in, mkl-9.1.023.ebuild: diff --git a/sci-libs/mkl/Manifest b/sci-libs/mkl/Manifest index a530777f9d85..116249a9ad25 100644 --- a/sci-libs/mkl/Manifest +++ b/sci-libs/mkl/Manifest @@ -1,8 +1,22 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + 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_9.1.023.tgz 155907883 RMD160 f5d34a170c77fe9929daf6a83bade6d845ada2ad SHA1 52693b9aca15d43a890af92e0686b651834baace SHA256 7315e35a48b8cbe5af4cdcd24b2ccbd3971048b40e965ccaf9b4d655d98bdecd +EBUILD mkl-10.0.2.018.ebuild 9084 RMD160 7b97226ccdc8bbaa07b0134752a7cb70a9fd776c SHA1 5b627022256137c882e0db77fb06b4cfe14899be SHA256 1cb5e24cf5adf1e866af6ac3146e3199c3c412b2e28025d2bf3f127b18548b36 EBUILD mkl-9.1.023.ebuild 8892 RMD160 e91c9f013cc43bce6eee882dddbb0524730d6dc7 SHA1 5c9bd8c4cb22d3da629aed92f5a9efed3fc12cfb SHA256 55bc642dbd2de8410d43fcdc443295939600d23508311b22c41963b1da46ceb5 -MISC ChangeLog 5085 RMD160 8c96da4a3e24e0cda21ccc18896a93e7b906f5b4 SHA1 68fceda116a93250a88c6b250d124ad53a48bae3 SHA256 79f0deff36421e81b8b615a7020ed7c336a39c4eadb50efe5544699f43fdb51a +MISC ChangeLog 5430 RMD160 917b58aaabeaa8587286da6340431e1d6e103a44 SHA1 92f560c50aed51743df6a2db58ac7059e20af218 SHA256 149ebfe341ede077d703a05fd9330a7c45992eb6d38fbd04da120067746263d2 MISC metadata.xml 605 RMD160 a48ecbc106b8037bc5ea0c075d0b1efe1c9532b2 SHA1 ca9d24da338e47cbeceec284d724405291d4d29a SHA256 449f256f34be916da81300d86c5c224fd01aeb378d35c10274de9b42e61896da +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.7 (GNU/Linux) + +iD8DBQFH7ggL1ycZbhPLE2ARAhQ5AJwJE0bqbu0jU3ZwO30pb1z5DFraZgCgog1E +IBcPvImX6UJ+qvUulPF/Y6g= +=s6Py +-----END PGP SIGNATURE----- diff --git a/sci-libs/mkl/files/mkl-10.0.2.018-openmpi.patch b/sci-libs/mkl/files/mkl-10.0.2.018-openmpi.patch new file mode 100644 index 000000000000..6f7f9edebb0f --- /dev/null +++ b/sci-libs/mkl/files/mkl-10.0.2.018-openmpi.patch @@ -0,0 +1,18 @@ +--- interfaces/fftw2x_cdft/makefile.orig 2008-03-11 23:26:26.287984332 +0000 ++++ interfaces/fftw2x_cdft/makefile 2008-03-13 10:56:44.755095617 +0000 +@@ -172,6 +172,15 @@ + endif + + ++ifeq ($(mpi),openmpi) ++CS = mpicc ++ifdef mpidir ++_CS = $(mpidir)/bin/$(CS) ++else ++_CS = $(CS) ++endif ++endif ++ + vpath %.c wrappers + + $(WRP): %.o: %.c diff --git a/sci-libs/mkl/files/mkl-10.0.2.018-tests.patch b/sci-libs/mkl/files/mkl-10.0.2.018-tests.patch new file mode 100644 index 000000000000..975170f7dbc0 --- /dev/null +++ b/sci-libs/mkl/files/mkl-10.0.2.018-tests.patch @@ -0,0 +1,21 @@ +--- tests/scalapack/make.inc.orig 2008-03-13 22:36:06.119890888 +0000 ++++ tests/scalapack/make.inc 2008-03-13 22:54:58.201781899 +0000 +@@ -59,6 +59,9 @@ + IFACE_PART = _ilp64 + COPTS = -DMKL_ILP64 + FOPTS = -i8 ++ifeq ($(compiler),gnu) ++FOPTS = -fdefault-integer-8 ++endif + else + ADD_IFACE = _lp64 + IFACE_PART = _lp64 +@@ -203,7 +206,7 @@ + # Compiler flags + F77FLAGS=-w -u $(OPTS) + ifeq ($(comp),gnu) +-F77FLAGS=$(OPTS) -ff90 -fno-globals -Wno-globals ++F77FLAGS=$(OPTS) + endif + # Remove objects variable + RMOBJ=rm -f *.o core work.pc* diff --git a/sci-libs/mkl/mkl-10.0.2.018.ebuild b/sci-libs/mkl/mkl-10.0.2.018.ebuild new file mode 100644 index 000000000000..01b77b7f4ac1 --- /dev/null +++ b/sci-libs/mkl/mkl-10.0.2.018.ebuild @@ -0,0 +1,328 @@ +# Copyright 1999-2008 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.ebuild,v 1.1 2008/03/29 09:12:26 bicatali Exp $ + +inherit eutils toolchain-funcs fortran 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" + +#slotting not yet supported (need eselect-mkl) +#MAJOR=$(get_major_version ${PV}) +#MINOR=$(get_version_component_range 2 ${PV}) +#SLOT="${MAJOR}.${MINOR}" + +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" + +RDEPEND="${DEPEND} + dev-util/pkgconfig + doc? ( app-doc/blas-docs app-doc/lapack-docs ) + mpi? ( virtual/mpi )" + +MKL_DIR=/opt/intel/${PN}/${PV} +INTEL_LIC_DIR=/opt/intel/licenses + +pkg_setup() { + + # Check the license + [[ -z ${MKL_LICENSE} && -d ${INTEL_LIC_DIR} ]] && \ + MKL_LICENSE=$(find ${ROOT}/${INTEL_LIC_DIR} -name "*MKL*.lic" | tail -n 1) + 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 "\t MKL_LICENSE=/my/license/dir 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 + FORTRAN="gfortran ifc g77" + if use fortran95; then + FORTRAN="gfortran ifc" + # blas95 and lapack95 don't compile with gfortran < 4.2 + gcc-version lt 4 2 && FORTRAN="ifc" + fi + use int64 && FORTRAN="gfortran ifc" + fortran_pkg_setup + MKL_FC="gnu" + [[ ${FORTRANC} == 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 + elif has_version sys-cluster/lam-mpi; then + MKL_MPI=lam-mpi + else + MKL_MPI=intelmpi + fi +} + +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 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}" + [[ ${FORTRANC} == gfortran ]] && \ + myconf="${myconf} FC=gfortran" + if use int64; then + myconf="${myconf} interface=ilp64" + [[ ${FORTRANC} == 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} + insinto ${MKL_LIBDIR} + for x in blas cblas lapack; do + cat > ${x}-${prof}.pc <<-EOF + prefix=/usr + libdir=${MKL_LIBDIR} + includedir=${prefix}/include + Name: ${x} + Description: Intel(R) Math Kernel Library implementation of ${p} + Version: ${PV} + URL: ${HOMEPAGE} + Libs: -Wl,--no-as-needed -L\${libdir} ${2} ${3} -lmkl_core ${4} -lpthread + EOF + cp eselect.${x} eselect.${x}.${prof} + echo "${MKL_LIBDIR}/${x}-${prof}.pc /usr/@LIBDIR@/pkgconfig/${x}.pc" \ + >> eselect.${x}.${prof} + doins ${x}-${prof}.pc + 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" + 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 mkl-${comp} ${ilib} ${slib} + mkl_add_profile mkl-${comp}-threads ${ilib} ${tlib} ${rlib} + if use int64; then + ilib="-lmkl_${c}_ilp64" + mkl_add_profile mkl-${comp}-int64 ${ilib} ${slib} + mkl_add_profile mkl-${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" + doins ${doinsdirs} || die "doins ${doinsdirs} failed" + + # 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_lib=$(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 current_lib=$(eselect ${x} show | cut -d' ' -f2) + if [[ -z ${current_lib} || \ + ${current_lib} == mkl* || \ + ${blas_lib} == mkl* ]]; 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}" + if [[ ${current_lib} != ${blas_lib} ]]; then + eselect blas set ${def_prof} + elog "${x} is now set to ${def_prof} for consistency" + fi + 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 + done +} |