build_dgl.sh 652 Bytes
Newer Older
1
#!/bin/bash
2
set -e
VoVAllen's avatar
VoVAllen committed
3
. /opt/conda/etc/profile.d/conda.sh
4

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

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

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

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

rm -rf _download

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

pushd python
VoVAllen's avatar
VoVAllen committed
29
30
31
for backend in pytorch mxnet tensorflow
do 
conda activate "${backend}-ci"
32
rm -rf build *.egg-info dist
VoVAllen's avatar
VoVAllen committed
33
pip uninstall -y dgl
Minjie Wang's avatar
Minjie Wang committed
34
# test install
35
python3 setup.py install
Minjie Wang's avatar
Minjie Wang committed
36
37
# test inplace build (for cython)
python3 setup.py build_ext --inplace
VoVAllen's avatar
VoVAllen committed
38
39
done
popd