diff options
author | Michał Górny <mgorny@gentoo.org> | 2021-12-02 15:14:35 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2021-12-02 15:14:35 +0100 |
commit | fa2033778ab7dc6fb258b270565fa62a9bb0bb03 (patch) | |
tree | c8de7c87fc806b178b8bab220ee8917d33b35668 /dev-python | |
parent | dev-python/numexpr: Add missing DEPEND (diff) | |
download | gentoo-fa2033778ab7dc6fb258b270565fa62a9bb0bb03.tar.gz gentoo-fa2033778ab7dc6fb258b270565fa62a9bb0bb03.tar.bz2 gentoo-fa2033778ab7dc6fb258b270565fa62a9bb0bb03.zip |
dev-python/numexpr: Attempt to fix building against mkl
Use pkg-config to get appropriate include directory and library list
from mkl. Fix config key names. Unfortunately, the package is still
broken:
INTEL MKL ERROR: /usr/lib64/libmkl_vml_def.so: undefined symbol: mkl_lapack_dspevd.
Intel MKL FATAL ERROR: cannot load libmkl_vml_def.so.
However, that seems to be a problem inside mkl itself.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python')
-rw-r--r-- | dev-python/numexpr/numexpr-2.8.0.ebuild | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/dev-python/numexpr/numexpr-2.8.0.ebuild b/dev-python/numexpr/numexpr-2.8.0.ebuild index 0ed9199d12ec..2de92876f671 100644 --- a/dev-python/numexpr/numexpr-2.8.0.ebuild +++ b/dev-python/numexpr/numexpr-2.8.0.ebuild @@ -6,7 +6,7 @@ EAPI=8 PYTHON_COMPAT=( python3_{8..10} ) PYTHON_REQ_USE="threads(+)" -inherit distutils-r1 +inherit distutils-r1 toolchain-funcs DESCRIPTION="Fast numerical array expression evaluator for Python and NumPy" HOMEPAGE="https://github.com/pydata/numexpr" @@ -22,18 +22,43 @@ DEPEND=" mkl? ( sci-libs/mkl ) " RDEPEND=${DEPEND} +BDEPEND=" + mkl? ( virtual/pkgconfig ) +" python_prepare_all() { # TODO: mkl can be used but it fails for me # only works with mkl in tree. newer mkl will use pkgconfig if use mkl; then - use amd64 && local ext="_lp64" + local suffix= + use amd64 && local suffix="-lp64" + + local flags=( + $($(tc-getPKG_CONFIG) --cflags --libs "mkl-dynamic${suffix}-iomp") + ) + local f libdirs=() incdirs=() libs=() + for f in "${flags[@]}"; do + case ${f} in + -I*) + incdirs+=( "${f#-I}" ) + ;; + -L*) + libdirs+=( "${f#-L}" ) + ;; + -l*) + libs+=( "${f#-l}" ) + ;; + *) + die "Unexpected flag in pkg-config output: ${f}" + ;; + esac + done + cat > site.cfg <<- _EOF_ || die [mkl] - library_dirs = ${MKLROOT}/lib/em64t - include_dirs = ${MKLROOT}/include - mkl_libs = mkl_solver${ext}, mkl_intel${ext}, \ - mkl_intel_thread, mkl_core, iomp5 + library_dirs = $(IFS=:; echo "${libdirs[*]}") + include_dirs = $(IFS=:; echo "${incdirs[*]}") + libraries = $(IFS=:; echo "${libs[*]}") _EOF_ fi |