Skip to content

Commit

Permalink
Build artifacts inside docker
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzijian629 committed Jul 10, 2023
1 parent 35ecf8e commit 04a70f1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
25 changes: 16 additions & 9 deletions .pfnci/run_gpu_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,22 @@ apt-get update && apt-get install -y \
pip3 install pytest numpy cmake-format
./run-format.sh
./download-libtorch.sh
LIBTORCH_DIR=$(pwd)/pytorch-install/libtorch
mkdir build && cd build && \
cmake .. \
-GNinja \
-DSOLD_PYBIND_TEST=ON \
-DSOLD_LIBTORCH_TEST=ON \
-DCMAKE_PREFIX_PATH=${LIBTORCH_DIR}/share/cmake/Torch/
SOLD_DIR=$(pwd)
BUILD_DIR=/tmp/build
mkdir $BUILD_DIR
cd $BUILD_DIR
$SOLD_DIR/download-libtorch.sh
LIBTORCH_DIR=$BUILD_DIR/pytorch-install/libtorch
cmake $SOLD_DIR \
-GNinja \
-DSOLD_PYBIND_TEST=ON \
-DSOLD_LIBTORCH_TEST=ON \
-DCMAKE_PREFIX_PATH=${LIBTORCH_DIR}/share/cmake/Torch/
ninja
ctest --output-on-failure
Expand Down
2 changes: 1 addition & 1 deletion download-libtorch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ LIBTORCH_ZIP_SUFFIX="%2B${LIBTORCH_ARCH}"

URL="https://download.pytorch.org/libtorch${LIBTORCH_RELEASE_TYPE}/${LIBTORCH_ARCH}/libtorch${LIBTORCH_ABI}${LIBTORCH_OSNAME}${LIBTORCH_LIBOPT}-${LIBTORCH_VERSION}${LIBTORCH_ZIP_SUFFIX}.zip"

wget -O libtorch.zip "${URL}"
wget -q -O libtorch.zip "${URL}"
unzip libtorch.zip -d pytorch-install

0 comments on commit 04a70f1

Please sign in to comment.