summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD35
-rw-r--r--caffe2-1.0rc1-add-full-relro.patch33
3 files changed, 57 insertions, 15 deletions
diff --git a/.SRCINFO b/.SRCINFO
index caea9d2e4401..5e7fb96188f9 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 = 5
+ pkgrel = 6
url = https://caffe2.ai/
arch = i686
arch = x86_64
@@ -79,6 +79,7 @@ pkgbase = caffe2
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
sha256sums = 473cd4af032ddec4279cf3a90dd9508b6fa0be5cd89c842945f88b5a576a4231
sha256sums = SKIP
sha256sums = SKIP
@@ -106,6 +107,7 @@ pkgbase = caffe2
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
+ sha256sums = c41dd34bdf0bfbe62bba8527e950a14b356bef136edc53ea40c6469644502583
pkgname = caffe2
diff --git a/PKGBUILD b/PKGBUILD
index 8660e8af1965..53aa303fde3f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -31,7 +31,7 @@ _pytorchver=1.0rc1 # pytorch stable release version
pkgname=caffe2
pkgver="0.8.2.pytorch.${_pytorchver}"
-pkgrel=5
+pkgrel=6
pkgdesc='A new lightweight, modular, and scalable deep learning framework'
arch=('i686' 'x86_64')
url='https://caffe2.ai/'
@@ -90,6 +90,8 @@ source=(
"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/intel/ideep.git#commit=${_ideep_commit}"
+ # patches:
+ 'caffe2-1.0rc1-add-full-relro.patch'
)
sha256sums=('473cd4af032ddec4279cf3a90dd9508b6fa0be5cd89c842945f88b5a576a4231'
'SKIP'
@@ -117,10 +119,11 @@ sha256sums=('473cd4af032ddec4279cf3a90dd9508b6fa0be5cd89c842945f88b5a576a4231'
'SKIP'
'SKIP'
'SKIP'
- 'SKIP')
+ 'SKIP'
+ 'c41dd34bdf0bfbe62bba8527e950a14b356bef136edc53ea40c6469644502583')
prepare() {
- cd "${srcdir}/pytorch-${_pytorchver}/third_party"
+ cd "pytorch-${_pytorchver}/third_party"
local _component
local _thirdparty_list="pybind11 cub googletest nervanagpu benchmark \
@@ -142,6 +145,10 @@ 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"
}
build() {
@@ -173,7 +180,7 @@ build() {
-DPYTHON_LIBRARY:FILEPATH="/usr/lib/libpython${_pythonver}m.so" \
\
-DUSE_ACL:BOOL='OFF' \
- -DUSE_ASAN:BOOL='ON' \
+ -DUSE_ASAN:BOOL='OFF' \
-DUSE_CUDA:BOOL='OFF' \
-DUSE_CUDNN:BOOL='OFF' \
-DUSE_DISTRIBUTED:BOOL='ON' \
@@ -227,17 +234,17 @@ package() {
# remove unneeded files
local _entry
local _exclude_dirs
- local _exclude_libs
mapfile -t -d '' _exclude_dirs < <(find "${pkgdir}/usr/include" -mindepth 1 -maxdepth 1 -type d ! -name 'caffe*' -print0)
- mapfile -t -d '' _exclude_libs < <(find -L "${pkgdir}/usr/lib" -maxdepth 1 -type f ! -name 'libcaffe*' -print0)
- rm -f "$pkgdir"/usr/bin/{protoc,unzstd,zstd{cat,mt,}}
- rm -f "$pkgdir"/usr/include/{*.h,*.py}
- rm -rf "$pkgdir"/usr/lib/cmake/protobuf
- rm -f "$pkgdir"/usr/lib/pkgconfig/{protobuf-lite,protobuf}.pc
- rm -rf "$pkgdir"/usr/share/pkgconfig
- rm -rf "$pkgdir"/usr/share/{ATen,cmake/{ATen,ONNX}}
- rm -f "$pkgdir"/usr/share/man/man1/{unzstd,zstd{cat,}}.1
- for _entry in "${_exclude_dirs[@]}" "${_exclude_libs[@]}"
+ 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 -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 "$pkgdir"/usr/share/man/man1/{unzstd,zstd{cat,}}.1
+ for _entry in "${_exclude_dirs[@]}"
do
rm -rf "$_entry"
done
diff --git a/caffe2-1.0rc1-add-full-relro.patch b/caffe2-1.0rc1-add-full-relro.patch
new file mode 100644
index 000000000000..71da8831ba69
--- /dev/null
+++ b/caffe2-1.0rc1-add-full-relro.patch
@@ -0,0 +1,33 @@
+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)