blob: 939620aded96d5570b58a98be84473e51a70530a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=4
INTEL_DPN=parallel_studio_xe
INTEL_DID=2158
INTEL_DPV=2011_update2
INTEL_SUBDIR=composerxe
inherit intel-sdp multilib alternatives-2
DESCRIPTION="Intel Math Kernel Library: linear algebra, fft, math functions"
HOMEPAGE="http://software.intel.com/en-us/articles/intel-mkl/"
IUSE=""
DEPEND=""
RDEPEND=">=dev-libs/intel-common-12"
QA_PREBUILT="
${INTEL_SDP_DIR}/mkl/lib/*/*
${INTEL_SDP_DIR}/mkl/examples/lapack/lib/*
${INTEL_SDP_DIR}/mkl/tests/cblas/source/*
${INTEL_SDP_DIR}/mkl/benchmarks/linpack/*
${INTEL_SDP_DIR}/mkl/benchmarks/mp_linpack/*/*/*"
CHECKREQS_DISK_BUILD=1536
INTEL_BIN_RPMS="mkl mkl-devel"
INTEL_DAT_RPMS="mkl-common"
src_prepare() {
chmod u+w -R opt
}
mkl_add_prof() {
local pcname=${1} libs cflags x
shift
[[ ${pcname} = *int64* ]] && cflags=-DMKL_ILP64
cat <<-EOF > ${pcname}.pc
prefix=${INTEL_SDP_EDIR}/mkl
libdir=\${prefix}/lib/${IARCH}
includedir=\${prefix}/include
Name: ${pcname}
Description: ${DESCRIPTION}
Version: ${PV}
URL: ${HOMEPAGE}
Libs: -L\${libdir} ${libs}
Cflags: -I\${includedir} ${cflags}
EOF
insinto /usr/$(get_libdir)/pkgconfig
doins ${pcname}.pc
for x in $*; do
alternatives_for ${x} ${pcname/-${x}} 0 \
/usr/$(get_libdir)/pkgconfig/${x}.pc ${pcname}.pc
done
}
# mkl_prof [_ilp64 or _lp64]
# help: http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/
mkl_prof() {
local bits=""
if [[ ${IARCH} == intel64 ]]; then
bits=_lp64
[[ ${1} == int64 ]] && bits=_ilp64
fi
local gf="-Wl,--start-group -lmkl_gf${bits}"
local intel="-Wl,--start-group -lmkl_intel${bits}"
local core="-lmkl_core -Wl,--end-group"
local prof=mkl${IARCH:((${#IARCH} - 2)):2}
[[ ${1} == int64 ]] && prof=${prof}-int64
local libs
libs="${gf} -lmkl_sequential ${core} -lpthread" \
mkl_add_prof ${prof}-gfortran blas lapack
libs="${intel} -lmkl_sequential ${core} -lpthread" \
mkl_add_prof ${prof}-intel blas lapack cblas lapacke
libs="${gf} -lmkl_gnu_thread ${core} -fopenmp -lpthread" \
mkl_add_prof ${prof}-gfortran-openmp blas lapack
libs="${intel} -lmkl_gnu_thread ${core} -fopenmp -lpthread" \
mkl_add_prof ${prof}-gcc-openmp cblas lapacke
libs="${intel} -lmkl_intel_thread ${core} -openmp -lpthread" \
mkl_add_prof ${prof}-intel-openmp blas lapack cblas lapacke
libs="-lmkl_rt -lpthread" \
mkl_add_prof ${prof}-dynamic blas lapack cblas lapacke
libs="-lmkl_rt -liomp5 -lpthread" \
mkl_add_prof ${prof}-dynamic-openmp blas lapack cblas lapacke
# blacs and scalapack
local scal="-lmkl_scalapack${bits:-_core}"
local blacs="-lmkl_blacs_intelmpi${bits}"
core="-lmkl_core ${blacs} -Wl,--end-group"
libs="${gf} -lmkl_sequential ${core} -lpthread" \
mkl_add_prof ${prof}-gfortran-blacs blacs
libs="${scal} ${gf} -lmkl_sequential ${core} -lpthread" \
mkl_add_prof ${prof}-gfortran-scalapack scalapack
libs="${intel} -lmkl_sequential ${core} -lpthread" \
mkl_add_prof ${prof}-intel-blacs blacs
libs="${scal} ${intel} -lmkl_sequential ${core} -lpthread" \
mkl_add_prof ${prof}-intel-scalapack scalapack
libs="${gf} -lmkl_gnu_thread ${core} -fopenmp -lpthread" \
mkl_add_prof ${prof}-gfortran-openmp-blacs blacs
libs="${scal} ${gf} -lmkl_gnu_thread ${core} -fopenmp -lpthread" \
mkl_add_prof ${prof}-gfortran-openmp-scalapack scalapack
libs="${intel} -lmkl_gnu_thread ${core} -fopenmp -lpthread" \
mkl_add_prof ${prof}-gcc-openmp-blacs blacs
libs="${scal} ${intel} -lmkl_gnu_thread ${core} -fopenmp -lpthread" \
mkl_add_prof ${prof}-gcc-openmp-scalapack scalapack
libs="${intel} -lmkl_intel_thread ${core} -liomp5 -lpthread" \
mkl_add_prof ${prof}-intel-openmp-blacs blacs
libs="${scal} ${intel} -lmkl_intel_thread ${core} -liomp5 -lpthread" \
mkl_add_prof ${prof}-intel-openmp-scalapack scalapack
libs="-lmkl_rt ${blacs} -lpthread" \
mkl_add_prof ${prof}-dynamic-blacs blacs
libs="${scal} -lmkl_rt ${blacs} -lpthread" \
mkl_add_prof ${prof}-dynamic-scalapack scalapack
libs="-lmkl_rt ${blacs} -liomp5 -lpthread" \
mkl_add_prof ${prof}-dynamic-openmp-blacs blacs
libs="${scal} -lmkl_rt ${blacs} -liomp5 -lpthread" \
mkl_add_prof ${prof}-dynamic-openmp-scalapack scalapack
}
src_install() {
intel-sdp_src_install
for IARCH in ${INTEL_ARCH}; do
mkl_prof
echo >> 35mkl "LDPATH=${INTEL_SDP_EDIR}/mkl/lib/${IARCH}"
[[ ${IARCH} == intel64 ]] && mkl_prof int64
done
doenvd 35mkl
}
|