Unverified Commit 5f1babf0 authored by Quan (Andy) Gan's avatar Quan (Andy) Gan Committed by GitHub
Browse files

fix build for multiple pytorch versions (#5289)

parent 40c968b7
...@@ -23,8 +23,12 @@ if [ $# -eq 0 ]; then ...@@ -23,8 +23,12 @@ if [ $# -eq 0 ]; then
cp -v $CPSOURCE $BINDIR/dgl_sparse cp -v $CPSOURCE $BINDIR/dgl_sparse
else else
for PYTHON_INTERP in $@; do for PYTHON_INTERP in $@; do
$CMAKE_COMMAND $CMAKE_FLAGS -DPYTHON_INTERP=$PYTHON_INTERP .. TORCH_VER=$($PYTHON_INTERP -c 'import torch; print(torch.__version__.split("+")[0])')
mkdir -p $TORCH_VER
cd $TORCH_VER
$CMAKE_COMMAND $CMAKE_FLAGS -DPYTHON_INTERP=$PYTHON_INTERP ../..
make -j make -j
cp -v $CPSOURCE $BINDIR/dgl_sparse cp -v $CPSOURCE $BINDIR/dgl_sparse
cd ..
done done
fi fi
...@@ -20,8 +20,12 @@ if [ $# -eq 0 ]; then ...@@ -20,8 +20,12 @@ if [ $# -eq 0 ]; then
cp -v $CPSOURCE $BINDIR/tensoradapter/pytorch cp -v $CPSOURCE $BINDIR/tensoradapter/pytorch
else else
for PYTHON_INTERP in $@; do for PYTHON_INTERP in $@; do
$CMAKE_COMMAND $CMAKE_FLAGS -DPYTHON_INTERP=$PYTHON_INTERP .. TORCH_VER=$($PYTHON_INTERP -c 'import torch; print(torch.__version__.split("+")[0])')
mkdir -p $TORCH_VER
cd $TORCH_VER
$CMAKE_COMMAND $CMAKE_FLAGS -DPYTHON_INTERP=$PYTHON_INTERP ../..
make -j make -j
cp -v $CPSOURCE $BINDIR/tensoradapter/pytorch cp -v $CPSOURCE $BINDIR/tensoradapter/pytorch
cd ..
done done
fi fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment