mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
third party clean
This commit is contained in:
parent
ffec31ea07
commit
9e5c795c11
17
build.py
17
build.py
|
|
@ -41,17 +41,14 @@ class Config(object):
|
|||
# compiling) you may want to set USE_SYSTEM_EIGEN to False.
|
||||
USE_SYSTEM_EIGEN = False
|
||||
|
||||
# BLAS functions: whether to use Eigen for all the BLAS calls. In platforms
|
||||
# that do not have an optimized BLAS library, this would usually solve the
|
||||
# problem as Eigen will generate all the code. Optionally, one can specify
|
||||
# a separately compiled BLAS library (such as MKL) and we will use that
|
||||
# library for all BLAS calls.
|
||||
USE_EIGEN_FOR_BLAS = True
|
||||
# If you have set the above flag to False, you should specify a BLAS backend
|
||||
# here. Note that, if the BLAS backend is MKL, we will also assume that the
|
||||
# BLAS backend: which backend to use for blas functions.
|
||||
# Note that, if the BLAS backend is MKL, we will also assume that the
|
||||
# MKL VSL library is present, and we will use the VSL function calls as
|
||||
# well. If USE_EIGEN_FOR_BLAS is True, this config has no effect.
|
||||
BLAS_BACKEND = "atlas"
|
||||
# well.
|
||||
# Also note that, if the BLAS backend is eigen, there is actually *no*
|
||||
# actual blas function calls. We only routed the caffe-specific functions
|
||||
# to use Eigen.
|
||||
BLAS_BACKEND = "eigen"
|
||||
|
||||
# google-glog: Caffe can choose to use google glog, which will allow a more
|
||||
# sophisticated logging scheme. It also comes with a minimal logging tool
|
||||
|
|
|
|||
|
|
@ -30,10 +30,8 @@ cc_binary(
|
|||
deps = [
|
||||
"//caffe2/core:core",
|
||||
"//caffe2/proto:caffe2_proto",
|
||||
"//third_party/leveldb:leveldb",
|
||||
"//third_party/opencv:opencv_core",
|
||||
"//third_party/opencv:opencv_highgui",
|
||||
"//third_party/opencv:opencv_imgproc",
|
||||
"//third_party:leveldb",
|
||||
"//third_party:opencv",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
@ -69,9 +67,7 @@ cc_binary(
|
|||
"//caffe2/core:core",
|
||||
"//caffe2/db:db",
|
||||
"//caffe2/proto:caffe2_proto",
|
||||
"//third_party/opencv:opencv_core",
|
||||
"//third_party/opencv:opencv_highgui",
|
||||
"//third_party/opencv:opencv_imgproc",
|
||||
"//third_party:opencv",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
@ -122,7 +118,7 @@ cc_binary(
|
|||
"//caffe2/core:core",
|
||||
"//caffe2/db:db",
|
||||
"//caffe2/utils:proto_utils",
|
||||
"//third_party/openmpi:openmpi",
|
||||
"//third_party:openmpi",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ cc_library(
|
|||
"//caffe2/proto:caffe2_proto",
|
||||
"//caffe2/utils:proto_utils",
|
||||
"//caffe2/utils:simple_queue",
|
||||
"//third_party/glog:glog",
|
||||
"//third_party:glog",
|
||||
],
|
||||
whole_archive = True,
|
||||
)
|
||||
|
|
@ -40,7 +40,7 @@ cc_library(
|
|||
deps = [
|
||||
":core",
|
||||
"//third_party/cnmem:cnmem",
|
||||
"//third_party/cuda:cuda",
|
||||
"//third_party:cuda",
|
||||
],
|
||||
whole_archive = True,
|
||||
)
|
||||
|
|
@ -55,7 +55,7 @@ cc_library(
|
|||
],
|
||||
deps = [
|
||||
":core",
|
||||
"//third_party/cudnn:cudnn",
|
||||
"//third_party:cudnn",
|
||||
],
|
||||
whole_archive = True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ cc_headers(
|
|||
name = "common_rtc",
|
||||
srcs = ["common_rtc.h"],
|
||||
deps = [
|
||||
"//third_party/cuda:cuda",
|
||||
"//third_party/cuda:nvrtc",
|
||||
"//third_party:cuda",
|
||||
"//third_party:nvrtc",
|
||||
]
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ cc_library(
|
|||
],
|
||||
deps = [
|
||||
"//caffe2/core:core",
|
||||
"//third_party/leveldb:leveldb",
|
||||
"//third_party:leveldb",
|
||||
],
|
||||
whole_archive = True,
|
||||
)
|
||||
|
|
@ -20,7 +20,7 @@ cc_library(
|
|||
],
|
||||
deps = [
|
||||
"//caffe2/core:core",
|
||||
"//third_party/liblmdb:lmdb",
|
||||
"//third_party:lmdb",
|
||||
],
|
||||
whole_archive = True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@ cc_library(
|
|||
"//caffe2/operators:core_ops",
|
||||
"//caffe2/utils:math",
|
||||
"//caffe2/utils:proto_utils",
|
||||
"//third_party/opencv:opencv_core",
|
||||
"//third_party/opencv:opencv_highgui",
|
||||
"//third_party/opencv:opencv_imgproc",
|
||||
"//third_party:opencv",
|
||||
],
|
||||
whole_archive = True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ cc_library(
|
|||
deps = [
|
||||
":mpi_common",
|
||||
"//caffe2/core:core",
|
||||
"//third_party/openmpi:openmpi",
|
||||
"//third_party:openmpi",
|
||||
],
|
||||
whole_archive = True,
|
||||
)
|
||||
|
|
@ -39,7 +39,7 @@ cc_library(
|
|||
deps = [
|
||||
":mpi_common",
|
||||
"//caffe2/core:core_gpu",
|
||||
"//third_party/openmpi:openmpi",
|
||||
"//third_party:openmpi",
|
||||
],
|
||||
whole_archive = True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ cc_library(
|
|||
"//caffe2/core:core_cudnn",
|
||||
"//caffe2/core:core_gpu",
|
||||
"//caffe2/utils:math_gpu",
|
||||
"//third_party/cudnn:cudnn",
|
||||
"//third_party:cudnn",
|
||||
],
|
||||
whole_archive = True,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ cc_library(
|
|||
],
|
||||
deps = [
|
||||
"//third_party/eigen3:eigen",
|
||||
"//third_party/blas:blas",
|
||||
"//third_party:blas",
|
||||
"//caffe2/core:core",
|
||||
],
|
||||
)
|
||||
|
|
@ -75,6 +75,6 @@ cc_headers(
|
|||
],
|
||||
deps = [
|
||||
"//caffe2/core:core",
|
||||
"//third_party/libzmq:libzmq",
|
||||
"//third_party:libzmq",
|
||||
]
|
||||
)
|
||||
|
|
|
|||
162
third_party/BREW
vendored
Normal file
162
third_party/BREW
vendored
Normal file
|
|
@ -0,0 +1,162 @@
|
|||
# Subfolders in the third_party folder are used to help install things more
|
||||
# easily and you should pre-install them on your machine.
|
||||
|
||||
###############################################################################
|
||||
# BLAS
|
||||
# This section is intended to be the central location that hosts all possible
|
||||
# BLAS backends. Note that all these are only linking flags, so if one of the
|
||||
# libraries is not used, don't bother installing it - Caffe2 will still build
|
||||
# normally.
|
||||
##############################################################################
|
||||
|
||||
# A catch-all target: all the targets should link to this instead of the
|
||||
# specific libraries below.
|
||||
cc_library(
|
||||
name = "blas",
|
||||
srcs = [],
|
||||
deps = [":" + Brewery.Env.Config.BLAS_BACKEND],
|
||||
)
|
||||
|
||||
# Atlas
|
||||
cc_thirdparty_target(
|
||||
name = "atlas",
|
||||
cc_obj_files = [ "-lcblas -latlas" ],
|
||||
)
|
||||
|
||||
# Eigen
|
||||
cc_thirdparty_target(
|
||||
name = "eigen",
|
||||
deps = ["//third_party/eigen3:eigen"],
|
||||
cc_obj_files = [],
|
||||
)
|
||||
|
||||
# Intel MKL.
|
||||
cc_thirdparty_target(
|
||||
name = "mkl",
|
||||
cc_obj_files = [ "-lmkl_rt" ],
|
||||
)
|
||||
|
||||
# OpenBLAS
|
||||
cc_thirdparty_target(
|
||||
name = "openblas",
|
||||
cc_obj_files = [ "-lopenblas" ],
|
||||
)
|
||||
|
||||
# TODO: add the OS X veclib/Accelerate framework backend.
|
||||
|
||||
|
||||
###############################################################################
|
||||
# CUDA
|
||||
# This section includes all cuda-related dependencies.
|
||||
##############################################################################
|
||||
|
||||
if Brewery.Env.Config.LINK_CUDA_STATIC:
|
||||
cc_thirdparty_target(
|
||||
name = "cuda",
|
||||
cc_obj_files = [
|
||||
"-lcublas_static",
|
||||
"-lcurand_static",
|
||||
"-lcudart_static",
|
||||
"-lculibos",
|
||||
"-ldl",
|
||||
] +
|
||||
(["-lrt"] if Brewery.Env.NEED_LIBRT else [])
|
||||
)
|
||||
else:
|
||||
cc_thirdparty_target(
|
||||
name = "cuda",
|
||||
cc_obj_files = [
|
||||
"-lcublas",
|
||||
"-lcurand",
|
||||
"-lcudart",
|
||||
"-lculibos",
|
||||
"-ldl",
|
||||
] +
|
||||
(["-lrt"] if Brewery.Env.NEED_LIBRT else [])
|
||||
)
|
||||
|
||||
cc_thirdparty_target(
|
||||
name = "cudnn",
|
||||
deps = [":cuda"],
|
||||
cc_obj_files = ["-lcudnn_static"],
|
||||
)
|
||||
|
||||
cc_thirdparty_target(
|
||||
name = "nvrtc",
|
||||
deps = [
|
||||
":cuda",
|
||||
],
|
||||
cc_obj_files = [
|
||||
"-lnvrtc",
|
||||
"-lcuda",
|
||||
],
|
||||
)
|
||||
|
||||
cc_thirdparty_target(
|
||||
name="cnmen",
|
||||
deps=["//third_party/cnmem:cnmem"],
|
||||
cc_obj_files = [],
|
||||
)
|
||||
|
||||
###############################################################################
|
||||
# Other libraries
|
||||
# This section includes all other libraries in alphabet order.
|
||||
##############################################################################
|
||||
|
||||
cc_thirdparty_target(
|
||||
name="glog",
|
||||
cc_obj_files = ["-lglog"] if Brewery.Env.Config.USE_GLOG else [],
|
||||
)
|
||||
|
||||
cc_thirdparty_target(
|
||||
name = "leveldb",
|
||||
deps = [":snappy"],
|
||||
cc_obj_files = [ "-lleveldb" ],
|
||||
)
|
||||
|
||||
cc_thirdparty_target(
|
||||
name = "lmdb",
|
||||
cc_obj_files = ["-llmdb"],
|
||||
)
|
||||
|
||||
cc_thirdparty_target(
|
||||
name = "libzmq",
|
||||
cc_obj_files = [ "-lzmq" ],
|
||||
)
|
||||
|
||||
cc_thirdparty_target(
|
||||
name="opencv",
|
||||
cc_obj_files=[
|
||||
"-lopencv_core",
|
||||
"-lopencv_highgui",
|
||||
"-lopencv_imgproc",
|
||||
],
|
||||
)
|
||||
|
||||
cc_thirdparty_target(
|
||||
name="openmpi",
|
||||
cc_obj_files = ['-l' + s for s in Brewery.Env.MPI_LIBS]
|
||||
)
|
||||
|
||||
cc_thirdparty_target(
|
||||
name="protobuf_lite",
|
||||
deps=["//third_party/google:protobuf_lite"],
|
||||
cc_obj_files = [],
|
||||
)
|
||||
|
||||
cc_thirdparty_target(
|
||||
name="protobuf",
|
||||
deps=["//third_party/google:protobuf"],
|
||||
cc_obj_files = [],
|
||||
)
|
||||
|
||||
cc_thirdparty_target(
|
||||
name="protoc",
|
||||
deps=["//third_party/google:protoc"],
|
||||
cc_obj_files = [],
|
||||
)
|
||||
|
||||
cc_thirdparty_target(
|
||||
name = "snappy",
|
||||
cc_obj_files = ["-lsnappy"],
|
||||
)
|
||||
33
third_party/blas/BREW
vendored
33
third_party/blas/BREW
vendored
|
|
@ -1,33 +0,0 @@
|
|||
# This BREW file is intended to be the central location that hosts all possible
|
||||
# BLAS backends. Note that all these are only linking flags, so if one of the
|
||||
# libraries is not used, don't bother installing it - Caffe2 will still build
|
||||
# normally.
|
||||
|
||||
# A catch-all target: all the targets should link to this instead of the
|
||||
# specific libraries below.
|
||||
cc_library(
|
||||
name = "blas",
|
||||
srcs = [],
|
||||
deps = ([] if Brewery.Env.Config.USE_EIGEN_FOR_BLAS
|
||||
else [":" + Brewery.Env.Config.BLAS_BACKEND]),
|
||||
)
|
||||
|
||||
# Atlas
|
||||
cc_thirdparty_target(
|
||||
name = "atlas",
|
||||
cc_obj_files = [ "-lcblas -latlas" ],
|
||||
)
|
||||
|
||||
# Intel MKL.
|
||||
cc_thirdparty_target(
|
||||
name = "mkl",
|
||||
cc_obj_files = [ "-lmkl_rt" ],
|
||||
)
|
||||
|
||||
# OpenBLAS
|
||||
cc_thirdparty_target(
|
||||
name = "openblas",
|
||||
cc_obj_files = [ "-lopenblas" ],
|
||||
)
|
||||
|
||||
# TODO: add the OS X veclib/Accelerate framework backend.
|
||||
2
third_party/cnmem/BREW
vendored
2
third_party/cnmem/BREW
vendored
|
|
@ -7,6 +7,6 @@ cuda_library(
|
|||
"cnmem.h",
|
||||
],
|
||||
deps = [
|
||||
"//third_party/cuda:cuda",
|
||||
"//third_party:cuda",
|
||||
]
|
||||
)
|
||||
|
|
|
|||
35
third_party/cuda/BREW
vendored
35
third_party/cuda/BREW
vendored
|
|
@ -1,35 +0,0 @@
|
|||
if Brewery.Env.Config.LINK_CUDA_STATIC:
|
||||
cc_thirdparty_target(
|
||||
name = "cuda",
|
||||
cc_obj_files = [
|
||||
"-lcublas_static",
|
||||
"-lcurand_static",
|
||||
"-lcudart_static",
|
||||
"-lculibos",
|
||||
"-ldl",
|
||||
] +
|
||||
(["-lrt"] if Brewery.Env.NEED_LIBRT else [])
|
||||
)
|
||||
else:
|
||||
cc_thirdparty_target(
|
||||
name = "cuda",
|
||||
cc_obj_files = [
|
||||
"-lcublas",
|
||||
"-lcurand",
|
||||
"-lcudart",
|
||||
"-lculibos",
|
||||
"-ldl",
|
||||
] +
|
||||
(["-lrt"] if Brewery.Env.NEED_LIBRT else [])
|
||||
)
|
||||
|
||||
cc_thirdparty_target(
|
||||
name = "nvrtc",
|
||||
deps = [
|
||||
":cuda",
|
||||
],
|
||||
cc_obj_files = [
|
||||
"-lnvrtc",
|
||||
"-lcuda",
|
||||
],
|
||||
)
|
||||
8
third_party/cudnn/BREW
vendored
8
third_party/cudnn/BREW
vendored
|
|
@ -1,8 +0,0 @@
|
|||
cc_thirdparty_target(
|
||||
name = "cudnn",
|
||||
cc_obj_files = ["-lcudnn_static"],
|
||||
deps = [
|
||||
"//third_party/cuda:cuda",
|
||||
]
|
||||
)
|
||||
|
||||
11
third_party/glog/BREW
vendored
11
third_party/glog/BREW
vendored
|
|
@ -1,11 +0,0 @@
|
|||
if Brewery.Env.Config.USE_GLOG:
|
||||
cc_thirdparty_target(
|
||||
name="glog",
|
||||
cc_obj_files=["-lglog"],
|
||||
)
|
||||
else:
|
||||
# A dummy dependency that has no effect.
|
||||
cc_thirdparty_target(
|
||||
name="glog",
|
||||
cc_obj_files=[],
|
||||
)
|
||||
5
third_party/leveldb/BREW
vendored
5
third_party/leveldb/BREW
vendored
|
|
@ -1,5 +0,0 @@
|
|||
cc_thirdparty_target(
|
||||
name = "leveldb",
|
||||
deps = ["//third_party/snappy:snappy"],
|
||||
cc_obj_files = [ "-lleveldb" ],
|
||||
)
|
||||
4
third_party/liblmdb/BREW
vendored
4
third_party/liblmdb/BREW
vendored
|
|
@ -1,4 +0,0 @@
|
|||
cc_thirdparty_target(
|
||||
name = "lmdb",
|
||||
cc_obj_files = ["-llmdb"],
|
||||
)
|
||||
4
third_party/libzmq/BREW
vendored
4
third_party/libzmq/BREW
vendored
|
|
@ -1,4 +0,0 @@
|
|||
cc_thirdparty_target(
|
||||
name = "libzmq",
|
||||
cc_obj_files = [ "-lzmq" ],
|
||||
)
|
||||
14
third_party/opencv/BREW
vendored
14
third_party/opencv/BREW
vendored
|
|
@ -1,14 +0,0 @@
|
|||
cc_thirdparty_target(
|
||||
name="opencv_core",
|
||||
cc_obj_files=["-lopencv_core"],
|
||||
)
|
||||
|
||||
cc_thirdparty_target(
|
||||
name="opencv_highgui",
|
||||
cc_obj_files=["-lopencv_highgui"],
|
||||
)
|
||||
|
||||
cc_thirdparty_target(
|
||||
name="opencv_imgproc",
|
||||
cc_obj_files=["-lopencv_imgproc"],
|
||||
)
|
||||
4
third_party/openmpi/BREW
vendored
4
third_party/openmpi/BREW
vendored
|
|
@ -1,4 +0,0 @@
|
|||
cc_thirdparty_target(
|
||||
name="openmpi",
|
||||
cc_obj_files = ['-l' + s for s in Brewery.Env.MPI_LIBS]
|
||||
)
|
||||
6
third_party/snappy/BREW
vendored
6
third_party/snappy/BREW
vendored
|
|
@ -1,6 +0,0 @@
|
|||
cc_thirdparty_target(
|
||||
name = "snappy",
|
||||
cc_obj_files = [
|
||||
"-lsnappy"
|
||||
],
|
||||
)
|
||||
Loading…
Reference in New Issue
Block a user