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

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

if [ "$1" == "gpu" ]; then
    cp cmake/config.cmake config.cmake
    sed -i -e 's/USE_CUDA OFF/USE_CUDA ON/g' config.cmake
fi

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

rm -rf _download

pushd build
VoVAllen's avatar
VoVAllen committed
22
cmake .. -DBUILD_CPP_TEST=1
23
24
25
26
27
28
make -j4
popd

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