项目文件夹

文件
nv-dlasalle ae3a325d62 [bugfix] Link against pytorch library by name rather than path (attempting to fix linking issue). (#3246)
* Use library name

* fix for mac builds from source

Co-authored-by: Quan (Andy) Gan <coin2028@hotmail.com>
2021-08-20 02:45:47 +00:00

30 行
627 B
Bash

#!/bin/bash
# Helper script to build tensor adapter libraries for PyTorch
set -e
rm -rf build
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
$CMAKE_COMMAND $CMAKE_FLAGS ..
make -j
cp -v $CPSOURCE $BINDIR/tensoradapter/pytorch
else
for PYTHON_INTERP in $@; do
rm -rf *
$CMAKE_COMMAND $CMAKE_FLAGS -DPYTHON_INTERP=$PYTHON_INTERP ..
make -j
cp -v $CPSOURCE $BINDIR/tensoradapter/pytorch
done
fi