-
Notifications
You must be signed in to change notification settings - Fork 2
/
PKGBUILD
100 lines (80 loc) · 2.55 KB
/
PKGBUILD
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Maintainer: Dmitry Popov <ixaphire@gmail.com>
_name=xgboost
pkgbase=xgboost
pkgname=('xgboost'
'python-xgboost')
pkgver=1.2.1.r0.gbcb15a980
pkgrel=1
url='https://github.com/dmlc/xgboost'
license=('APACHE')
#source=('git+https://github.com/dmlc/xgboost.git'
source=('git+https://github.com/dmlc/xgboost.git#tag=v1.2.1'
'python_no_libs.patch')
depends=('cuda' 'openmp')
makedepends=('python-setuptools')
arch=('x86_64')
sha256sums=('SKIP'
'4940b84afffe9c2be646d0f77bcfb0d8d36aadcabc4a83b40113e1d97ae917b5')
pkgver() {
cd xgboost
local _version
local _revision
local _shorthash
_version="$(git tag | sort -Vr | head -n1 | sed 's/^v//')"
_revision="$(git rev-list v"${_version}"..HEAD --count)"
_shorthash="$(git rev-parse --short HEAD)"
printf '%s.r%s.g%s' "$_version" "$_revision" "$_shorthash"
}
prepare() {
cd "${_name}"
git submodule sync --recursive && git submodule update --init --recursive
patch -p1 < "${srcdir}/python_no_libs.patch"
}
build() {
cd "${_name}"
mkdir build
cd build
export CMAKE_CXX_COMPILER=/usr/bin/g++
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_CXX_FLAGS="-march=skylake -O3" \
-DCMAKE_CXX11_ABI=ON \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_CUDA_HOST_COMPILER=/usr/bin/g++ \
-DUSE_CUDA=ON \
-DUSE_OPENMP=OFF \
-DGPU_COMPUTE_VER=75
make -j6
}
package_xgboost() {
pkgdesc='An optimized distributed gradient boosting library designed to be highly efficient, flexible and portable'
optdepends=('python-xgboost: Python 3 Wrapper')
cd "${_name}"
# Install License
install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
# Install Documentation
install -D -m644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
# Install main executable
install -Dm755 "xgboost" "${pkgdir}/usr/bin/xgboost"
# Install shared libraries
mkdir -p "${pkgdir}/usr/lib"
install -Dm644 lib/*.so "${pkgdir}/usr/lib"
# Install includes
mkdir -p "${pkgdir}/usr/include"
cp -r include/xgboost "${pkgdir}/usr/include"
cp -r dmlc-core/include/dmlc "${pkgdir}/usr/include"
cp -r rabit/include/rabit "${pkgdir}/usr/include"
# Copy the demos to opt/xgboost
mkdir -p "${pkgdir}"/opt/xgboost
cp -r demo "${pkgdir}"/opt/xgboost
}
package_python-xgboost() {
pkgdesc='XGBoost Python 3 wrapper'
depends=('xgboost'
'python'
'python-numpy'
'python-scipy')
cd "${_name}/python-package"
python setup.py install --root="${pkgdir}" --optimize=1
}
# vim:set ts=2 sw=2 et: