build_dgl.sh 538 Bytes
Newer Older
1
#!/bin/bash
2
set -e
3

4
5
6
7
8
if [ $# -ne 1 ]; then
    echo "Device argument required, can be cpu or gpu"
    exit -1
fi

9
10
CMAKE_VARS="-DBUILD_CPP_TEST=ON -DUSE_OPENMP=ON"

11
if [ "$1" == "gpu" ]; then
12
    CMAKE_VARS="-DUSE_CUDA=ON $CMAKE_VARS"
13
14
fi

15
if [ -d build ]; then
16
    rm -rf build
17
18
19
20
21
22
fi
mkdir build

rm -rf _download

pushd build
23
cmake $CMAKE_VARS ..
24
25
26
27
28
29
make -j4
popd

pushd python
rm -rf build *.egg-info dist
pip3 uninstall -y dgl
Minjie Wang's avatar
Minjie Wang committed
30
# test install
31
python3 setup.py install
Minjie Wang's avatar
Minjie Wang committed
32
33
# test inplace build (for cython)
python3 setup.py build_ext --inplace
34
popd