Skip to content

Commit

Permalink
fix building script for tensoradapter on mac (dmlc#2472)
Browse files Browse the repository at this point in the history
Co-authored-by: Jinjing Zhou <[email protected]>
  • Loading branch information
BarclayII and VoVAllen authored Jan 1, 2021
1 parent a8ce095 commit d696558
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/source/install/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ install the Python binding for DGL.
mkdir build
cd build
cmake -DUSE_OPENMP=off ..
cmake -DUSE_OPENMP=off -DCMAKE_C_FLAGS='-DXBYAK_DONT_USE_MAP_JIT' -DCMAKE_CXX_FLAGS='-DXBYAK_DONT_USE_MAP_JIT' ..
make -j4
cd ../python
python setup.py install
Expand Down
8 changes: 7 additions & 1 deletion tensoradapter/pytorch/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ mkdir -p build
mkdir -p $BINDIR/tensoradapter/pytorch
cd build

if [ $(uname) = 'Darwin' ]; then
CPSOURCE=*.dylib
else
CPSOURCE=*.so
fi

CMAKE_FLAGS="-DCUDA_TOOLKIT_ROOT_DIR=$CUDA_TOOLKIT_ROOT_DIR -DTORCH_CUDA_ARCH_LIST=$TORCH_CUDA_ARCH_LIST"

if [ $# -eq 0 ]; then
Expand All @@ -18,6 +24,6 @@ else
rm -rf *
$CMAKE_COMMAND $CMAKE_FLAGS -DPYTHON_INTERP=$PYTHON_INTERP ..
make -j
cp -v *.so $BINDIR/tensoradapter/pytorch
cp -v $CPSOURCE $BINDIR/tensoradapter/pytorch
done
fi

0 comments on commit d696558

Please sign in to comment.