mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Detect system RocksDB installation with CMake config files. (#7315)
Summary: On Windows, the FindRocksDB script doesn't detect rocksdb installation built by cmake. And it doesn't include/link the RocksDB dependencies either, like: * `Snappy` * `Shlwapi.lib` * `Rpcrt4.lib` This PR try to detect in config mode first before using private find module. Pull Request resolved: https://github.com/pytorch/pytorch/pull/7315 Differential Revision: D9287587 Pulled By: Yangqing fbshipit-source-id: 314a36a14bfe04aa45013349c5537163fb4c5c00
This commit is contained in:
committed by
Facebook Github Bot
parent
82d11b847e
commit
3cbe8f0c3e
@ -37,12 +37,18 @@ endif()
|
||||
# cmake. Note that for modules that are located in the Caffe2 repository,
|
||||
# cmake related files, such as FindRocksDB in this case, should live in the
|
||||
# cmake/ folder under root.
|
||||
find_package(RocksDB)
|
||||
if(NOT ROCKSDB_FOUND)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"RocksDB not found. If you do not need caffe2_rocksdb, set "
|
||||
"-DUSE_ROCKSDB=OFF to solve this error.")
|
||||
find_package(RocksDB CONFIG)
|
||||
if((DEFINED RocksDB_DIR) AND RocksDB_DIR)
|
||||
list(APPEND RocksDB_LIBRARIES RocksDB::rocksdb)
|
||||
else()
|
||||
message("RocksDB config not found. Fallback to legacy find.")
|
||||
find_package(RocksDB)
|
||||
if(NOT ROCKSDB_FOUND)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"RocksDB not found. If you do not need caffe2_rocksdb, set "
|
||||
"-DUSE_ROCKSDB=OFF to solve this error.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# ---[ Third, create the CMake target.
|
||||
|
Reference in New Issue
Block a user