-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_mlpack.musl.sh
executable file
·55 lines (48 loc) · 1.39 KB
/
build_mlpack.musl.sh
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
#!/usr/bin/env bash
#
# Build mlpack's Python bindings inside the cibuildwheel musllinux environment.
# Note that this script is not currently used, because the musllinux builds seem
# to get OOM-killed.
set -e -u -o pipefail
# Enable the community repository.
apk add openblas-dev
pip install cython numpy pandas wheel setuptools
# Armadillo must be built by hand.
wget https://files.mlpack.org/armadillo-11.4.1.tar.gz
tar -xvzpf armadillo-11.4.1.tar.gz
cd armadillo-11.4.1/
cmake -DCMAKE_INSTALL_PREFIX=/usr -DOPENBLAS_PROVIDES_LAPACK=true .
make
make install
cd ../
rm -rf armadillo-11.4.1/ armadillo-11.4.1.tar.gz
# cereal must be installed by hand.
wget https://github.com/USCILab/cereal/archive/refs/tags/v1.3.2.tar.gz
tar -xvzpf v1.3.2.tar.gz
cd cereal-1.3.2/
cp -vr include/* /usr/include/
cd ../
rm -rf cereal-1.3.2 v1.3.2.tar.gz
# ensmallen must be built by hand.
wget https://www.ensmallen.org/files/ensmallen-2.19.0.tar.gz
tar -xvzpf ensmallen-2.19.0.tar.gz
cd ensmallen-2.19.0/
mkdir build/
cd build/
cmake -DBUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/usr ../
make install
cd ../../
rm -rf ensmallen-2.19.0 ensmallen-2.19.0.tar.gz
wget https://www.mlpack.org/files/stb.tar.gz
tar -xvzpf stb.tar.gz
rm -f stb.tar.gz
cd mlpack/
rm -rf build/
mkdir build/
cd build/
cmake \
-DBUILD_PYTHON_BINDINGS=ON \
-DBUILD_CLI_EXECUTABLES=OFF \
-DSTB_IMAGE_INCLUDE_DIR="$PWD/../../stb/include/" \
../
make