summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYangqing Jia <jiayq84@gmail.com>2018-06-06 20:56:31 -0700
committerGitHub <noreply@github.com>2018-06-06 20:56:31 -0700
commitb401e6b03a4f42a3cff3cfd7c68dd7718c8f7de0 (patch)
treefe90242ada9156e242a6b906bae3249fcc3fb3f7
parent8af88f3525e1908deb9ac181ebfb9f8eb49bcb46 (diff)
downloadpytorch-b401e6b03a4f42a3cff3cfd7c68dd7718c8f7de0.tar.gz
pytorch-b401e6b03a4f42a3cff3cfd7c68dd7718c8f7de0.tar.bz2
pytorch-b401e6b03a4f42a3cff3cfd7c68dd7718c8f7de0.zip
Allow optional build and installation of native test binaries (#8225)
* test finetuning * install off by default * Turn BUILD_TEST=ON for jenkins. * Turn on install_test in jenkins as well
-rwxr-xr-x.jenkins/caffe2/build.sh3
-rw-r--r--CMakeLists.txt5
-rw-r--r--caffe2/CMakeLists.txt4
3 files changed, 9 insertions, 3 deletions
diff --git a/.jenkins/caffe2/build.sh b/.jenkins/caffe2/build.sh
index f0442746f7..e0733b6e47 100755
--- a/.jenkins/caffe2/build.sh
+++ b/.jenkins/caffe2/build.sh
@@ -67,7 +67,6 @@ report_compile_cache_stats() {
fi
}
-
###############################################################################
# Explicitly set Python executable.
###############################################################################
@@ -118,6 +117,8 @@ fi
# Set cmake args
###############################################################################
CMAKE_ARGS+=("-DBUILD_BINARY=ON")
+CMAKE_ARGS+=("-DBUILD_TEST=ON")
+CMAKE_ARGS+=("-DINSTALL_TEST=ON")
CMAKE_ARGS+=("-DUSE_OBSERVERS=ON")
CMAKE_ARGS+=("-DUSE_ZSTD=ON")
CMAKE_ARGS+=("-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX}")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f1488f6e50..e80f1b04fa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,8 +57,11 @@ cmake_dependent_option(
CAFFE2_USE_MSVC_STATIC_RUNTIME "Using MSVC static runtime libraries" ON
"NOT BUILD_SHARED_LIBS" OFF)
cmake_dependent_option(
- BUILD_TEST "Build Caffe2 C++ test binaries (need gtest and gbenchmark)" ON
+ BUILD_TEST "Build Caffe2 C++ test binaries (need gtest and gbenchmark)" OFF
"BUILD_CAFFE2" OFF)
+cmake_dependent_option(
+ INSTALL_TEST "Install test binaries if BUILD_TEST is on" OFF
+ "BUILD_TEST" OFF)
option(USE_ACL "Use ARM Compute Library" OFF)
option(USE_ASAN "Use Address Sanitizer" OFF)
option(USE_ATEN "Use ATen" OFF)
diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
index b247cad7d7..b98bace57e 100644
--- a/caffe2/CMakeLists.txt
+++ b/caffe2/CMakeLists.txt
@@ -289,7 +289,9 @@ if(BUILD_CAFFE2)
target_compile_features(${test_name} PRIVATE cxx_range_for)
endif()
add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
- install(TARGETS ${test_name} DESTINATION test)
+ if (INSTALL_TEST)
+ install(TARGETS ${test_name} DESTINATION test)
+ endif()
endforeach()
if(USE_ROCM)