Skip to content

Commit 65f8465

Browse files
authored
Add back cpp_build tests for Mac (#7810)
1 parent a0480ad commit 65f8465

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

.jenkins/pytorch/macos-build-test.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@ rm -rf $CPP_BUILD
3535
mkdir -p $CPP_BUILD
3636
WERROR=1 VERBOSE=1 tools/cpp_build/build_all.sh "$CPP_BUILD"
3737

38-
# TODO; Enable tests on Mac as soon as possible
39-
#python tools/download_mnist.py --quiet -d test/cpp/api/mnist
40-
#
41-
# # Unfortunately it seems like the test can't load from miniconda3
42-
# # without these paths being set
43-
# export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$PWD/miniconda3/lib"
44-
# export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PWD/miniconda3/lib"
45-
# "$CPP_BUILD"/libtorch/bin/test_api
38+
python tools/download_mnist.py --quiet -d test/cpp/api/mnist
39+
40+
# Unfortunately it seems like the test can't load from miniconda3
41+
# without these paths being set
42+
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$PWD/miniconda3/lib"
43+
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PWD/miniconda3/lib"
44+
"$CPP_BUILD"/libtorch/bin/test_api

tools/cpp_build/libtorch/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ else()
66
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
77
include(CMakeDependentOption)
88
option(USE_CUDA "Use CUDA" ON)
9+
option(TORCH_BUILD_TEST "Build torch test binaries" ON)
910

1011
# Legacy options, which we will eventually remove
1112
cmake_dependent_option(
@@ -19,13 +20,6 @@ if (NOT USE_CUDA)
1920
set(NO_CUDA ON)
2021
endif()
2122

22-
# TODO: Enable tests on Mac as soon as possible
23-
if (APPLE)
24-
set(TORCH_BUILD_TEST OFF)
25-
else()
26-
set(TORCH_BUILD_TEST ON)
27-
endif()
28-
2923
cmake_policy(VERSION 3.0)
3024

3125
set(CMAKE_CXX_STANDARD 11)

0 commit comments

Comments
 (0)