diff options
-rw-r--r-- | .SRCINFO | 63 | ||||
-rw-r--r-- | PKGBUILD | 71 | ||||
-rw-r--r-- | dependencies.patch | 14 | ||||
-rw-r--r-- | python_CMakeLists.patch | 29 | ||||
-rw-r--r-- | src_caffe_CMakeLists.patch | 9 |
5 files changed, 186 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..11626338b606 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,63 @@ +pkgbase = caffe-opencl-git + pkgdesc = A deep learning framework made with expression, speed, and modularity in mind (Experimental, OpenCL) + pkgver = 1.0 + pkgrel = 1 + url = http://caffe.berkeleyvision.org/ + arch = i686 + arch = x86_64 + license = BSD + makedepends = doxygen + makedepends = texlive-core + makedepends = cmake + depends = boost-libs + depends = protobuf + depends = google-glog + depends = gflags + depends = hdf5 + depends = opencv + depends = leveldb + depends = lmdb + depends = python + depends = boost + depends = cython + depends = python-numpy + depends = python-scipy + depends = python-matplotlib + depends = ipython + depends = python-h5py + depends = python-networkx + depends = python-nose + depends = python-pandas + depends = python-dateutil + depends = python-protobuf + depends = python-gflags + depends = python-yaml + depends = python-pillow + depends = python-six + depends = openblas-lapack + depends = python-leveldb + depends = python-scikit-image + depends = python-pydotplus + depends = viennacl + provides = caffe + conflicts = caffe + conflicts = caffe-git + conflicts = caffe-cpu-git + conflicts = caffe-dr-git + conflicts = caffe-mnc-dr-git + conflicts = caffe-cpu + conflicts = caffe2 + conflicts = caffe2-git + conflicts = caffe2-cpu + conflicts = caffe2-cpu-git + source = caffe::git+https://github.com/BVLC/caffe#branch=opencl + source = dependencies.patch + source = python_CMakeLists.patch + source = src_caffe_CMakeLists.patch + sha256sums = SKIP + sha256sums = 3c850eb21950c09822a66c97c953599834d48a58665b3c812677c3370575d86e + sha256sums = d2974a35b695cfa176da7c26c860d18941de5b85870c42cb104034fec400599c + sha256sums = d1012a6248f10303b56aba04c5dead93988f5ab2e9488dc885f79be4d14b936c + +pkgname = caffe-opencl-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..043ed2e62afa --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,71 @@ +# Maintainer : Thomas Ivesdal-Tronstad < lyse-net: thotro > + +pkgname=caffe-opencl-git +_srcname=caffe +pkgver=1.0 +pkgrel=1 +pkgdesc="A deep learning framework made with expression, speed, and modularity in mind (Experimental, OpenCL)" +arch=('i686' 'x86_64') +url="http://caffe.berkeleyvision.org/" +license=('BSD') +depends=( + # official repositories: + 'boost-libs' 'protobuf' 'google-glog' 'gflags' 'hdf5' 'opencv' 'leveldb' + 'lmdb' 'python' 'boost' 'cython' 'python-numpy' 'python-scipy' + 'python-matplotlib' 'ipython' 'python-h5py' 'python-networkx' 'python-nose' + 'python-pandas' 'python-dateutil' 'python-protobuf' 'python-gflags' + 'python-yaml' 'python-pillow' 'python-six' + # AUR: + 'openblas-lapack' 'python-leveldb' 'python-scikit-image' 'python-pydotplus' 'viennacl' + # NOTE: + # python-pydotplus (or python-pydot) is required by python executable draw_net.py + # https://github.com/BVLC/caffe/blob/eeebdab16155d34ff8f5f42137da7df4d1c7eab0/python/caffe/draw.py#L7-L22 +) +makedepends=('doxygen' 'texlive-core' 'cmake') +provides=('caffe') +conflicts=('caffe' 'caffe-git' 'caffe-cpu-git' 'caffe-dr-git' 'caffe-mnc-dr-git' 'caffe-cpu' + 'caffe2' 'caffe2-git' 'caffe2-cpu' 'caffe2-cpu-git') +source=("${_srcname}"::"git+https://github.com/BVLC/${_srcname}#branch=opencl" + 'dependencies.patch' + 'python_CMakeLists.patch' + 'src_caffe_CMakeLists.patch') +sha256sums=('SKIP' + '3c850eb21950c09822a66c97c953599834d48a58665b3c812677c3370575d86e' + 'd2974a35b695cfa176da7c26c860d18941de5b85870c42cb104034fec400599c' + 'd1012a6248f10303b56aba04c5dead93988f5ab2e9488dc885f79be4d14b936c') + +prepare() { + cd "${_srcname}" + + # This patch makes cmake find libboost_python3 (it normally only looks for libboost_python_py3 etc.) + patch cmake/Dependencies.cmake < ../dependencies.patch + + # Set install path of python stuff to the correct place + patch python/CMakeLists.txt < ../python_CMakeLists.patch + + # Set install path of python stuff to the correct place + patch src/caffe/CMakeLists.txt < ../src_caffe_CMakeLists.patch + mkdir build + cd build + cmake -D BLAS=Open -D python_version=3 -DCMAKE_INSTALL_PREFIX:PATH=${pkgdir}/usr -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_PYTHON_INSTALL_PATH=lib/python3.6/site-packages .. +} + +build() { + cd "${_srcname}/build" + make -j8 all +} + +# uncomment this block if you want to run the checks/tests +#check() { +# cd "${_srcname}/build" +# msg2 "Building target 'test'..." +# make runtest +#} + +package() { + cd "${_srcname}/build" + make install + + # Copy license file + install -m644 ../LICENSE ${pkgdir}/usr/share/Caffe +} diff --git a/dependencies.patch b/dependencies.patch new file mode 100644 index 000000000000..b91b40f59834 --- /dev/null +++ b/dependencies.patch @@ -0,0 +1,14 @@ +--- cmake/Dependencies.cmake 2018-04-03 23:24:25.971815289 +0200 ++++ cmake/Dependencies.cmake.new 2018-04-03 23:24:05.947918330 +0200 +@@ -283,6 +283,11 @@ + find_package(Boost 1.46 COMPONENTS "python-py${boost_py_version}") + set(Boost_PYTHON_FOUND ${Boost_PYTHON-PY${boost_py_version}_FOUND}) + ++ if(NOT Boost_PYTHON_FOUND) ++ find_package(Boost 1.46 COMPONENTS "python${boost_py_version}") ++ set(Boost_PYTHON_FOUND ${Boost_PYTHON${boost_py_version}_FOUND}) ++ endif() ++ + STRING( REGEX MATCHALL "([0-9.]+).[0-9]+" has_more_version ${version} ) + if("${has_more_version}" STREQUAL "") + break() diff --git a/python_CMakeLists.patch b/python_CMakeLists.patch new file mode 100644 index 000000000000..83c75bb26ce5 --- /dev/null +++ b/python_CMakeLists.patch @@ -0,0 +1,29 @@ +--- CMakeLists.txt 2018-04-04 10:40:06.314107119 +0200 ++++ CMakeLists.txt.new 2018-04-04 10:39:31.520512620 +0200 +@@ -38,11 +38,11 @@ + # ---[ Install + # scripts + file(GLOB python_files *.py requirements.txt) +-install(FILES ${python_files} DESTINATION python) ++#install(FILES ${python_files} DESTINATION lib/python3.6/site-packages/caffe) + + # module + install(DIRECTORY caffe +- DESTINATION python ++ DESTINATION ${CMAKE_PYTHON_INSTALL_PATH} + FILES_MATCHING + PATTERN "*.py" + PATTERN "ilsvrc_2012_mean.npy" +@@ -50,10 +50,10 @@ + ) + + # _caffe.so +-install(TARGETS pycaffe DESTINATION python/caffe) ++install(TARGETS pycaffe DESTINATION ${CMAKE_PYTHON_INSTALL_PATH}/caffe) + + if(MSVC AND INSTALL_PREREQUISITES) +- caffe_install_prerequisites(pycaffe DESTINATION python/caffe) ++ caffe_install_prerequisites(pycaffe DESTINATION ${CMAKE_PYTHON_INSTALL_PATH}/caffe) + endif() + + diff --git a/src_caffe_CMakeLists.patch b/src_caffe_CMakeLists.patch new file mode 100644 index 000000000000..306116237923 --- /dev/null +++ b/src_caffe_CMakeLists.patch @@ -0,0 +1,9 @@ +--- CMakeLists.txt 2018-04-04 10:40:06.314107119 +0200 ++++ CMakeLists.txt.new 2018-04-04 10:34:42.313188619 +0200 +@@ -112,5 +112,5 @@ + + file(WRITE ${PROJECT_BINARY_DIR}/__init__.py) + list(APPEND proto_python ${PROJECT_BINARY_DIR}/__init__.py) +-install(PROGRAMS ${proto_python} DESTINATION python/caffe/proto) ++install(PROGRAMS ${proto_python} DESTINATION ${CMAKE_PYTHON_INSTALL_PATH}/caffe/proto) + |