From d696558b0bbcb60f1c4cf68dc93cd22c1077ce06 Mon Sep 17 00:00:00 2001 From: "Quan (Andy) Gan" Date: Sat, 2 Jan 2021 02:59:14 +0800 Subject: [PATCH] fix building script for tensoradapter on mac (#2472) Co-authored-by: Jinjing Zhou --- docs/source/install/index.rst | 2 +- tensoradapter/pytorch/build.sh | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/source/install/index.rst b/docs/source/install/index.rst index 1c871523baf7..d3e27bed4e81 100644 --- a/docs/source/install/index.rst +++ b/docs/source/install/index.rst @@ -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 diff --git a/tensoradapter/pytorch/build.sh b/tensoradapter/pytorch/build.sh index 31be90e6bc90..14edecab51f4 100644 --- a/tensoradapter/pytorch/build.sh +++ b/tensoradapter/pytorch/build.sh @@ -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 @@ -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