aboutsummaryrefslogtreecommitdiff
blob: 9007f7a51ce9c10d74ec03982f2a83421be8c388 (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
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{10..11} )
inherit python-any-r1 java-pkg-2

MKLFPK_VER="20221214"
MKLGPUFPK_VER="20221214"

DESCRIPTION="oneAPI Data Analytics Library"
HOMEPAGE="https://github.com/oneapi-src/oneDAL"
# Secondary urls extracted from dev/download_micromkl.sh
SRC_URI="
	https://github.com/oneapi-src/oneDAL/archive/${PV}.tar.gz -> ${P}.tar.gz
	https://github.com/oneapi-src/oneDAL/releases/download/Dependencies/mklgpufpk_lnx_${MKLGPUFPK_VER}.tgz
	https://github.com/oneapi-src/oneDAL/releases/download/Dependencies/mklfpk_lnx_${MKLFPK_VER}.tgz
"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"

BDEPEND="sys-devel/DPC++"

RDEPEND="
	dev-cpp/tbb:=
	dev-libs/opencl-icd-loader
	virtual/jdk:17
"
DEPEND="
	${DEPEND}
	${PYTHON_DEPS}
"

PATCHES=(
	"${FILESDIR}/${PN}-2023.2.1-fix-compile.patch"
)

pkg_setup() {
	python-any-r1_pkg_setup
	java-pkg-2_pkg_setup
}

src_unpack() {
	unpack "${P}.tar.gz"
	mkdir -p "${S}/__deps/mklfpk/" "${S}/__deps/mklgpufpk/lnx" || die
	cd "${S}/__deps/mklfpk/" || die
	unpack "mklfpk_lnx_${MKLFPK_VER}.tgz"
	cd "${S}/__deps/mklgpufpk/lnx" || die
	unpack "mklgpufpk_lnx_${MKLGPUFPK_VER}.tgz"
}

src_prepare() {
	# DPC++ compiler required for full functionality
	export CC="${ESYSROOT}/usr/lib/llvm/intel/bin/clang"
	export CXX="${ESYSROOT}/usr/lib/llvm/intel/bin/clang++"
	export TBBROOT="${ESYSROOT}/usr"
	export CPLUS_INCLUDE_PATH="./cpp/daal/include:${ESYSROOT}/usr/lib/llvm/intel/include"
	export JAVA_HOME="${ESYSROOT}/usr/lib64/openjdk-17/"
	export PATH="${JAVA_HOME}/bin:${PATH}"
	export CPATH="${JAVA_HOME}/include:${JAVA_HOME}/include/linux:${CPATH}"

	default
}

src_compile() {
	emake PLAT=lnx32e COMPILER=icx daal oneapi
}

src_install() {
	einstalldocs
	cd __release_lnx_icx/daal/latest || die
	docinto examples
	dodoc -r examples/*
	docinto samples
	dodoc -r samples/*
	doheader -r include/*
	dolib.so lib/intel64/*.so*
	dolib.a lib/intel64/*.a*
	insinto /usr/share/pkgconfig
	doins -r lib/pkgconfig/*
	java-pkg_dojar lib/*.jar
}