intel-oneapi-mkl: install missing headers

Download the -devel package to have MKL headers available too. Static
libraries take too much space (>5GB) so package them separately.

Make sure that the directories in /opt are not symlinked to avoid errors
for packages (like tbb) that also install directories with same name in
$includedir.

Fixes:
| fatal error: 'oneapi/mkl.hpp' file not found

Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
This commit is contained in:
Naveen Saini 2023-01-25 18:22:37 +08:00 committed by Anuj Mittal
parent e99ca0c5cd
commit b3c7d3ee44

View File

@ -25,34 +25,50 @@ MKLMAINVER = "2023.0.0"
SRC_URI = " \ SRC_URI = " \
https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-runtime-mkl-${PV}_amd64.deb;subdir=${BPN};name=runtime \ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-runtime-mkl-${PV}_amd64.deb;subdir=${BPN};name=runtime \
https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-runtime-mkl-common-${PV}_all.deb;subdir=${BPN};name=common \ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-runtime-mkl-common-${PV}_all.deb;subdir=${BPN};name=common \
https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-mkl-common-devel-${MKLMAINVER}-${PV}_all.deb;subdir=${BPN};name=devel \ https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-mkl-common-devel-${MKLMAINVER}-${PV}_all.deb;subdir=${BPN};name=common-devel \
https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-mkl-devel-${MKLMAINVER}-${PV}_amd64.deb;subdir=${BPN};name=devel \
https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-mkl-common-${MKLMAINVER}-${PV}_all.deb;subdir=${BPN};name=common-vars \
" "
SRC_URI[runtime.sha256sum] = "e681b760aa3ca669f56c535cae5bf5b990fbc768301d0d4885b4a6acffd51f3b" SRC_URI[runtime.sha256sum] = "e681b760aa3ca669f56c535cae5bf5b990fbc768301d0d4885b4a6acffd51f3b"
SRC_URI[common.sha256sum] = "5983af05c8f8873d3df772392b87612c09594ca0ee7c2f667857c517b0024062" SRC_URI[common.sha256sum] = "5983af05c8f8873d3df772392b87612c09594ca0ee7c2f667857c517b0024062"
SRC_URI[devel.sha256sum] = "114861a697500e5ee5e0e5f1e920bc0c96dbacd80145877e4974c582acb26c52" SRC_URI[common-devel.sha256sum] = "114861a697500e5ee5e0e5f1e920bc0c96dbacd80145877e4974c582acb26c52"
SRC_URI[devel.sha256sum] = "ee582b8e443b6104e3cc8813f990e8081a0e44d203aa0f65edca0f3406107793"
SRC_URI[common-vars.sha256sum] = "47fc873a5c0b736016ed76b7b99fd93b6bd9c27ee052a23e1944d8095b1b0a6c"
S = "${WORKDIR}/${BPN}" S = "${WORKDIR}/${BPN}"
inherit bin_package inherit bin_package
do_install:append () { do_install:append () {
install -d ${D}${bindir}
(cd ${D}${bindir} ; ln -s ../../opt/intel/oneapi/mkl/${MKLMAINVER}/bin/intel64/* .)
install -d ${D}${libdir} install -d ${D}${libdir}
(cd ${D}${libdir} ; ln -s ../../opt/intel/oneapi/lib/intel64/*.so* .) (cd ${D}${libdir} ; ln -s ../../opt/intel/oneapi/lib/intel64/*.so* .)
(cd ${D}${libdir} ; ln -s ../../opt/intel/oneapi/mkl/${MKLMAINVER}/lib/intel64/*.a* .)
install -d ${D}${libdir}/pkgconfig install -d ${D}${libdir}/pkgconfig
(cd ${D}${libdir}/pkgconfig ; ln -s ../../../opt/intel/oneapi/mkl/${MKLMAINVER}/lib/pkgconfig/* .) (cd ${D}${libdir}/pkgconfig ; ln -s ../../../opt/intel/oneapi/mkl/${MKLMAINVER}/lib/pkgconfig/* .)
install -d ${D}${libdir}/cmake install -d ${D}${libdir}/cmake
(cd ${D}${libdir}/cmake ; ln -s ../../../opt/intel/oneapi/mkl/${MKLMAINVER}/lib/cmake/* .) (cd ${D}${libdir}/cmake ; ln -s ../../../opt/intel/oneapi/mkl/${MKLMAINVER}/lib/cmake/* .)
install -d ${D}${includedir} install -d ${D}${includedir}
(cd ${D}${includedir} ; ln -s ../../opt/intel/oneapi/mkl/${MKLMAINVER}/include/* .) find ${D}/opt/intel/oneapi/mkl/${MKLMAINVER}/include/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read srcdir; do
install -d ${D}${includedir}/$srcdir
(cd ${D}${includedir} ; ln -s ../../opt/intel/oneapi/mkl/${MKLMAINVER}/include/$srcdir/* ./$srcdir/)
done
find ${D}/opt/intel/oneapi/mkl/${MKLMAINVER}/include/ -mindepth 1 -maxdepth 1 -type f -printf '%f\n' | while read srcfile; do
(cd ${D}${includedir} ; ln -s ../../opt/intel/oneapi/mkl/${MKLMAINVER}/include/$srcfile .)
done
} }
INHIBIT_PACKAGE_STRIP = "1" INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1" INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
RDEPENDS:${PN} += "bash tbb intel-oneapi-compiler setup-intel-oneapi-env ocl-icd" RDEPENDS:${PN} += "bash tbb intel-oneapi-compiler setup-intel-oneapi-env ocl-icd"
INSANE_SKIP:${PN} = "ldflags textrel dev-so" INSANE_SKIP:${PN} = "ldflags textrel dev-so staticdev"
FILES:${PN}-staticdev += "/opt/intel/oneapi/mkl/${MKLMAINVER}/lib/intel64/*.a*"
SKIP_FILEDEPS:${PN} = '1' SKIP_FILEDEPS:${PN} = '1'