summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorOrion Reblitz-Richardson <orionr@gmail.com>2018-09-10 17:11:16 -0700
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2018-09-10 17:27:50 -0700
commita17528277678b0d6dc76ffce1c4940c0b995abc2 (patch)
treef9af8eea778b258a84f752c9c8513698ce53de34 /tools
parente1e69446f6c3419c9a587a692c571bf77f9cc047 (diff)
downloadpytorch-a17528277678b0d6dc76ffce1c4940c0b995abc2.tar.gz
pytorch-a17528277678b0d6dc76ffce1c4940c0b995abc2.tar.bz2
pytorch-a17528277678b0d6dc76ffce1c4940c0b995abc2.zip
Flags for LMDB, LevelDB, and Caffe2 ops (#11462)
Summary: Add flags for LMDB and LevelDB, default `OFF`. These can be enabled with ``` USE_LMDB=1 USE_LEVELDB=1 python setup.py build_deps ``` Also add a flag to build Caffe2 ops, which is default `ON`. Disable with ``` NO_CAFFE2_OPS=1 python setup.py build_deps ``` cc Yangqing soumith pjh5 mingzhe09088 Pull Request resolved: https://github.com/pytorch/pytorch/pull/11462 Reviewed By: soumith Differential Revision: D9758156 Pulled By: orionr fbshipit-source-id: 95fd206d72fdf44df54fc5d0aeab598bff900c63
Diffstat (limited to 'tools')
-rwxr-xr-xtools/build_pytorch_libs.bat3
-rwxr-xr-xtools/build_pytorch_libs.sh3
-rw-r--r--tools/setup_helpers/build.py3
3 files changed, 9 insertions, 0 deletions
diff --git a/tools/build_pytorch_libs.bat b/tools/build_pytorch_libs.bat
index 80d79dc436..34d7ea1ac0 100755
--- a/tools/build_pytorch_libs.bat
+++ b/tools/build_pytorch_libs.bat
@@ -180,10 +180,13 @@ goto:eof
-DBUILD_BINARY=%BUILD_BINARY% ^
-DBUILD_TEST=OFF ^
-DINSTALL_TEST=%INSTALL_TEST% ^
+ -DBUILD_CAFFE2_OPS=%BUILD_CAFFE2_OPS% ^
-DONNX_NAMESPACE=%ONNX_NAMESPACE% ^
-DUSE_CUDA=%USE_CUDA% ^
-DUSE_CUDNN=OFF ^
-DUSE_NNPACK=%USE_NNPACK% ^
+ -DUSE_LEVELDB=%USE_LEVELDB% ^
+ -DUSE_LMDB=%USE_LMDB% ^
-DUSE_OPENCV=%USE_OPENCV% ^
-DUSE_GLOG=OFF ^
-DUSE_GFLAGS=OFF ^
diff --git a/tools/build_pytorch_libs.sh b/tools/build_pytorch_libs.sh
index ba0bde0d57..d09dc756d8 100755
--- a/tools/build_pytorch_libs.sh
+++ b/tools/build_pytorch_libs.sh
@@ -263,11 +263,14 @@ function build_caffe2() {
-DBUILD_BINARY=$BUILD_BINARY \
-DBUILD_TEST=$BUILD_TEST \
-DINSTALL_TEST=$INSTALL_TEST \
+ -DBUILD_CAFFE2_OPS=$BUILD_CAFFE2_OPS \
-DONNX_NAMESPACE=$ONNX_NAMESPACE \
-DUSE_CUDA=$USE_CUDA \
-DCAFFE2_STATIC_LINK_CUDA=$CAFFE2_STATIC_LINK_CUDA \
-DUSE_ROCM=$USE_ROCM \
-DUSE_NNPACK=$USE_NNPACK \
+ -DUSE_LEVELDB=$USE_LEVELDB \
+ -DUSE_LMDB=$USE_LMDB \
-DUSE_OPENCV=$USE_OPENCV \
-DUSE_GLOG=OFF \
-DUSE_GFLAGS=OFF \
diff --git a/tools/setup_helpers/build.py b/tools/setup_helpers/build.py
index 82364bd739..09e26cb5aa 100644
--- a/tools/setup_helpers/build.py
+++ b/tools/setup_helpers/build.py
@@ -2,4 +2,7 @@ from .env import check_env_flag, check_negative_env_flag
BUILD_BINARY = check_env_flag('BUILD_BINARY')
BUILD_TEST = not check_negative_env_flag('BUILD_TEST')
+BUILD_CAFFE2_OPS = not check_negative_env_flag('BUILD_CAFFE2_OPS')
+USE_LEVELDB = check_env_flag('USE_LEVELDB')
+USE_LMDB = check_env_flag('USE_LMDB')
USE_OPENCV = check_env_flag('USE_OPENCV')