-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.sh
63 lines (52 loc) · 1.62 KB
/
build.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
56
57
58
59
60
61
62
63
#!/bin/env bash
# Get an updated config.sub and config.guess
cp $BUILD_PREFIX/share/gnuconfig/config.* ./3rdparty/libbacktrace
# mkdir build
# cp cmake/config.cmake build
# cd build
# cmake .. -G Ninja \
# -DCMAKE_PREFIX_PATH=$PREFIX \
# -DCMAKE_BUILD_TYPE=Release \
# -DCMAKE_INSTALL_PREFIX=$PREFIX \
# -DCMAKE_INCLUDE_PATH=$PREFIX/include \
# -DDLPACK_PATH=$PREFIX/include \
# -DDMLC_PATH=$PREFIX/include \
# -DRANG_PATH=$PREFIX/include \
# -DUSE_CUDA=OFF \
# -DUSE_VULKAN=OFF
# ninja -j${CPU_COUNT}
# ninja install
GPU_OPT=""
TOOLCHAIN_OPT=""
if [[ "$OSTYPE" == "darwin"* ]]; then
OPTS="-DUSE_METAL=ON -DUSE_BLAS=apple -DUSE_BNNS=ON"
if [[ "$target_platform" == "osx-arm64" ]]; then
OPTS="-DUSE_METAL=ON -DUSE_BLAS=apple -DUSE_BNNS=ON -DLLVM_LIBS=$PREFIX/lib/libLLVM-13.dylib"
fi
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
if [[ "$cuda_compiler_version" != "None" ]]; then
OPTS="-DUSE_CUDA=ON -DUSE_CUBLAS=ON -DUSE_CUDNN=ON -DUSE_CUTLASS=ON"
fi
fi
rm -f config.cmake
rm -rf build || true
mkdir -p build
cd build
cmake ${CMAKE_ARGS} .. -G Ninja \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INCLUDE_PATH=$PREFIX/include \
-DDLPACK_PATH=$PREFIX/include \
-DDMLC_PATH=$PREFIX/include \
-DRANG_PATH=$PREFIX/include \
-DUSE_RPC=ON \
-DUSE_CPP_RPC=OFF \
-DUSE_SORT=ON \
-DUSE_RANDOM=ON \
-DUSE_PROFILER=ON \
-DUSE_LLVM=ON \
-DINSTALL_DEV=ON \
-DUSE_LIBBACKTRACE=AUTO \
${OPTS}
ninja -j${CPU_COUNT}
ninja install