diff options
Diffstat (limited to 'sci-libs/mkl/mkl-10.3.4.191.ebuild')
-rw-r--r-- | sci-libs/mkl/mkl-10.3.4.191.ebuild | 117 |
1 files changed, 66 insertions, 51 deletions
diff --git a/sci-libs/mkl/mkl-10.3.4.191.ebuild b/sci-libs/mkl/mkl-10.3.4.191.ebuild index 14d4532..0193f91 100644 --- a/sci-libs/mkl/mkl-10.3.4.191.ebuild +++ b/sci-libs/mkl/mkl-10.3.4.191.ebuild @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: $ -EAPI=3 +EAPI=4 INTEL_DPN=parallel_studio_xe INTEL_DID=2158 INTEL_DPV=2011_update2 @@ -34,26 +34,9 @@ src_prepare() { chmod u+w -R opt } -# help: http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/ -# mkl_add_prof <compiler lib> <thread lib> mkl_add_prof() { - local libs="-Wl,--start-group -lmkl_${1} -lmkl_${2} -lmkl_core -Wl,--end-group" - local prof=mkl - [[ ${1} == gf* ]] && prof=mkl-gfortran - if [[ ${2} == intel_thread ]]; then - libs="${libs} -liomp5 -pthread" - prof="${prof}-intel_omp" - elif [[ ${2} == gnu_thread ]]; then - libs="${libs} -fopenmp -pthread" - prof="${prof}-gnu_omp" - elif [[ ${2} == pgi_thread ]]; then - libs="${libs} -mp -pthread -pgf90libs" - prof="${prof}-pg_omp" - elif [[ ${2} == sequential ]]; then - libs="${libs} -pthread" - prof="${prof}-sequential" - fi - [[ ${1} == *_ilp64 ]] && prof="${prof}-int64" + local x prof=${1} + shift cat <<-EOF > ${prof}.pc prefix=${INTEL_SDP_EDIR}/mkl libdir=\${prefix}/lib/ @@ -63,45 +46,77 @@ mkl_add_prof() { Version: ${PV} URL: ${HOMEPAGE} Libs: -L\${libdir} ${libs} - Cflags: -I\${includedir} + Cflags: -I\${includedir} ${cflags} EOF - local libdir=$(get_libdir) - use amd64 && [[ ${1} != *lp64 ]] && libdir=lib32 - insinto /usr/${libdir}/pkgconfig + insinto /usr/$(get_libdir)/pkgconfig doins ${prof}.pc || die - local x pkgs="blas lapack" - [[ ${1} != gf* ]] && pkgs="blas lapack cblas lapacke" - for x in ${pkgs}; do - alternatives_for ${x} ${prof} 0 \ - "/usr/$(get_libdir)/pkgconfig/${x}.pc" "${prof}.pc" - done - local ext= - [[ ${1} == *lp64 ]] && ext=_${1#*_} - sed \ - -e "s/-Wl,--end-group/-lmkl_blacs_intelmpi${ext} -Wl,--end-group/" \ - ${prof}.pc > ${prof}-blacs.pc - [[ -z ${ext} ]] && ext=_core - sed \ - -e "s/-Wl,--start-group/-lmkl_scalapack${ext}/" \ - ${prof}-blacs.pc > ${prof}-scalapack.pc - for x in blacs scalapack; do + for x in $*; do alternatives_for ${x} ${prof} 0 \ "/usr/$(get_libdir)/pkgconfig/${x}.pc" "${prof}.pc" done } +# mkl_prof [_ilp64 or _lp64] +# help: http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/ +mkl_prof() { + local scal="-lmkl_scalapack${1:-_core}" + local blacs="-lmkl_blacs_intelmpi${1}" + local gf="-Wl,--start-group -lmkl_gf${1}" + local intel="-Wl,--start-group -lmkl_intel${1}" + local core="-lmkl_core -Wl,--end-group" + local prof=mkl + [[ ${1} == *ilp64 ]] && prof=mkl-int64 && cflags=-DMKL_ILP64 + + 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 + core="-lmkl_core ${blacs} -Wl,--end-group" + libs="${gf} -lmkl_sequential ${core} -lpthread" \ + mkl_add_prof ${prof}-gfortran blacs + libs="${intel} -lmkl_sequential ${core} -lpthread" \ + mkl_add_prof ${prof}-intel blacs + libs="${scal} ${gf} -lmkl_sequential ${core} -lpthread" \ + mkl_add_prof ${prof}-gfortran scalapack + libs="${scal} ${intel} -lmkl_sequential ${core} -lpthread" \ + mkl_add_prof ${prof}-intel scalapack + libs="${gf} -lmkl_gnu_thread ${core} -fopenmp -lpthread" \ + mkl_add_prof ${prof}-gfortran-openmp blacs + libs="${intel} -lmkl_gnu_thread ${core} -fopenmp -lpthread" \ + mkl_add_prof ${prof}-gcc-openmp blacs + libs="${intel} -lmkl_intel_thread ${core} -liomp5 -lpthread" \ + mkl_add_prof ${prof}-intel-openmp blacs + libs="${scal} ${gf} -lmkl_gnu_thread ${core} -fopenmp -lpthread" \ + mkl_add_prof ${prof}-gfortran-openmp scalapack + libs="${scal} ${intel} -lmkl_intel_thread ${core} -liomp5 -lpthread" \ + mkl_add_prof ${prof}-intel-openmp scalapack + libs="-lmkl_rt ${blacs} -lpthread" \ + mkl_add_prof ${prof}-dynamic blacs + libs="-lmkl_rt ${blacs} -liomp5 -lpthread" \ + mkl_add_prof ${prof}-dynamic-openmp blacs + libs="${scal} -lmkl_rt ${blacs} -lpthread" \ + mkl_add_prof ${prof}-dynamic scalapack + libs="${scal} -lmkl_rt ${blacs} -liomp5 -lpthread" \ + mkl_add_prof ${prof}-dynamic-openmp scalapack +} + src_install() { intel-sdp_src_install - local comps="gf intel" - if use amd64 && use multilib; then - comps="${comps} gf_lp64 gf_ilp64 intel_lp64 intel_ilp64" - elif use amd64; then - comps="gf_lp64 gf_ilp64 intel_lp64 intel_ilp64" + use x86 && mkl_prof + if use amd64; then + mkl_prof _lp64 + mkl_prof _ilp64 fi - local c t - for c in ${comps}; do - for t in gnu_thread intel_thread sequential; do - mkl_add_prof ${c} ${t} - done - done } |