build_dgl_asv.sh 548 Bytes
Newer Older
1
2
3
4
#!/bin/bash

set -e

5
6
# . /opt/conda/etc/profile.d/conda.sh
# conda activate pytorch-ci
7
8
9
# Default building only with cpu
DEVICE=${DGL_BENCH_DEVICE:-cpu}

10
11
12
pip install -r /asv/torch_gpu_pip.txt
pip install pandas rdflib ogb

13
14
15
16
17
18
# build
if [[ $DEVICE == "cpu" ]]; then
    CMAKE_VARS=""
else
    CMAKE_VARS="-DUSE_CUDA=ON"
fi
19
20
21
22
arch=`uname -m`
if [[ $arch == *"x86"* ]]; then
  CMAKE_VARS="-DUSE_AVX=ON $CMAKE_VARS"
fi
23
24
mkdir -p build
pushd build
25
cmake -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda -DBUILD_TORCH=ON $CMAKE_VARS ..
26
27
make -j
popd
28

29
# conda deactivate