From f344d9ecc4b6fae88fc5795aebdbf57c5563d080 Mon Sep 17 00:00:00 2001 From: Andrew Ammerlaan Date: Sat, 10 Dec 2022 19:24:25 +0100 Subject: sci-libs/mkl: add convenience symlink without version number and drop the symlinks into /usr/include, these create file conflicts. Applications should be able to find the headers because we set the MKLROOT variable anyway. Signed-off-by: Andrew Ammerlaan --- sci-libs/mkl/mkl-2022.2.1.16993-r1.ebuild | 123 +++++++++++++++++++++++++ sci-libs/mkl/mkl-2022.2.1.16993.ebuild | 147 ------------------------------ 2 files changed, 123 insertions(+), 147 deletions(-) create mode 100644 sci-libs/mkl/mkl-2022.2.1.16993-r1.ebuild delete mode 100644 sci-libs/mkl/mkl-2022.2.1.16993.ebuild (limited to 'sci-libs') diff --git a/sci-libs/mkl/mkl-2022.2.1.16993-r1.ebuild b/sci-libs/mkl/mkl-2022.2.1.16993-r1.ebuild new file mode 100644 index 000000000000..63e646576e0a --- /dev/null +++ b/sci-libs/mkl/mkl-2022.2.1.16993-r1.ebuild @@ -0,0 +1,123 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit unpacker + +DESCRIPTION="Intel Math Kernel Library" +HOMEPAGE="https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl.html" +SRC_URI=" + https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-${PN}-$(ver_cut 1-3)-$(ver_cut 1-3)-$(ver_cut 4)_amd64.deb + https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-${PN}-devel-$(ver_cut 1-3)-$(ver_cut 1-3)-$(ver_cut 4)_amd64.deb + https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-${PN}-common-$(ver_cut 1-3)-$(ver_cut 1-3)-$(ver_cut 4)_all.deb + https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-${PN}-common-devel-$(ver_cut 1-3)-$(ver_cut 1-3)-$(ver_cut 4)_all.deb +" +S="${WORKDIR}" + +LICENSE="ISSL" +SLOT="0" +KEYWORDS="~amd64" +IUSE="static-libs" +RESTRICT="strip" + +# MKL uses Intel/LLVM OpenMP by default. +# One can change the threadding layer to "gnu" or "tbb" +# through the MKL_THREADING_LAYER env var. +RDEPEND=" + app-eselect/eselect-blas + app-eselect/eselect-lapack + sys-cluster/mpich + sys-libs/libomp +" +# bug #801460 +BDEPEND="app-arch/xz-utils[extra-filters]" + +QA_PREBUILT="*" +QA_TEXTRELS="*" +QA_SONAME="*" + +src_prepare() { + default + # Drop conda stuff + rm -r opt/intel/oneapi/conda_channel || die +} + +src_install() { + # Symlink pkgconfig and cmake files + pushd "opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/pkgconfig" || die + for file in *.pc; do + dosym "../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/pkgconfig/${file}" "/usr/share/pkgconfig/${file}" + done + popd || die + pushd "opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/cmake/mkl" || die + for file in *.cmake; do + dosym "../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/cmake/mkl/${file}" "/usr/$(get_libdir)/cmake/mkl/${file}" + done + popd || die + + # Symlink files in locale directory + pushd "opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/locale/en_US" || die + for file in *; do + dosym "../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/locale/en_US/${file}" "/usr/share/locale/en_US/${file}" + done + popd || die + + # Move everything over to the image directory + mv "${S}/"* "${ED}" || die + + # Create convenience symlink that does not include the version number + dosym "$(ver_cut 1-3)" /opt/intel/oneapi/mkl/latest + + dodir /usr/$(get_libdir)/blas/mkl + dosym ../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/libmkl_rt.so usr/$(get_libdir)/blas/mkl/libblas.so + dosym ../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/libmkl_rt.so usr/$(get_libdir)/blas/mkl/libblas.so.3 + dosym ../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/libmkl_rt.so usr/$(get_libdir)/blas/mkl/libcblas.so + dosym ../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/libmkl_rt.so usr/$(get_libdir)/blas/mkl/libcblas.so.3 + dodir /usr/$(get_libdir)/lapack/mkl + dosym ../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/libmkl_rt.so usr/$(get_libdir)/lapack/mkl/liblapack.so + dosym ../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/libmkl_rt.so usr/$(get_libdir)/lapack/mkl/liblapack.so.3 + dosym ../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/libmkl_rt.so usr/$(get_libdir)/lapack/mkl/liblapacke.so + dosym ../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/libmkl_rt.so usr/$(get_libdir)/lapack/mkl/liblapacke.so.3 + + newenvd - "70intel-mkl" <<-_EOF_ + MKLROOT="${EPREFIX}/opt/intel/oneapi/mkl/$(ver_cut 1-3)" + PATH="${EPREFIX}/opt/intel/oneapi/mkl/$(ver_cut 1-3)/bin/intel64" + # we need to duplicate it in ROOTPATH for Portage to respect... + ROOTPATH="${EPREFIX}/opt/intel/oneapi/mkl/$(ver_cut 1-3)/bin/intel64" + LDPATH="${EPREFIX}/opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64" + _EOF_ +} + +pkg_postinst() { + local libdir=$(get_libdir) me="mkl" + + # check blas + eselect blas add ${libdir} "${EROOT}"/usr/${libdir}/blas/${me} ${me} + local current_blas=$(eselect blas show ${libdir} | cut -d' ' -f2) + if [[ ${current_blas} == "${me}" || -z ${current_blas} ]]; then + eselect blas set ${libdir} ${me} + elog "Current eselect: BLAS/CBLAS ($libdir) -> [${current_blas}]." + else + elog "Current eselect: BLAS/CBLAS ($libdir) -> [${current_blas}]." + elog "To use blas [${me}] implementation, you have to issue (as root):" + elog "\t eselect blas set ${libdir} ${me}" + fi + + # check lapack + eselect lapack add ${libdir} "${EROOT}"/usr/${libdir}/lapack/${me} ${me} + local current_lapack=$(eselect lapack show ${libdir} | cut -d' ' -f2) + if [[ ${current_lapack} == "${me}" || -z ${current_lapack} ]]; then + eselect lapack set ${libdir} ${me} + elog "Current eselect: LAPACK ($libdir) -> [${current_blas}]." + else + elog "Current eselect: LAPACK ($libdir) -> [${current_blas}]." + elog "To use lapack [${me}] implementation, you have to issue (as root):" + elog "\t eselect lapack set ${libdir} ${me}" + fi +} + +pkg_postrm() { + eselect blas validate + eselect lapack validate +} diff --git a/sci-libs/mkl/mkl-2022.2.1.16993.ebuild b/sci-libs/mkl/mkl-2022.2.1.16993.ebuild deleted file mode 100644 index 5f88f1e40685..000000000000 --- a/sci-libs/mkl/mkl-2022.2.1.16993.ebuild +++ /dev/null @@ -1,147 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit unpacker - -DESCRIPTION="Intel Math Kernel Library" -HOMEPAGE="https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl.html" -SRC_URI=" - https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-${PN}-$(ver_cut 1-3)-$(ver_cut 1-3)-$(ver_cut 4)_amd64.deb - https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-${PN}-devel-$(ver_cut 1-3)-$(ver_cut 1-3)-$(ver_cut 4)_amd64.deb - https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-${PN}-common-$(ver_cut 1-3)-$(ver_cut 1-3)-$(ver_cut 4)_all.deb - https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-${PN}-common-devel-$(ver_cut 1-3)-$(ver_cut 1-3)-$(ver_cut 4)_all.deb -" -S="${WORKDIR}" - -LICENSE="ISSL" -SLOT="0" -KEYWORDS="~amd64" -IUSE="static-libs" -RESTRICT="strip" - -# MKL uses Intel/LLVM OpenMP by default. -# One can change the threadding layer to "gnu" or "tbb" -# through the MKL_THREADING_LAYER env var. -RDEPEND=" - app-eselect/eselect-blas - app-eselect/eselect-lapack - sys-libs/libomp -" -# bug #801460 -BDEPEND="app-arch/xz-utils[extra-filters]" - -QA_PREBUILT="*" -QA_TEXTRELS="*" -QA_SONAME="*" - -src_prepare() { - default - # Drop conda stuff - rm -r opt/intel/oneapi/conda_channel || die -} - -src_install() { - # Symlink pkgconfig and cmake files - pushd "opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/pkgconfig" || die - for file in *.pc; do - dosym "../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/pkgconfig/${file}" "/usr/share/pkgconfig/${file}" - done - popd || die - pushd "opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/cmake/mkl" || die - for file in *.cmake; do - dosym "../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/cmake/mkl/${file}" "/usr/$(get_libdir)/cmake/mkl/${file}" - done - popd || die - - # Symlink files in include directory - pushd "opt/intel/oneapi/mkl/$(ver_cut 1-3)/include" || die - for file in *.h; do - dosym "../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/include/${file}" "/usr/include/${file}" - done - for file in *.f90; do - dosym "../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/include/${file}" "/usr/include/${file}" - done - for file in *.fi; do - dosym "../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/include/${file}" "/usr/include/${file}" - done - popd || die - pushd "opt/intel/oneapi/mkl/$(ver_cut 1-3)/include/fftw" || die - for file in *; do - dosym "../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/include/fftw/${file}" "/usr/include/fftw/${file}" - done - popd || die - pushd "opt/intel/oneapi/mkl/$(ver_cut 1-3)/include/intel64" || die - for file in *; do - dosym "../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/include/intel64/${file}" "/usr/include/${file}" - done - popd || die - pushd "opt/intel/oneapi/mkl/$(ver_cut 1-3)/include/oneapi" || die - for file in *; do - dosym "../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/include/oneapi/${file}" "/usr/include/oneapi/${file}" - done - popd || die - - # Symlink files in locale directory - pushd "opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/locale/en_US" || die - for file in *; do - dosym "../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/locale/en_US/${file}" "/usr/share/locale/en_US/${file}" - done - popd || die - - # Move everything over to the image directory - mv "${S}/"* "${ED}" || die - - dodir /usr/$(get_libdir)/blas/mkl - dosym ../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/libmkl_rt.so usr/$(get_libdir)/blas/mkl/libblas.so - dosym ../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/libmkl_rt.so usr/$(get_libdir)/blas/mkl/libblas.so.3 - dosym ../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/libmkl_rt.so usr/$(get_libdir)/blas/mkl/libcblas.so - dosym ../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/libmkl_rt.so usr/$(get_libdir)/blas/mkl/libcblas.so.3 - dodir /usr/$(get_libdir)/lapack/mkl - dosym ../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/libmkl_rt.so usr/$(get_libdir)/lapack/mkl/liblapack.so - dosym ../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/libmkl_rt.so usr/$(get_libdir)/lapack/mkl/liblapack.so.3 - dosym ../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/libmkl_rt.so usr/$(get_libdir)/lapack/mkl/liblapacke.so - dosym ../../../../opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64/libmkl_rt.so usr/$(get_libdir)/lapack/mkl/liblapacke.so.3 - - newenvd - "70intel-mkl" <<-_EOF_ - MKLROOT="${EPREFIX}/opt/intel/oneapi/mkl/$(ver_cut 1-3)" - PATH="${EPREFIX}/opt/intel/oneapi/mkl/$(ver_cut 1-3)/bin/intel64" - # we need to duplicate it in ROOTPATH for Portage to respect... - ROOTPATH="${EPREFIX}/opt/intel/oneapi/mkl/$(ver_cut 1-3)/bin/intel64" - LDPATH="${EPREFIX}/opt/intel/oneapi/mkl/$(ver_cut 1-3)/lib/intel64" - _EOF_ -} - -pkg_postinst() { - local libdir=$(get_libdir) me="mkl" - - # check blas - eselect blas add ${libdir} "${EROOT}"/usr/${libdir}/blas/${me} ${me} - local current_blas=$(eselect blas show ${libdir} | cut -d' ' -f2) - if [[ ${current_blas} == "${me}" || -z ${current_blas} ]]; then - eselect blas set ${libdir} ${me} - elog "Current eselect: BLAS/CBLAS ($libdir) -> [${current_blas}]." - else - elog "Current eselect: BLAS/CBLAS ($libdir) -> [${current_blas}]." - elog "To use blas [${me}] implementation, you have to issue (as root):" - elog "\t eselect blas set ${libdir} ${me}" - fi - - # check lapack - eselect lapack add ${libdir} "${EROOT}"/usr/${libdir}/lapack/${me} ${me} - local current_lapack=$(eselect lapack show ${libdir} | cut -d' ' -f2) - if [[ ${current_lapack} == "${me}" || -z ${current_lapack} ]]; then - eselect lapack set ${libdir} ${me} - elog "Current eselect: LAPACK ($libdir) -> [${current_blas}]." - else - elog "Current eselect: LAPACK ($libdir) -> [${current_blas}]." - elog "To use lapack [${me}] implementation, you have to issue (as root):" - elog "\t eselect lapack set ${libdir} ${me}" - fi -} - -pkg_postrm() { - eselect blas validate - eselect lapack validate -} -- cgit v1.2.3-65-gdbad