mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
In default, use third party eigen. Added new flag USE_SYSTEM_EIGEN_INSTALL to control. (#11020)
Summary: TSIA. apaszke pointed out that it might be better to use third party folder in default, since system Eigen may often be out of date and does not have the version we need to compile successfully. Pull Request resolved: https://github.com/pytorch/pytorch/pull/11020 Differential Revision: D9562548 Pulled By: Yangqing fbshipit-source-id: d8ab8a6ebe1f3d9eec638ef726cf5dc4dcf777b5
This commit is contained in:
committed by
Facebook Github Bot
parent
539579aa9a
commit
684b55d762
@ -108,6 +108,8 @@ option(USE_PROF "Use profiling" OFF)
|
||||
option(USE_REDIS "Use Redis" OFF)
|
||||
option(USE_ROCKSDB "Use RocksDB" OFF)
|
||||
option(USE_SNPE "Use Qualcomm's SNPE library" OFF)
|
||||
option(USE_SYSTEM_EIGEN_INSTALL
|
||||
"Use system Eigen instead of the one under third_party" OFF)
|
||||
option(USE_TENSORRT "Using Nvidia TensorRT library" OFF)
|
||||
option(USE_ZMQ "Use ZMQ" OFF)
|
||||
option(USE_ZSTD "Use ZSTD" OFF)
|
||||
|
@ -323,11 +323,17 @@ endif()
|
||||
# ---[ EIGEN
|
||||
# Due to license considerations, we will only use the MPL2 parts of Eigen.
|
||||
set(EIGEN_MPL2_ONLY 1)
|
||||
find_package(Eigen3)
|
||||
if(EIGEN3_FOUND)
|
||||
message(STATUS "Found system Eigen at " ${EIGEN3_INCLUDE_DIR})
|
||||
if (USE_SYSTEM_EIGEN_INSTALL)
|
||||
find_package(Eigen3)
|
||||
if(EIGEN3_FOUND)
|
||||
message(STATUS "Found system Eigen at " ${EIGEN3_INCLUDE_DIR})
|
||||
else()
|
||||
message(STATUS "Did not find system Eigen. Using third party subdirectory.")
|
||||
set(EIGEN3_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/../third_party/eigen)
|
||||
caffe2_update_option(USE_SYSTEM_EIGEN_INSTALL OFF)
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Did not find system Eigen. Using third party subdirectory.")
|
||||
message(STATUS "Using third party subdirectory Eigen.")
|
||||
set(EIGEN3_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/../third_party/eigen)
|
||||
endif()
|
||||
include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR})
|
||||
|
Reference in New Issue
Block a user