mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
* Have PyTorch depend on minimal libcaffe2.so instead of libATen.so * Build ATen tests as a part of Caffe2 build * Hopefully cufft and nvcc fPIC fixes * Make ATen install components optional * Add tests back for ATen and fix TH build * Fixes for test_install.sh script * Fixes for cpp_build/build_all.sh * Fixes for aten/tools/run_tests.sh * Switch ATen cmake calls to USE_CUDA instead of NO_CUDA * Attempt at fix for aten/tools/run_tests.sh * Fix typo in last commit * Fix valgrind call after pushd * Be forgiving about USE_CUDA disable like PyTorch * More fixes on the install side * Link all libcaffe2 during test run * Make cuDNN optional for ATen right now * Potential fix for non-CUDA builds * Use NCCL_ROOT_DIR environment variable * Pass -fPIC through nvcc to base compiler/linker * Remove THCUNN.h requirement for libtorch gen * Add Mac test for -Wmaybe-uninitialized * Potential Windows and Mac fixes * Move MSVC target props to shared function * Disable cpp_build/libtorch tests on Mac * Disable sleef for Windows builds * Move protos under BUILD_CAFFE2 * Remove space from linker flags passed with -Wl * Remove ATen from Caffe2 dep libs since directly included * Potential Windows fixes * Preserve options while sleef builds * Force BUILD_SHARED_LIBS flag for Caffe2 builds * Set DYLD_LIBRARY_PATH and LD_LIBRARY_PATH for Mac testing * Pass TORCH_CUDA_ARCH_LIST directly in cuda.cmake * Fixes for the last two changes * Potential fix for Mac build failure * Switch Caffe2 to build_caffe2 dir to not conflict * Cleanup FindMKL.cmake * Another attempt at Mac cpp_build fix * Clear cpp-build directory for Mac builds * Disable test in Mac build/test to match cmake
51 lines
2.2 KiB
CMake
51 lines
2.2 KiB
CMake
# ---[ Declare variables that we are going to use across the Caffe2 build.
|
|
# This file defines common, Caffe2-wide variables that we use to collect
|
|
# source files and other things. Each variable is annotated with their
|
|
# intended uses.
|
|
# Note that adding and / or deleting these variables usually involves
|
|
# changing the whole build system, so make sure you send a PR early if you
|
|
# want to change them.
|
|
|
|
# Caffe2_{CPU,GPU}_SRCS is the list that will have all the related source
|
|
# files for CPU and GPU respectively. They will be filled with the
|
|
# CMakeLists.txt files under each folder respectively.
|
|
set(Caffe2_CPU_SRCS)
|
|
set(Caffe2_GPU_SRCS)
|
|
|
|
# Caffe2_{CPU,GPU}_TEST_SRCS is the list that will have all the related source
|
|
# files for CPU and GPU tests respectively.
|
|
set(Caffe2_CPU_TEST_SRCS)
|
|
set(Caffe2_GPU_TEST_SRCS)
|
|
|
|
# Caffe2_{CPU,GPU}_INCLUDE is the list that will have all the include
|
|
# directories for CPU and GPU respectively.
|
|
set(Caffe2_CPU_INCLUDE)
|
|
set(Caffe2_GPU_INCLUDE)
|
|
|
|
# Caffe2_MAIN_LIBS is a list of the libraries that a dependent library should
|
|
# depend on when it links against Caffe2.
|
|
set(Caffe2_MAIN_LIBS)
|
|
|
|
# Lists for Caffe2 dependency libraries, for CPU and CUDA respectively.
|
|
set(Caffe2_DEPENDENCY_LIBS "")
|
|
set(Caffe2_CUDA_DEPENDENCY_LIBS "")
|
|
# This variable contains dependency libraries of Caffe2 which requires whole
|
|
# symbol linkage. One example is the onnx lib where we need all its schema
|
|
# symbols. However, if the lib is whole linked in caffe2 lib, we don't want
|
|
# it to be linked in binaries that will link caffe2 lib. Because if caffe2 lib
|
|
# is built as dynamic library, it will result in two copied of symbols of
|
|
# Caffe2_DEPENDENCY_WHOLE_LINK_LIBS existing in caffe2.so and the binary, which
|
|
# will cause issues. Therefore Caffe2_DEPENDENCY_WHOLE_LINK_LIBS will only
|
|
# be linked by caffe2 lib.
|
|
set(Caffe2_DEPENDENCY_WHOLE_LINK_LIBS "")
|
|
|
|
# Lists for Caffe2 public dependency libraries. These libraries will be
|
|
# transitive to any libraries that depends on Caffe2.
|
|
set(Caffe2_PUBLIC_DEPENDENCY_LIBS "")
|
|
set(Caffe2_PUBLIC_CUDA_DEPENDENCY_LIBS "")
|
|
|
|
# List of modules that is built as part of the main Caffe2 build. For all
|
|
# binary targets, such as Python and native binaries, they will be linked
|
|
# automatically with these modules.
|
|
set(Caffe2_MODULES "")
|