Skip to content

Commit 5058ef6

Browse files
committed
Add smoke test for binary package
1 parent 8e5b65f commit 5058ef6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

check_binary.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ else
230230
done
231231
fi
232232

233+
TEST_CODE_DIR="$(dirname ${BASH_SOURCE[0]})/test_example_code"
233234
build_and_run_example_cpp () {
234235
if [[ "$DESIRED_DEVTOOLSET" == *"cxx11-abi"* ]]; then
235236
GLIBCXX_USE_CXX11_ABI=1
@@ -256,7 +257,7 @@ build_and_run_example_cpp () {
256257
if [ -f "${install_root}/lib/libtorch_cuda.so" ] || [ -f "${install_root}/lib/libtorch_cuda.dylib" ]; then
257258
TORCH_CUDA_LINK_FLAGS="-ltorch_cuda"
258259
fi
259-
g++ /builder/test_example_code/$1.cpp -I${install_root}/include -I${install_root}/include/torch/csrc/api/include -D_GLIBCXX_USE_CXX11_ABI=$GLIBCXX_USE_CXX11_ABI -std=gnu++14 -L${install_root}/lib ${REF_LIB} ${ADDITIONAL_LINKER_FLAGS} -ltorch $TORCH_CPU_LINK_FLAGS $TORCH_CUDA_LINK_FLAGS $C10_LINK_FLAGS -o $1
260+
g++ ${TEST_CODE_DIR}/$1.cpp -I${install_root}/include -I${install_root}/include/torch/csrc/api/include -D_GLIBCXX_USE_CXX11_ABI=$GLIBCXX_USE_CXX11_ABI -std=gnu++14 -L${install_root}/lib ${REF_LIB} ${ADDITIONAL_LINKER_FLAGS} -ltorch $TORCH_CPU_LINK_FLAGS $TORCH_CUDA_LINK_FLAGS $C10_LINK_FLAGS -o $1
260261
./$1
261262
}
262263

@@ -287,7 +288,7 @@ build_example_cpp_with_incorrect_abi () {
287288
if [ -f "${install_root}/lib/libtorch_cuda.so" ] || [ -f "${install_root}/lib/libtorch_cuda.dylib" ]; then
288289
TORCH_CUDA_LINK_FLAGS="-ltorch_cuda"
289290
fi
290-
g++ /builder/test_example_code/$1.cpp -I${install_root}/include -I${install_root}/include/torch/csrc/api/include -D_GLIBCXX_USE_CXX11_ABI=$GLIBCXX_USE_CXX11_ABI -std=gnu++14 -L${install_root}/lib ${REF_LIB} ${ADDITIONAL_LINKER_FLAGS} -ltorch $TORCH_CPU_LINK_FLAGS $TORCH_CUDA_LINK_FLAGS $C10_LINK_FLAGS -o $1
291+
g++ ${TEST_CODE_DIR}/$1.cpp -I${install_root}/include -I${install_root}/include/torch/csrc/api/include -D_GLIBCXX_USE_CXX11_ABI=$GLIBCXX_USE_CXX11_ABI -std=gnu++14 -L${install_root}/lib ${REF_LIB} ${ADDITIONAL_LINKER_FLAGS} -ltorch $TORCH_CPU_LINK_FLAGS $TORCH_CUDA_LINK_FLAGS $C10_LINK_FLAGS -o $1
291292
ERRCODE=$?
292293
set -e
293294
if [ "$ERRCODE" -eq "0" ]; then

0 commit comments

Comments
 (0)