summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJesse Hellemn <hellemn@fb.com>2018-07-09 18:04:25 -0700
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2018-07-09 18:10:58 -0700
commit99ab08236696be94d8213e22cab7398dba5044d6 (patch)
treea0d4a6ff61e447a455b3b73e505c10670d44792c /CMakeLists.txt
parent342dbcc35a5118b0fa8cccbbd2c45542d234871a (diff)
downloadpytorch-99ab08236696be94d8213e22cab7398dba5044d6.tar.gz
pytorch-99ab08236696be94d8213e22cab7398dba5044d6.tar.bz2
pytorch-99ab08236696be94d8213e22cab7398dba5044d6.zip
Making setup.py install work for Caffe2 (#8509)
Summary: Tested on my mac on a pretty clean anaconda3 Pull Request resolved: https://github.com/pytorch/pytorch/pull/8509 Reviewed By: orionr Differential Revision: D8702257 Pulled By: pjh5 fbshipit-source-id: eda03ef9732da9fc56b31d909af5c0e39520d689
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt20
1 files changed, 13 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aa943e4378..b87cb3686e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,20 +30,23 @@ if(NOT DEFINED BLAS_SET_BY_USER)
set(BLAS_SET_BY_USER ${BLAS_SET_BY_USER} CACHE STRING "Marks whether BLAS was manually set by user or auto-detected")
endif()
-# These lines are an attempt to make find_package(cuda) pick up
-# libcuda.dylib, and not cuda.framework. It doesn't work all
-# the time, but it seems to help for some users.
-# TODO: replace this with a more robust fix
+# Apple specific
if(APPLE)
+ # These lines are an attempt to make find_package(cuda) pick up
+ # libcuda.dylib, and not cuda.framework. It doesn't work all
+ # the time, but it seems to help for some users.
+ # TODO: replace this with a more robust fix
set(CMAKE_FIND_FRAMEWORK LAST)
set(CMAKE_FIND_APPBUNDLE LAST)
-endif()
-# Get clang version on macOS
-if(APPLE)
+ # Get clang version on macOS
EXECUTE_PROCESS( COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE clang_full_version_string )
string(REGEX REPLACE "Apple LLVM version ([0-9]+\\.[0-9]+).*" "\\1" CLANG_VERSION_STRING ${clang_full_version_string})
MESSAGE( STATUS "CLANG_VERSION_STRING: " ${CLANG_VERSION_STRING} )
+
+
+ # RPATH stuff
+ set(CMAKE_MACOSX_RPATH ON)
endif()
# ---[ Options.
@@ -138,6 +141,9 @@ cmake_dependent_option(
option(USE_DISTRIBUTED "Use THD (distributed)" OFF)
option(USE_DISTRIBUTED_MW "Use THD (distributed) master worker" OFF)
+# Used when building Caffe2 through setup.py
+option(BUILDING_WITH_TORCH_LIBS "Tell cmake if Caffe2 is being built alongside torch libs" OFF)
+
if (USE_ATEN)
set(BUILD_ATEN ${USE_ATEN})
endif()