diff options
author | Peter Goldsborough <peter@goldsborough.me> | 2018-05-04 08:04:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-04 08:04:57 -0700 |
commit | 67d0d14908bbfa786baddeab4282fccf931041dc (patch) | |
tree | b0385b3a7cb5d6a78f9705c477cd04cbf999fad5 /tools | |
parent | bcffb5aa1df30190d10eb6b2d05ff1f9fb27d8a0 (diff) | |
download | pytorch-67d0d14908bbfa786baddeab4282fccf931041dc.tar.gz pytorch-67d0d14908bbfa786baddeab4282fccf931041dc.tar.bz2 pytorch-67d0d14908bbfa786baddeab4282fccf931041dc.zip |
Rename autograd namespace to torch and change torch.h into python.h (#7267)
* Rename autograd namespace to torch and change torch.h into python.h
* Include torch.h instead of python.h in test/cpp/api
* Change some mentions of torch.h to python.h in C++ extensions
* Set paths directly, without find_path
Diffstat (limited to 'tools')
-rw-r--r-- | tools/cpp_build/libtorch/CMakeLists.txt | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/cpp_build/libtorch/CMakeLists.txt b/tools/cpp_build/libtorch/CMakeLists.txt index a1c2aade5c..61e4d9e3c3 100644 --- a/tools/cpp_build/libtorch/CMakeLists.txt +++ b/tools/cpp_build/libtorch/CMakeLists.txt @@ -10,14 +10,13 @@ if (VERBOSE) message(STATUS "ATEN_BUILD_PATH is ${ATEN_BUILD_PATH}") endif() -find_path(ATEN_INCLUDE_DIR ATen/ATen.h PATHS "${ATEN_PATH}/src/" NO_DEFAULT_PATH) -find_path(ATEN_BUILD_INCLUDE_DIR ATen/Type.h PATHS "${ATEN_BUILD_PATH}/src/ATen" NO_DEFAULT_PATH) -find_library(ATEN_LIBRARY ATen PATHS "${ATEN_BUILD_PATH}/src/ATen" NO_DEFAULT_PATH) +set(ATEN_INCLUDE_DIR "${ATEN_PATH}/src/") +set(ATEN_BUILD_INCLUDE_DIR "${ATEN_BUILD_PATH}/src/ATen") +set(TORCH_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../torch") +find_library(ATEN_LIBRARY ATen PATHS "${ATEN_BUILD_PATH}/src/ATen" NO_DEFAULT_PATH) find_library(NANOPB_LIBRARY protobuf-nanopb PATHS "${NANOPB_BUILD_PATH}" NO_DEFAULT_PATH) -find_path(TORCH_SRC_DIR torch.h PATHS "${CMAKE_CURRENT_SOURCE_DIR}/../../../torch" NO_DEFAULT_PATH) - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) @@ -256,7 +255,7 @@ target_include_directories(torch "${ATEN_INCLUDE_DIR}/TH" "${ATEN_BUILD_INCLUDE_DIR}" "${ATEN_BUILD_PATH}/src/TH" - "${TORCH_SRC_DIR}/../" + "${TORCH_SRC_DIR}/.." "${CMAKE_CURRENT_SOURCE_DIR}") if (NOT NO_API) |