build_dgl_asv.sh 483 Bytes
Newer Older
1
2
3
4
5
6
7
#!/bin/bash

set -e

# Default building only with cpu
DEVICE=${DGL_BENCH_DEVICE:-cpu}

8
9
pip install -r /asv/torch_gpu_pip.txt

10
# build
11
12
CMAKE_VARS="-DUSE_OPENMP=ON -DBUILD_TORCH=ON -DBUILD_SPARSE=ON -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda"
if [[ $DEVICE == "gpu" ]]; then
13
    CMAKE_VARS="-DUSE_CUDA=ON -DUSE_NCCL=ON $CMAKE_VARS"
14
fi
15
16
17
18
arch=`uname -m`
if [[ $arch == *"x86"* ]]; then
  CMAKE_VARS="-DUSE_AVX=ON $CMAKE_VARS"
fi
19
20
mkdir -p build
pushd build
21
22
cmake $CMAKE_VARS ..
make -j8
23
popd