aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbicatali <bicatali@32389bae-6d03-0410-99cf-db05cde120eb>2006-02-05 19:55:36 +0000
committerbicatali <bicatali@32389bae-6d03-0410-99cf-db05cde120eb>2006-02-05 19:55:36 +0000
commit5818e13ce65144c62f7cac6dc31ec86a4141a274 (patch)
tree2140dbeb502486f509d4e2af012cc6c4c807b46c /sci-libs/mkl
parentmkl-8.0.1.006.ebuild: reworked lib install + tests (diff)
downloadsci-5818e13ce65144c62f7cac6dc31ec86a4141a274.tar.gz
sci-5818e13ce65144c62f7cac6dc31ec86a4141a274.tar.bz2
sci-5818e13ce65144c62f7cac6dc31ec86a4141a274.zip
mkl: reworked ebuild: +fortran95, rpm work and install, not yet
operational git-svn-id: http://overlays.gentoo.org/svn/proj/science/overlay@92 32389bae-6d03-0410-99cf-db05cde120eb
Diffstat (limited to 'sci-libs/mkl')
-rw-r--r--sci-libs/mkl/Manifest10
-rw-r--r--sci-libs/mkl/files/c-MKL.blas17
-rw-r--r--sci-libs/mkl/files/c-MKL.lapack17
-rw-r--r--sci-libs/mkl/files/c-threaded-MKL.blas17
-rw-r--r--sci-libs/mkl/files/c-threaded-MKL.lapack17
-rw-r--r--sci-libs/mkl/files/f77-MKL.blas16
-rw-r--r--sci-libs/mkl/files/f77-MKL.lapack16
-rw-r--r--sci-libs/mkl/files/f77-threaded.blas14
-rw-r--r--sci-libs/mkl/files/f77-threaded.lapack14
-rw-r--r--sci-libs/mkl/mkl-8.0.1.006.ebuild145
10 files changed, 228 insertions, 55 deletions
diff --git a/sci-libs/mkl/Manifest b/sci-libs/mkl/Manifest
index 9c6de9294..8b9b44222 100644
--- a/sci-libs/mkl/Manifest
+++ b/sci-libs/mkl/Manifest
@@ -1,4 +1,12 @@
MD5 f0122114658bed82421c724016249798 ChangeLog 1771
+MD5 5311f9fef4026c06a9e6bcc760a97470 files/c-MKL.blas 462
+MD5 2ab6eee4d98d7cbccf78b7edd8af8017 files/c-MKL.lapack 478
+MD5 a9b0453940d3095e2ac019bb121f24d2 files/c-threaded-MKL.blas 489
+MD5 eb996ae4287cd4e7d17c5f7e62452b10 files/c-threaded-MKL.lapack 515
MD5 f1853cde0595400d25d2fa52f079a46e files/digest-mkl-8.0.1.006 68
+MD5 ed3b188fd80ef1795622f2ffa6bfae4a files/f77-MKL.blas 417
+MD5 73b9deafc1ec5bb4398751c6875c911b files/f77-MKL.lapack 474
+MD5 12308b5448e67e8b264abf7539a97539 files/f77-threaded.blas 484
+MD5 c6dbd399b994048332e3bc58e4d449f6 files/f77-threaded.lapack 518
MD5 729a826a74e62fe48daf668e3dccefb4 metadata.xml 603
-MD5 fd9a5ed708dc2c899a16b06811257343 mkl-8.0.1.006.ebuild 3470
+MD5 e3a6968ad59ee2bd6b65af6f84047c97 mkl-8.0.1.006.ebuild 3949
diff --git a/sci-libs/mkl/files/c-MKL.blas b/sci-libs/mkl/files/c-MKL.blas
new file mode 100644
index 000000000..d8f89d0cc
--- /dev/null
+++ b/sci-libs/mkl/files/c-MKL.blas
@@ -0,0 +1,17 @@
+CFLAGS="-I/usr/include/mkl"
+CLIBS="-L/usr/$(get_libdir)/blas/mkl -lmkl_blas"
+
+setup() {
+
+MY_LIBDIR="$(get_libdir)"
+
+einfo "/usr/${MY_LIBDIR}/libcblas.so -> libmkl_blas.so"
+ln -sf blas/mkl/libmkl.so /usr/${MY_LIBDIR}/libcblas.so
+
+einfo "/usr/${MY_LIBDIR}/libcblas.so.0 -> libmkl_blas.so"
+ln -sf blas/mkl/libmkl.so /usr/${MY_LIBDIR}/libcblas.so.0
+
+einfo "/usr/${MY_LIBDIR}/libcblas.a -> libmkl_blas.a"
+ln -sf blas/mkl/libmkl_blas.a /usr/${MY_LIBDIR}/libcblas.a
+
+}
diff --git a/sci-libs/mkl/files/c-MKL.lapack b/sci-libs/mkl/files/c-MKL.lapack
new file mode 100644
index 000000000..f58f7a84d
--- /dev/null
+++ b/sci-libs/mkl/files/c-MKL.lapack
@@ -0,0 +1,17 @@
+CFLAGS="-I/usr/include/mkl"
+CLIBS="-L/usr/$(get_libdir)/lapack/mkl -lmkl_lapack"
+
+setup() {
+
+MY_LIBDIR="$(get_libdir)"
+
+einfo "/usr/${MY_LIBDIR}/libclapack.so -> libmkl.so"
+ln -sf lapack/mkl/libmkl.so /usr/${MY_LIBDIR}/libclapack.so
+
+einfo "/usr/${MY_LIBDIR}/libclapack.so.0 -> libmkl.so"
+ln -sf lapack/mkl/libmkl.so /usr/${MY_LIBDIR}/libclapack.so.0
+
+einfo "/usr/${MY_LIBDIR}/libclapack.a -> libmkl_lapack.a"
+ln -sf lapack/mkl/libmkl_lapack.a /usr/${MY_LIBDIR}/libclapack.a
+
+}
diff --git a/sci-libs/mkl/files/c-threaded-MKL.blas b/sci-libs/mkl/files/c-threaded-MKL.blas
new file mode 100644
index 000000000..4daeb77b6
--- /dev/null
+++ b/sci-libs/mkl/files/c-threaded-MKL.blas
@@ -0,0 +1,17 @@
+CFLAGS="-I/usr/include/mkl"
+CLIBS="-L/usr/$(get_libdir)/blas/mkl -lmkl_blas -lpthread"
+
+setup() {
+
+MY_LIBDIR="$(get_libdir)"
+
+einfo "/usr/${MY_LIBDIR}/libcblas.so -> libmkl.so"
+ln -sf blas/threaded-mkl/libmkl.so /usr/${MY_LIBDIR}/libcblas.so
+
+einfo "/usr/${MY_LIBDIR}/libcblas.so.0 -> libmkl.so"
+ln -sf blas/threaded-mkl/libmkl.so /usr/${MY_LIBDIR}/libcblas.so.0
+
+einfo "/usr/${MY_LIBDIR}/libcblas.a -> libmkl_blas.a"
+ln -sf blas/threaded-mkl/libmkl_blas.a /usr/${MY_LIBDIR}/libcblas.a
+
+}
diff --git a/sci-libs/mkl/files/c-threaded-MKL.lapack b/sci-libs/mkl/files/c-threaded-MKL.lapack
new file mode 100644
index 000000000..4a997958d
--- /dev/null
+++ b/sci-libs/mkl/files/c-threaded-MKL.lapack
@@ -0,0 +1,17 @@
+CFLAGS="-I/usr/include/mkl"
+CLIBS="-L/usr/$(get_libdir)/lapack/mkl -lmkl_lapack -lpthread"
+
+setup() {
+
+MY_LIBDIR="$(get_libdir)"
+
+einfo "/usr/${MY_LIBDIR}/libclapack.so -> libmkl.so"
+ln -sf lapack/threaded-mkl/libmkl.so /usr/${MY_LIBDIR}/libclapack.so
+
+einfo "/usr/${MY_LIBDIR}/libclapack.so.0 -> libmkl.so"
+ln -sf lapack/threaded-mkl/libmkl.so /usr/${MY_LIBDIR}/libclapack.so.0
+
+einfo "/usr/${MY_LIBDIR}/libclapack.a -> libmkl_lapack.a"
+ln -sf lapack/threaded-mkl/libmkl_lapack.a /usr/${MY_LIBDIR}/libclapack.a
+
+}
diff --git a/sci-libs/mkl/files/f77-MKL.blas b/sci-libs/mkl/files/f77-MKL.blas
new file mode 100644
index 000000000..5159eb5af
--- /dev/null
+++ b/sci-libs/mkl/files/f77-MKL.blas
@@ -0,0 +1,16 @@
+F77LIBS="-L/usr/$(get_libdir)/blas/mkl -lmkl"
+
+setup() {
+
+MY_LIBDIR="$(get_libdir)"
+
+einfo "/usr/${MY_LIBDIR}/libblas.so -> libmkl.so"
+ln -sf blas/mkl/libmkl.so /usr/${MY_LIBDIR}/libblas.so
+
+einfo "/usr/${MY_LIBDIR}/libblas.so.0 -> libmkl.so"
+ln -sf blas/mkl/libmkl.so /usr/${MY_LIBDIR}/libblas.so.0
+
+einfo "/usr/${MY_LIBDIR}/libblas.a -> libmkl_IKERN.a"
+ln -sf blas/mkl/libmkl_IKERN.a /usr/${MY_LIBDIR}/libblas.a
+
+}
diff --git a/sci-libs/mkl/files/f77-MKL.lapack b/sci-libs/mkl/files/f77-MKL.lapack
new file mode 100644
index 000000000..108f04536
--- /dev/null
+++ b/sci-libs/mkl/files/f77-MKL.lapack
@@ -0,0 +1,16 @@
+F77LIBS="-L/usr/$(get_libdir)/lapack/mkl -lmkl_lapack"
+
+setup() {
+
+MY_LIBDIR="$(get_libdir)"
+
+einfo "/usr/${MY_LIBDIR}/liblapack.so -> libmkl_lapack.so"
+ln -sf lapack/mkl/libmkl_lapack.so /usr/${MY_LIBDIR}/liblapack.so
+
+einfo "/usr/${MY_LIBDIR}/liblapack.so.0 -> libmkl_lapack.so"
+ln -sf lapack/mkl/libmkl_lapack.so /usr/${MY_LIBDIR}/liblapack.so.0
+
+einfo "/usr/${MY_LIBDIR}/liblapack.a -> libmkl_lapack.a"
+ln -sf lapack/mkl/libmkl_lapack.a /usr/${MY_LIBDIR}/liblapack.a
+
+}
diff --git a/sci-libs/mkl/files/f77-threaded.blas b/sci-libs/mkl/files/f77-threaded.blas
new file mode 100644
index 000000000..265043261
--- /dev/null
+++ b/sci-libs/mkl/files/f77-threaded.blas
@@ -0,0 +1,14 @@
+F77LIBS="-L/usr/$(get_libdir)/blas/threaded-mkl -lmkl_blas -lpthread"
+
+setup() {
+MY_LIBDIR="$(get_libdir)"
+
+einfo "/usr/${MY_LIBDIR}/libblas.so -> libmkl_blas.so"
+ln -sf blas/threaded-mkl/libmkl_blas.so /usr/${MY_LIBDIR}/libblas.so
+
+einfo "/usr/${MY_LIBDIR}/libblas.so.0 -> libmkl_blas.so"
+ln -sf blas/threaded-mkl/libmkl_blas.so /usr/${MY_LIBDIR}/libblas.so.0
+
+einfo "/usr/${MY_LIBDIR}/libblas.a -> libmkl_blas.a"
+ln -sf blas/threaded-mkl/libmkl_blas.a /usr/${MY_LIBDIR}/libblas.a
+}
diff --git a/sci-libs/mkl/files/f77-threaded.lapack b/sci-libs/mkl/files/f77-threaded.lapack
new file mode 100644
index 000000000..c2bd43e2c
--- /dev/null
+++ b/sci-libs/mkl/files/f77-threaded.lapack
@@ -0,0 +1,14 @@
+F77LIBS="-L/usr/$(get_libdir)/lapack/threaded-mkl -lmkl_lapack -lpthread"
+
+setup() {
+MY_LIBDIR="$(get_libdir)"
+
+einfo "/usr/${MY_LIBDIR}/liblapack.so -> libmkl_lapack.so"
+ln -sf lapack/threaded-mkl/libmkl_lapack.so /usr/${MY_LIBDIR}/liblapack.so
+
+einfo "/usr/${MY_LIBDIR}/liblapack.so.0 -> libmkl_lapack.so"
+ln -sf lapack/threaded-mkl/libmkl_lapack.so /usr/${MY_LIBDIR}/liblapack.so.0
+
+einfo "/usr/${MY_LIBDIR}/liblapack.a -> libmkl_lapack.a"
+ln -sf lapack/threaded-mkl/libmkl_lapack.a /usr/${MY_LIBDIR}/liblapack.a
+}
diff --git a/sci-libs/mkl/mkl-8.0.1.006.ebuild b/sci-libs/mkl/mkl-8.0.1.006.ebuild
index fbedad1c6..51edb4d0c 100644
--- a/sci-libs/mkl/mkl-8.0.1.006.ebuild
+++ b/sci-libs/mkl/mkl-8.0.1.006.ebuild
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
# $Header: $
-inherit eutils
+inherit fortran rpm
MYPV=${PV/.006//}
@@ -10,21 +10,32 @@ DESCRIPTION="Intel(R) Math Kernel Library: linear algebra, fft, random number ge
HOMEPAGE="http://developer.intel.com/software/products/mkl/"
SRC_URI="l_${PN}_p_${PV}.tgz"
RESTRICT="nostrip fetch"
-IUSE=""
+
+#fortran95 implements a fortran 95 blas/lapack interface
+IUSE="fortran95 examples"
SLOT="0"
-LICENSE="mkl-8.0"
+LICENSE="mkl-8.0.1"
KEYWORDS="-* ~x86 ~amd64 ~ia64"
-DEPEND="virtual/libc
- app-arch/rpm2targz"
-RDEPEND="virtual/libc
+DEPEND="virtual/libc"
+RDEPEND="${DEPEND}
app-admin/eselect"
+
PROVIDE="virtual/blas
virtual/lapack"
-# should it provide fft as well?
S="${WORKDIR}/l_${PN}_p_${PV}"
+pkg_setup() {
+ if use fortran95; then
+ FORTRAN="ifc gfortran"
+ fortran_pkg_setup
+ fi
+}
+
+
+# the whole shmol is to extract rpm files non-interactively
+# from the big mkl installation
# hopefully recyclable for ipp
src_unpack() {
@@ -42,20 +53,17 @@ src_unpack() {
ewarn
unpack ${A}
-
- # we cannot sed on such a big binary install file, so we trick it
- # fake rpm commands to exit the nasty install once done building the rpm
- # anyway, might just a dependence to rpm after all
-
+
+ # fake rpm commands to trick the big install script
mkdir -p bin
echo "exit 1" > bin/rpm2cpio
echo "exit 1" > bin/rpm
chmod +x bin/*
- export PATH=".:${PATH}:$PWD/bin"
- export INSTDIR=/opt/intel/${PN}/${MYPV}
+ PATH=".:${PATH}:$PWD/bin"
+ INSTDIR=/opt/intel/${PN}/${MYPV}
cd ${S}/install
- # create an answer file to the install program
+ # answer file to make the big install script non-interactive
echo $"
[${PN}_install]
EULA_ACCEPT_REJECT=accept
@@ -66,79 +74,108 @@ RPM_INSTALLATION=
" > answers.txt
einfo "Building rpm file (be patient)..."
- ./install --noroot --nonrpm --installpath ${S}/opt --silent answers.txt &> /dev/null
+ ./install \
+ --noroot \
+ --nonrpm \
+ --installpath ${S}/opt \
+ --silent answers.txt &> /dev/null
+
rm -rf ${WORKDIR}/bin ${S}/*
- cd ${WORKDIR}/rpm
- for x in *.rpm; do
- einfo "Extracting ${x}..."
- rpm2targz ${x} || die "rpm2targz failed"
- tar xfz ${x/.rpm/.tar.gz} -C ${S}
- rm -f ${x} ${x/.rpm/.tar.gz}
+ cd ${S}
+ for x in $(ls ../rpm/*.rpm); do
+ einfo "Extracting $(basename ${x})..."
+ rpm_unpack ${x} || die "rpm_unpack failed"
done
- mkdir ${S}/opt/intel/licenses
- cp ${PN}_license ${S}/opt/intel/licenses/
- cd ${WORKDIR}
- rm -rf rpm
+ mkdir opt/intel/licenses
+ mv ../rpm/${PN}_license opt/intel/licenses/
+
+ # clean up
+ rm -rf ${WORKDIR}/rpm
+ rm -rf ${S}${INSTDIR}/tools/environment
+}
+
+src_compile() {
+
case ${ARCH} in
amd64)
IARCH="em64t"
+ IKERN="em64t"
;;
ia64)
IARCH="64"
+ IKERN="ipf"
;;
x86)
IARCH="32"
+ IKERN="ia32"
;;
esac
- export IARCH
- # remove unnecessary stuff
+
use ${ARCH} || rm -rf ${S}${INSTDIR}/lib/${IARCH}
- rm -rf ${S}${INSTDIR}/tools/environment
-
-}
-src_compile() {
- einfo "Nothing to compile"
-}
+ if use fortran95; then
+ local fc=${FORTRANC}
+ if [ "${FORTRANC}" = "ifc" ]; then
+ fc=ifort
+ fi
+ for x in blas lapack; do
+ cd ${S}${INSTDIR}/interfaces/${x}95
+ make lib \
+ PLAT=lnx${IARCH/em64t/32e} \
+ FC=${fc} \
+ INSTALL_DIR=${S}${INSTDIR}/lib/${IARCH}
+ done
+ fi
+}
src_test() {
- # todo: testing with compilers and flags other than gcc/g77
+
+ local fc="gnu"
+ if [ "${FORTRANC}" = "ifc" ]; then
+ fc="ifort"
+ fi
+
cd ${S}${INSTDIR}/tests
for testdir in *; do
einfo "Testing $testdir"
cd $testdir
- emake so$IARCH F=gnu || die "make $testdir failed"
+ emake so$IARCH F=${fc} || die "make $testdir failed"
+ rm -rf _results
done
}
src_install () {
- #does not work
- #cp -pPR * ${D}
- cd ${S}${INSTDIR}
+ # regular intel-style installation
insinto ${INSTDIR}
- # should we keep the tests dir? if yes, remove test results
- doins -r doc examples include interfaces tools
-
+ doins -r ./${INSTDIR}/{doc,include,tools}
insinto ${INSTDIR}/lib/${IARCH}
- doins lib/${IARCH}/*.a
+ doins ./${INSTDIR}/lib/${IARCH}/*.a
insopts -m0755
- doins lib/${IARCH}/*.so
-
- #todo: make it work with eselect/blas-config/lapack-config
-
- echo "INCLUDE=${INSTDIR}/include:\${INCLUDE}" > 35mkl
- echo "LD_LIBRARY_PATH=${INSTDIR}/lib/${IARCH}:\${LD_LIBRARY_PATH}" >> 35mkl
- doenvd 35mkl
+ doins ./${INSTDIR}/lib/${IARCH}/*.so
+ insopts -m0644
+ use examples && doins -r examples
+
+ # gentoo-style installation
+ dosym ${INSTDIR}/include /usr/include${PN}
+ dodir /usr/$(get_libdir)/{blas,lapack}/{mkl,threaded-mkl}
+ # TODO: stack the shared lib to one big one, rename proper libs
+
+ # install the required configuration
+ for x in blas lapack; do
+ insinto /usr/$(get_libdir)/${x}
+ for y in f77 f77-threaded c c-threaded; do
+ newins ${FILESDIR}/${y}-MKL.${x} ${y}-MKL
+ done
+ done
}
pkg_postinst() {
einfo
- einfo "To use MKL's BLAS features, you have to issue (as root):"
- einfo "\n\teselect blas set MKL"
- einfo "To use MKL's LAPACK features, you have to issue (as root):"
- einfo "\n\teselect lapack set MKL"
+ einfo "To use MKL's linear algebra, features, you have to issue (as root):"
+ einfo "\t eselect <impl> set MKL"
+ einfo "Where <impl> is blas or lapack"
einfo
}