summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Bermond2019-03-05 21:56:56 +0000
committerDaniel Bermond2019-03-05 21:56:56 +0000
commit6fb597307da2b22cdd93b955ea53893a8813a13b (patch)
tree7cef5e2d5c03e4eecca20e7eace62f023e1ed8c9
parentd722e3f2f8a173104ff58d89840331fe6309c909 (diff)
downloadaur-6fb597307da2b22cdd93b955ea53893a8813a13b.tar.gz
Updated to version 0.8.2.pytorch.1.0.1
-rw-r--r--.SRCINFO49
-rw-r--r--PKGBUILD108
-rw-r--r--caffe2-1.0rc1-add-full-relro.patch33
-rw-r--r--caffe2-1.0rc1-opencv4-fix.patch106
4 files changed, 79 insertions, 217 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 91740e0f7fd..1540b23c995 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = caffe2
pkgdesc = A new lightweight, modular, and scalable deep learning framework
- pkgver = 0.8.2.pytorch.1.0rc1
- pkgrel = 8
+ pkgver = 0.8.2.pytorch.1.0.1
+ pkgrel = 1
url = https://caffe2.ai/
arch = i686
arch = x86_64
@@ -24,7 +24,6 @@ pkgbase = caffe2
depends = snappy
depends = zeromq
depends = hiredis
- depends = opencv
depends = gtk3
depends = ffmpeg
depends = python-flask
@@ -53,36 +52,40 @@ pkgbase = caffe2
conflicts = python-pytorch
replaces = caffe2-cpu
options = !emptydirs
- source = pytorch-1.0rc1.tar.gz::https://github.com/pytorch/pytorch/archive/v1.0rc1.tar.gz
- source = git+https://github.com/catchorg/Catch2.git#commit=0a34cc201ef28bf25c88b0062f331369596cb7b7
+ source = pytorch-1.0.1.tar.gz::https://github.com/pytorch/pytorch/archive/v1.0.1.tar.gz
source = git+https://github.com/pybind/pybind11.git#commit=5c8746ff135abb390bf95944be593e895a586a50
source = git+https://github.com/NVlabs/cub.git#commit=285aeebaa34b0e8a7670867a2e66c1a52d998d6a
- source = git+https://github.com/eigenteam/eigen-git-mirror.git#commit=cafae68f33f7f41270b2e8c2dd181f510aa4d918
+ source = git+https://github.com/eigenteam/eigen-git-mirror.git#commit=f59336cee358f92b959de6a0daf07c4ab2318022
source = git+https://github.com/google/googletest.git#commit=2fe3bd994b3189899d93f1d5a881e725e046fdc2
- source = git+https://github.com/NervanaSystems/nervanagpu.git#commit=d4eefd50fbd7d34a17dddbc829888835d67b5f4a
source = git+https://github.com/google/benchmark.git#commit=505be96ab23056580a3a2315abba048f4428b04e
source = git+https://github.com/google/protobuf.git#commit=2761122b810fe8861004ae785cc3ab39f384d342
source = git+https://github.com/Yangqing/ios-cmake.git#commit=8abaed637d56f1337d6e1d2c4026e25c1eade724
- source = git+https://github.com/Maratyszcza/NNPACK.git#commit=af40ea7d12702f8ae55aeb13701c09cad09334c3
- source = git+https://github.com/facebookincubator/gloo.git#commit=aa0d2e3f8aa4f9cee5ffa46070491cf1ed6aae70
- source = git+https://github.com/Maratyszcza/pthreadpool.git#commit=2b06b31f6a315162348e1f3c24325eedaf6cc559
- source = git+https://github.com/Maratyszcza/FXdiv.git#commit=811b482bcd9e8d98ad80c6c78d5302bb830184b0
- source = git+https://github.com/Maratyszcza/FP16.git#commit=43d6d17df48ebf622587e7ed9472ea76573799b9
- source = git+https://github.com/Maratyszcza/psimd.git#commit=4ac61b112252778b174575931c641bef661ab3cd
+ source = git+https://github.com/Maratyszcza/NNPACK.git#commit=1e005b0c2777f39972a4ac15bea03e0e315a3d92
+ source = git+https://github.com/facebookincubator/gloo.git#commit=670b4d4aa46886cc66874e2a4dc846f5cfc2a285
+ source = git+https://github.com/Maratyszcza/pthreadpool.git#commit=13da0b4c21d17f94150713366420baaf1b5a46f4
+ source = git+https://github.com/Maratyszcza/FXdiv.git#commit=b742d1143724d646cd0f914646f1240eacf5bd73
+ source = git+https://github.com/Maratyszcza/FP16.git#commit=34d4bf01bbf7376f2baa71b8fa148b18524d45cf
+ source = git+https://github.com/Maratyszcza/psimd.git#commit=90a938f30ba414ada2f4b00674ee9631d7d85e19
source = git+https://github.com/facebook/zstd.git#commit=aec56a52fbab207fc639a1937d1e708a282edca8
- source = git+https://github.com/Maratyszcza/cpuinfo.git#commit=4e8f04355892c5deb64a51731a6afdb544a4294d
+ source = git+https://github.com/Maratyszcza/cpuinfo.git#commit=89fe1695edf9ee14c22f815f24bac45577a4f135
source = git+https://github.com/PeachPy/enum34.git#commit=4cfedc426c4e2fc52e3f5c2b4297e15ed8d6b8c7
source = git+https://github.com/Maratyszcza/PeachPy.git#commit=07d8fde8ac45d7705129475c0f94ed8925b93473
source = git+https://github.com/benjaminp/six.git#commit=15e31431af97e5e64b80af0a3f598d382bcdd49a
source = git+https://github.com/ARM-software/ComputeLibrary.git#commit=292227986edb37b01061afcad6df18ba9d6ccbeb
- source = git+https://github.com/onnx/onnx.git#commit=c4734c6200cb42c1aa36eb1f0160041d2401644d
- source = git+https://github.com/USCiLab/cereal.git#commit=51cbda5f30e56c801c07fe3d3aba5d7fb9e6cca4
- source = git+https://github.com/onnx/onnx-tensorrt.git#commit=fa0964e8477fc004ee2f49ee77ffce0bf7f711a9
- source = git+https://github.com/shibatch/sleef.git#commit=6ff7a135a1e31979d1e1844a2e7171dfbd34f54f
- source = git+https://github.com/intel/ideep.git#commit=dedff8fb8193fe3a1ea893d4bc852f8ea395b6b3
- source = caffe2-1.0rc1-add-full-relro.patch
- source = caffe2-1.0rc1-opencv4-fix.patch
- sha256sums = 473cd4af032ddec4279cf3a90dd9508b6fa0be5cd89c842945f88b5a576a4231
+ source = git+https://github.com/onnx/onnx.git#commit=42804705bdbf179d1a98394008417e1392013547
+ source = git+https://github.com/bddppq/onnx-tensorrt.git#commit=fa0964e8477fc004ee2f49ee77ffce0bf7f711a9
+ source = git+https://github.com/zdevito/sleef.git#commit=6ff7a135a1e31979d1e1844a2e7171dfbd34f54f
+ source = git+https://github.com/intel/ideep.git#commit=7b8f9d025a675522305a1c5d1328d83f11f205e8
+ source = git+https://github.com/NVIDIA/nccl.git#commit=3c6e25210bb1b544748937e5db74db0b9679b95e
+ source = git+https://github.com/google/gemmlowp.git#commit=8416bab644641a5c0a81ecf91a5cda804af0aee1
+ source = git+https://github.com/pytorch/QNNPACK.git#commit=ef05e87cef6b8e719989ce875b5e1c9fdb304c05
+ source = git+https://github.com/intel/ARM_NEON_2_x86_SSE.git#commit=97a126f08ce318023be604d03f88bf0820a9464a
+ source = git+https://github.com/pytorch/fbgemm.git#commit=79333308f5e2fc242727879dcd3de3536b6ffc39
+ source = git+https://github.com/asmjit/asmjit.git#commit=1e550aa568da993acb742ac19f2ab691a2806ad5
+ sha256sums = 210561583378132d07287518710251bcf861f9b7d625eb67258ed2e9d567cea1
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
@@ -109,8 +112,6 @@ pkgbase = caffe2
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
- sha256sums = c41dd34bdf0bfbe62bba8527e950a14b356bef136edc53ea40c6469644502583
- sha256sums = 058d05d3fdf9e4d688dc29475265c69f99892ccc5f9926d45b26da9616eb936c
pkgname = caffe2
diff --git a/PKGBUILD b/PKGBUILD
index 3222e8314e5..2c7e175eacf 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,37 +1,40 @@
# Maintainer : Daniel Bermond < gmail-com: danielbermond >
-_catch_commit='0a34cc201ef28bf25c88b0062f331369596cb7b7'
_pybind11_commit='5c8746ff135abb390bf95944be593e895a586a50'
_cub_commit='285aeebaa34b0e8a7670867a2e66c1a52d998d6a'
-_eigen_commit='cafae68f33f7f41270b2e8c2dd181f510aa4d918'
+_eigen_commit='f59336cee358f92b959de6a0daf07c4ab2318022'
_googletest_commit='2fe3bd994b3189899d93f1d5a881e725e046fdc2'
-_nervanagpu_commit='d4eefd50fbd7d34a17dddbc829888835d67b5f4a'
_benchmark_commit='505be96ab23056580a3a2315abba048f4428b04e'
_protobuf_commit='2761122b810fe8861004ae785cc3ab39f384d342'
_ios_cmake_commit='8abaed637d56f1337d6e1d2c4026e25c1eade724'
-_nnpack_commit='af40ea7d12702f8ae55aeb13701c09cad09334c3'
-_gloo_commit='aa0d2e3f8aa4f9cee5ffa46070491cf1ed6aae70'
-_pthreadpool_commit='2b06b31f6a315162348e1f3c24325eedaf6cc559'
-_fxdiv_commit='811b482bcd9e8d98ad80c6c78d5302bb830184b0'
-_fp16_commit='43d6d17df48ebf622587e7ed9472ea76573799b9'
-_psimd_commit='4ac61b112252778b174575931c641bef661ab3cd'
+_nnpack_commit='1e005b0c2777f39972a4ac15bea03e0e315a3d92'
+_gloo_commit='670b4d4aa46886cc66874e2a4dc846f5cfc2a285'
+_pthreadpool_commit='13da0b4c21d17f94150713366420baaf1b5a46f4'
+_fxdiv_commit='b742d1143724d646cd0f914646f1240eacf5bd73'
+_fp16_commit='34d4bf01bbf7376f2baa71b8fa148b18524d45cf'
+_psimd_commit='90a938f30ba414ada2f4b00674ee9631d7d85e19'
_zstd_commit='aec56a52fbab207fc639a1937d1e708a282edca8'
-_cpuinfo_commit='4e8f04355892c5deb64a51731a6afdb544a4294d'
+_cpuinfo_commit='89fe1695edf9ee14c22f815f24bac45577a4f135'
_python_enum_commit='4cfedc426c4e2fc52e3f5c2b4297e15ed8d6b8c7'
_python_peachpy_commit='07d8fde8ac45d7705129475c0f94ed8925b93473'
_python_six_commit='15e31431af97e5e64b80af0a3f598d382bcdd49a'
_computelibrary_commit='292227986edb37b01061afcad6df18ba9d6ccbeb'
-_onnx_commit='c4734c6200cb42c1aa36eb1f0160041d2401644d'
-_cereal_commit='51cbda5f30e56c801c07fe3d3aba5d7fb9e6cca4'
+_onnx_commit='42804705bdbf179d1a98394008417e1392013547'
_onnx_tensorrt_commit='fa0964e8477fc004ee2f49ee77ffce0bf7f711a9'
_sleef_commit='6ff7a135a1e31979d1e1844a2e7171dfbd34f54f'
-_ideep_commit='dedff8fb8193fe3a1ea893d4bc852f8ea395b6b3'
+_ideep_commit='7b8f9d025a675522305a1c5d1328d83f11f205e8'
+_nccl_commit='3c6e25210bb1b544748937e5db74db0b9679b95e'
+_gemmlowp_commit='8416bab644641a5c0a81ecf91a5cda804af0aee1'
+_qnnpack_commit='ef05e87cef6b8e719989ce875b5e1c9fdb304c05'
+_arm_neon_commit='97a126f08ce318023be604d03f88bf0820a9464a'
+_fbgemm_commit='79333308f5e2fc242727879dcd3de3536b6ffc39'
+_asmjit_commit='1e550aa568da993acb742ac19f2ab691a2806ad5'
-_pytorchver=1.0rc1 # pytorch stable release version
+_pytorchver=1.0.1 # pytorch stable release version
pkgname=caffe2
pkgver="0.8.2.pytorch.${_pytorchver}"
-pkgrel=8
+pkgrel=1
pkgdesc='A new lightweight, modular, and scalable deep learning framework'
arch=('i686' 'x86_64')
url='https://caffe2.ai/'
@@ -42,7 +45,7 @@ depends=(
'google-glog' 'protobuf' 'lapack' 'python' 'python-numpy' 'python-protobuf'
# not required but enabled in build:
'gflags' 'gtest' 'openmp' 'leveldb' 'lmdb' 'numactl' 'openmpi' 'snappy'
- 'zeromq' 'hiredis' 'opencv' 'gtk3' 'ffmpeg'
+ 'zeromq' 'hiredis' 'gtk3' 'ffmpeg'
# python:
'python-flask' 'python-future' 'graphviz' 'python-hypothesis'
'python-jupyter_core' 'python-matplotlib' 'python-pydot' 'python-yaml'
@@ -63,13 +66,10 @@ options=('!emptydirs')
source=(
# main source:
"pytorch-${_pytorchver}.tar.gz"::"https://github.com/pytorch/pytorch/archive/v${_pytorchver}.tar.gz"
- # third party:
- "git+https://github.com/catchorg/Catch2.git#commit=${_catch_commit}"
- "git+https://github.com/pybind/pybind11.git#commit=${_pybind11_commit}"
+ "git+https://github.com/pybind/pybind11.git#commit=${_pybind11_commit}"
"git+https://github.com/NVlabs/cub.git#commit=${_cub_commit}"
"git+https://github.com/eigenteam/eigen-git-mirror.git#commit=${_eigen_commit}"
"git+https://github.com/google/googletest.git#commit=${_googletest_commit}"
- "git+https://github.com/NervanaSystems/nervanagpu.git#commit=${_nervanagpu_commit}"
"git+https://github.com/google/benchmark.git#commit=${_benchmark_commit}"
"git+https://github.com/google/protobuf.git#commit=${_protobuf_commit}"
"git+https://github.com/Yangqing/ios-cmake.git#commit=${_ios_cmake_commit}"
@@ -86,15 +86,18 @@ source=(
"git+https://github.com/benjaminp/six.git#commit=${_python_six_commit}"
"git+https://github.com/ARM-software/ComputeLibrary.git#commit=${_computelibrary_commit}"
"git+https://github.com/onnx/onnx.git#commit=${_onnx_commit}"
- "git+https://github.com/USCiLab/cereal.git#commit=${_cereal_commit}"
- "git+https://github.com/onnx/onnx-tensorrt.git#commit=${_onnx_tensorrt_commit}"
- "git+https://github.com/shibatch/sleef.git#commit=${_sleef_commit}"
+ "git+https://github.com/bddppq/onnx-tensorrt.git#commit=${_onnx_tensorrt_commit}"
+ "git+https://github.com/zdevito/sleef.git#commit=${_sleef_commit}"
"git+https://github.com/intel/ideep.git#commit=${_ideep_commit}"
- # patches:
- 'caffe2-1.0rc1-add-full-relro.patch'
- 'caffe2-1.0rc1-opencv4-fix.patch'
+ "git+https://github.com/NVIDIA/nccl.git#commit=${_nccl_commit}"
+ "git+https://github.com/google/gemmlowp.git#commit=${_gemmlowp_commit}"
+ "git+https://github.com/pytorch/QNNPACK.git#commit=${_qnnpack_commit}"
+ "git+https://github.com/intel/ARM_NEON_2_x86_SSE.git#commit=${_arm_neon_commit}"
+ "git+https://github.com/pytorch/fbgemm.git#commit=${_fbgemm_commit}"
+ # others:
+ "git+https://github.com/asmjit/asmjit.git#commit=${_asmjit_commit}"
)
-sha256sums=('473cd4af032ddec4279cf3a90dd9508b6fa0be5cd89c842945f88b5a576a4231'
+sha256sums=('210561583378132d07287518710251bcf861f9b7d625eb67258ed2e9d567cea1'
'SKIP'
'SKIP'
'SKIP'
@@ -121,25 +124,28 @@ sha256sums=('473cd4af032ddec4279cf3a90dd9508b6fa0be5cd89c842945f88b5a576a4231'
'SKIP'
'SKIP'
'SKIP'
- 'c41dd34bdf0bfbe62bba8527e950a14b356bef136edc53ea40c6469644502583'
- '058d05d3fdf9e4d688dc29475265c69f99892ccc5f9926d45b26da9616eb936c')
+ 'SKIP'
+ 'SKIP'
+ 'SKIP')
prepare() {
cd "pytorch-${_pytorchver}/third_party"
local _component
- local _thirdparty_list="pybind11 cub googletest nervanagpu benchmark \
- protobuf ios-cmake NNPACK pthreadpool FXdiv FP16 \
- psimd gloo zstd cpuinfo ComputeLibrary onnx cereal \
- onnx-tensorrt sleef ideep"
+ local _thirdparty_list="pybind11 cub googletest benchmark protobuf ios-cmake \
+ NNPACK pthreadpool FXdiv FP16 psimd gloo zstd cpuinfo \
+ ComputeLibrary onnx onnx-tensorrt sleef ideep QNNPACK \
+ fbgemm"
# third_party which clone dir does not coincide with the third_party name
- rm -rf catch eigen python-enum python-peachpy python-six
- ln -sf "${srcdir}/Catch2" catch
- ln -sf "${srcdir}/eigen-git-mirror" eigen
- ln -sf "${srcdir}/enum34" python-enum
- ln -sf "${srcdir}/PeachPy" python-peachpy
- ln -sf "${srcdir}/six" python-six
+ rm -r eigen python-enum python-peachpy python-six nccl/nccl gemmlowp/gemmlowp neon2sse
+ ln -s "${srcdir}/eigen-git-mirror" eigen
+ ln -s "${srcdir}/enum34" python-enum
+ ln -s "${srcdir}/PeachPy" python-peachpy
+ ln -s "${srcdir}/six" python-six
+ ln -s "${srcdir}/nccl" nccl/nccl
+ ln -s "${srcdir}/gemmlowp" gemmlowp/gemmlowp
+ ln -s "${srcdir}/ARM_NEON_2_x86_SSE" neon2sse
# third_party which clone dir coincide with the third_party name
for _component in $_thirdparty_list
@@ -147,13 +153,6 @@ prepare() {
rm -rf "$_component"
ln -sf "${srcdir}/${_component}" "${_component}"
done
-
- # add full relro
- cd "${srcdir}/pytorch-${_pytorchver}"
- patch -Np1 -i "${srcdir}/caffe2-1.0rc1-add-full-relro.patch"
-
- # opencv 4.0 fix
- patch -Np1 -i "${srcdir}/caffe2-1.0rc1-opencv4-fix.patch"
}
build() {
@@ -179,6 +178,7 @@ build() {
-DGLOO_STATIC_OR_SHARED:STRING='STATIC' \
\
-DOpenCV_DIR:PATH='/usr/share/OpenCV' \
+ -DASMJIT_SRC_DIR:STRING="${srcdir}/asmjit" \
\
-DPYTHON_EXECUTABLE:FILEPATH="/usr/bin/python${_pythonver}" \
-DPYTHON_INCLUDE_DIR:PATH="/usr/include/python${_pythonver}m" \
@@ -189,32 +189,31 @@ build() {
-DUSE_CUDA:BOOL='OFF' \
-DUSE_CUDNN:BOOL='OFF' \
-DUSE_DISTRIBUTED:BOOL='ON' \
+ -DUSE_FBGEMM:BOOL='ON' \
-DUSE_FFMPEG:BOOL='ON' \
-DUSE_GFLAGS:BOOL='ON' \
-DUSE_GLOG:BOOL='ON' \
-DUSE_GLOO:BOOL='ON' \
-DUSE_GLOO_IBVERBS:BOOL='ON' \
-DUSE_IBVERBS:BOOL='ON' \
- -DUSE_IDEEP:BOOL='ON' \
-DUSE_LEVELDB:BOOL='ON' \
-DUSE_LITE_PROTO:BOOL='OFF' \
-DUSE_LMDB:BOOL='ON' \
-DUSE_METAL:BOOL='OFF' \
-DUSE_MKLDNN:BOOL='OFF' \
- -DUSE_MKLML:BOOL='OFF' \
- -DUSE_MOBILE_OPENGL:BOOL='OFF' \
-DUSE_MPI:BOOL='ON' \
-DUSE_NCCL:BOOL='OFF' \
- -DUSE_NERVANA_GPU:BOOL='OFF' \
- -DUSE_NNAPI:BOOL='OFF' \
+ -DUSE_NNAPI:BOOL='ON' \
-DUSE_NNPACK:BOOL='ON' \
-DUSE_NUMA:BOOL='ON' \
+ -DUSE_NUMPY:BOOL='ON' \
-DUSE_NVRTC:BOOL='OFF' \
-DUSE_OBSERVERS:BOOL='ON' \
-DUSE_OPENCL:BOOL='OFF' \
- -DUSE_OPENCV:BOOL='ON' \
+ -DUSE_OPENCV:BOOL='OFF' \
-DUSE_OPENMP:BOOL='ON' \
-DUSE_PROF:BOOL='OFF' \
+ -DUSE_QNNPACK:BOOL='ON' \
-DUSE_REDIS:BOOL='ON' \
-DUSE_ROCKSDB:BOOL='OFF' \
-DUSE_ROCM:BOOL='OFF' \
@@ -224,6 +223,7 @@ build() {
-DUSE_TENSORRT:BOOL='OFF' \
-DUSE_ZMQ:BOOL='ON' \
-DUSE_ZSTD:BOOL='ON' \
+ -DWITH_OPENMP:BOOL='ON' \
\
-Wno-dev \
..
@@ -243,11 +243,11 @@ package() {
rm "$pkgdir"/usr/bin/{protoc,unzstd,zstd{cat,mt,}}
rm "$pkgdir"/usr/include/{*.h,*.py}
rm "$pkgdir"/usr/lib/*.a
- rm "$pkgdir"/usr/lib/lib{zstd,onnxifi}*
+ rm "$pkgdir"/usr/lib/lib{onnxifi,zstd}*
rm -r "$pkgdir"/usr/lib/cmake/protobuf
rm "$pkgdir"/usr/lib/pkgconfig/{protobuf-lite,protobuf}.pc
rm "$pkgdir"/usr/share/pkgconfig/libzstd.pc
- rm -r "$pkgdir"/usr/share/{ATen,cmake/{ATen,ONNX}}
+ rm -r "$pkgdir"/usr/share/{ATen,cmake/{ATen,Gloo,ONNX}}
rm "$pkgdir"/usr/share/man/man1/{unzstd,zstd{cat,}}.1
for _entry in "${_exclude_dirs[@]}"
do
diff --git a/caffe2-1.0rc1-add-full-relro.patch b/caffe2-1.0rc1-add-full-relro.patch
deleted file mode 100644
index 71da8831ba6..00000000000
--- a/caffe2-1.0rc1-add-full-relro.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 79709f02e9100306f9aa9bf5887dc5afbe751b5e Mon Sep 17 00:00:00 2001
-From: Anders Papitto <anderspapitto@gmail.com>
-Date: Thu, 18 Oct 2018 15:30:15 -0700
-Subject: [PATCH] fix overwriting of CMAKE_EXE_LINKER_FLAGS (#12834)
-
-Summary:
-bug lurking since 2016
-Pull Request resolved: https://github.com/pytorch/pytorch/pull/12834
-
-Reviewed By: bddppq
-
-Differential Revision: D10452484
-
-Pulled By: anderspapitto
-
-fbshipit-source-id: 352584af06e2fb35338fb66b3d8eb1050b716349
----
- cmake/Dependencies.cmake | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index 39ed7808934..cf262894b4f 100644
---- a/cmake/Dependencies.cmake
-+++ b/cmake/Dependencies.cmake
-@@ -442,7 +442,7 @@ if(USE_MPI)
- message(STATUS "MPI libraries: " ${MPI_CXX_LIBRARIES})
- include_directories(SYSTEM ${MPI_CXX_INCLUDE_PATH})
- list(APPEND Caffe2_DEPENDENCY_LIBS ${MPI_CXX_LIBRARIES})
-- set(CMAKE_EXE_LINKER_FLAGS ${MPI_CXX_LINK_FLAGS})
-+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MPI_CXX_LINK_FLAGS}")
- find_program(OMPI_INFO
- NAMES ompi_info
- HINTS ${MPI_CXX_LIBRARIES}/../bin)
diff --git a/caffe2-1.0rc1-opencv4-fix.patch b/caffe2-1.0rc1-opencv4-fix.patch
deleted file mode 100644
index 94cb614c547..00000000000
--- a/caffe2-1.0rc1-opencv4-fix.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-diff -Naurp a/binaries/convert_encoded_to_raw_leveldb.cc b/binaries/convert_encoded_to_raw_leveldb.cc
---- a/binaries/convert_encoded_to_raw_leveldb.cc 2018-10-02 04:54:52.000000000 +0000
-+++ b/binaries/convert_encoded_to_raw_leveldb.cc 2018-11-25 18:02:35.117906145 +0000
-@@ -109,7 +109,7 @@ void ConvertToRawDataset(
- cv::Mat img = cv::imdecode(
- cv::Mat(1, &encoded_size, CV_8UC1,
- const_cast<char*>(encoded_image.data())),
-- caffe2::FLAGS_color ? CV_LOAD_IMAGE_COLOR : CV_LOAD_IMAGE_GRAYSCALE);
-+ caffe2::FLAGS_color ? cv::IMREAD_COLOR : cv::IMREAD_GRAYSCALE);
- cv::Mat resized_img;
- int scaled_width, scaled_height;
- if (caffe2::FLAGS_warp) {
-diff -Naurp a/binaries/make_image_db.cc b/binaries/make_image_db.cc
---- a/binaries/make_image_db.cc 2018-10-02 04:54:52.000000000 +0000
-+++ b/binaries/make_image_db.cc 2018-11-25 18:06:55.018892401 +0000
-@@ -140,8 +140,8 @@ class Converter {
- // Load image
- cv::Mat img = cv::imread(
- input_folder + pair.first,
-- caffe2::FLAGS_color ? CV_LOAD_IMAGE_COLOR
-- : CV_LOAD_IMAGE_GRAYSCALE);
-+ caffe2::FLAGS_color ? cv::IMREAD_COLOR
-+ : cv::IMREAD_GRAYSCALE);
-
- // Resize image
- cv::Mat resized_img;
-diff -Naurp a/caffe2/contrib/cuda-convnet2/make-data/pyext/src/pyext.cpp b/caffe2/contrib/cuda-convnet2/make-data/pyext/src/pyext.cpp
---- a/caffe2/contrib/cuda-convnet2/make-data/pyext/src/pyext.cpp 2018-11-25 13:49:49.972477452 +0000
-+++ b/caffe2/contrib/cuda-convnet2/make-data/pyext/src/pyext.cpp 2018-11-25 13:42:33.000000000 +0000
-@@ -93,7 +93,7 @@ void DecoderThread::makeJPEG(int idx) {
- size_t src_len = PyString_GET_SIZE(pySrc);
- vector<uchar> src_vec(src, src + src_len);
-
-- cv::Mat decoded_mat = cv::imdecode(cv::Mat(src_vec), CV_LOAD_IMAGE_COLOR);
-+ cv::Mat decoded_mat = cv::imdecode(cv::Mat(src_vec), cv::IMREAD_COLOR);
- assert(decoded_mat.channels() == 3);
-
- /*
-diff -Naurp a/caffe2/image/image_input_op.h b/caffe2/image/image_input_op.h
---- a/caffe2/image/image_input_op.h 2018-10-02 04:54:52.000000000 +0000
-+++ b/caffe2/image/image_input_op.h 2018-11-25 13:51:25.414641803 +0000
-@@ -465,7 +465,7 @@ bool ImageInputOp<Context>::GetImageAndL
- datum.data().size(),
- CV_8UC1,
- const_cast<char*>(datum.data().data())),
-- color_ ? CV_LOAD_IMAGE_COLOR : CV_LOAD_IMAGE_GRAYSCALE);
-+ color_ ? cv::IMREAD_COLOR : cv::IMREAD_GRAYSCALE);
- if (src.rows == 0 or src.cols == 0) {
- num_decode_errors_in_batch_++;
- src = cv::Mat::zeros(cv::Size(224, 224), CV_8UC3);
-@@ -540,7 +540,7 @@ bool ImageInputOp<Context>::GetImageAndL
- &encoded_size,
- CV_8UC1,
- const_cast<char*>(encoded_image_str.data())),
-- color_ ? CV_LOAD_IMAGE_COLOR : CV_LOAD_IMAGE_GRAYSCALE);
-+ color_ ? cv::IMREAD_COLOR : cv::IMREAD_GRAYSCALE);
- if (src.rows == 0 or src.cols == 0) {
- num_decode_errors_in_batch_++;
- src = cv::Mat::zeros(cv::Size(224, 224), CV_8UC3);
-@@ -681,7 +681,7 @@ bool ImageInputOp<Context>::GetImageAndL
- if (out_c == src.channels()) {
- *img = src;
- } else {
-- cv::cvtColor(src, *img, (out_c == 1) ? CV_BGR2GRAY : CV_GRAY2BGR);
-+ cv::cvtColor(src, *img, (out_c == 1) ? cv::COLOR_BGR2GRAY : cv::COLOR_GRAY2BGR);
- }
-
- // Note(Yangqing): I believe that the mat should be created continuous.
-diff -Naurp a/caffe2/video/optical_flow.cc b/caffe2/video/optical_flow.cc
---- a/caffe2/video/optical_flow.cc 2018-10-02 04:54:52.000000000 +0000
-+++ b/caffe2/video/optical_flow.cc 2018-11-25 20:35:42.327123803 +0000
-@@ -7,7 +7,11 @@ void OpticalFlowExtractor(
- const cv::Mat& curr_gray,
- const int flow_alg_type,
- cv::Mat& flow) {
-+#if CV_MAJOR_VERSION >= 4
-+ cv::Ptr<cv::DISOpticalFlow> tvl1 = cv::DISOpticalFlow::create();
-+#else
- cv::Ptr<cv::DualTVL1OpticalFlow> tvl1 = cv::DualTVL1OpticalFlow::create();
-+#endif
- switch (flow_alg_type) {
- case FLowAlgType::FarnebackOpticalFlow:
- cv::calcOpticalFlowFarneback(
-diff -Naurp a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
---- a/cmake/Dependencies.cmake 2018-10-02 04:54:52.000000000 +0000
-+++ b/cmake/Dependencies.cmake 2018-11-25 18:14:31.186866421 +0000
-@@ -278,11 +278,15 @@ endif()
-
- # ---[ OpenCV
- if(USE_OPENCV)
-- # OpenCV 3
-- find_package(OpenCV 3 QUIET COMPONENTS core highgui imgproc imgcodecs videoio video)
-+ # OpenCV 4
-+ find_package(OpenCV 4 QUIET COMPONENTS core highgui imgproc imgcodecs optflow videoio video)
- if(NOT OpenCV_FOUND)
-- # OpenCV 2
-- find_package(OpenCV QUIET COMPONENTS core highgui imgproc)
-+ # OpenCV 3
-+ find_package(OpenCV 3 QUIET COMPONENTS core highgui imgproc imgcodecs videoio video)
-+ if(NOT OpenCV_FOUND)
-+ # OpenCV 2
-+ find_package(OpenCV QUIET COMPONENTS core highgui imgproc)
-+ endif()
- endif()
- if(OpenCV_FOUND)
- include_directories(SYSTEM ${OpenCV_INCLUDE_DIRS})