diff options
author | Daniel Bermond | 2018-08-22 17:57:23 +0000 |
---|---|---|
committer | Daniel Bermond | 2018-08-22 17:57:23 +0000 |
commit | 1f471c31db593e94cd9a97ea7b09d6a91b47431e (patch) | |
tree | 62bd1fdfb29927273cd6dc01dce00236f2fa901d | |
download | aur-1f471c31db593e94cd9a97ea7b09d6a91b47431e.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 57 | ||||
-rw-r--r-- | Makefile.config | 30 | ||||
-rw-r--r-- | PKGBUILD | 124 |
3 files changed, 211 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..799f01befe69 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,57 @@ +pkgbase = caffe-cuda + pkgdesc = A deep learning framework made with expression, speed, and modularity in mind (with cuda) + pkgver = 1.0 + pkgrel = 1 + url = http://caffe.berkeleyvision.org/ + arch = x86_64 + license = BSD + makedepends = gcc7 + makedepends = boost + makedepends = doxygen + makedepends = texlive-core + depends = openblas + depends = lapack + depends = boost-libs + depends = protobuf + depends = google-glog + depends = gflags + depends = hdf5 + depends = opencv + depends = leveldb + depends = lmdb + depends = cuda + depends = cudnn + depends = python + 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 = python-leveldb + depends = python-scikit-image + depends = python-pydotplus + provides = caffe + conflicts = caffe + conflicts = caffe-git + conflicts = caffe-cuda-git + conflicts = caffe-cpu + conflicts = caffe-cpu-git + conflicts = caffe2 + conflicts = caffe2-cuda + source = caffe-cuda-1.0.tar.gz::https://github.com/BVLC/caffe/archive/1.0.tar.gz + source = Makefile.config + sha256sums = 71d3c9eb8a183150f965a465824d01fe82826c22505f7aa314f700ace03fa77f + sha256sums = 2f1b37655332587c599791a4e307321bdce7f6acdbc014ecf28a1f3c9bf0d785 + +pkgname = caffe-cuda + diff --git a/Makefile.config b/Makefile.config new file mode 100644 index 000000000000..02142d08dc6f --- /dev/null +++ b/Makefile.config @@ -0,0 +1,30 @@ +USE_CUDNN := 1 +USE_OPENCV := 1 +USE_LEVELDB := 1 +USE_LMDB := 1 +OPENCV_VERSION := 3 +CUSTOM_CXX := g++-7 +CUDA_DIR := /opt/cuda +CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \ + -gencode arch=compute_35,code=sm_35 \ + -gencode arch=compute_50,code=sm_50 \ + -gencode arch=compute_52,code=sm_52 \ + -gencode arch=compute_60,code=sm_60 \ + -gencode arch=compute_61,code=sm_61 \ + -gencode arch=compute_61,code=compute_61 +BLAS := open +BLAS_INCLUDE := /usr/include +BLAS_LIB := /usr/lib +PYTHON_LIBRARIES := boost_python3 python3.7m +PYTHON_INCLUDE := /usr/include/python3.7m \ + /usr/lib/python3.7/site-packages/numpy/core/include +PYTHON_LIB := /usr/lib +WITH_PYTHON_LAYER := 1 +INCLUDE_DIRS := $(PYTHON_INCLUDE) +LIBRARY_DIRS := $(PYTHON_LIB) +#USE_NCCL := 1 +USE_PKG_CONFIG := 1 +BUILD_DIR := build +DISTRIBUTE_DIR := distribute +TEST_GPUID := 0 +Q ?= @ diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..c675087fa30e --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,124 @@ +# Maintainer : Daniel Bermond < yahoo-com: danielbermond > + +pkgname=caffe-cuda +_srcname=caffe +pkgver=1.0 +pkgrel=1 +pkgdesc='A deep learning framework made with expression, speed, and modularity in mind (with cuda)' +arch=('x86_64') +url='http://caffe.berkeleyvision.org/' +license=('BSD') +depends=( + # official repositories: + 'openblas' 'lapack' 'boost-libs' 'protobuf' 'google-glog' 'gflags' + 'hdf5' 'opencv' 'leveldb' 'lmdb' 'cuda' 'cudnn' 'python' '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: + 'python-leveldb' 'python-scikit-image' 'python-pydotplus' + # NOTE: + # python-pydotplus (or python-pydot) is required by python executable 'draw_net.py' + # https://github.com/BVLC/caffe/blob/1.0/python/caffe/draw.py#L7-L22 +) +makedepends=('gcc7' 'boost' 'doxygen' 'texlive-core') +provides=('caffe') +conflicts=('caffe' 'caffe-git' 'caffe-cuda-git' 'caffe-cpu' 'caffe-cpu-git' + 'caffe2' 'caffe2-cuda') +source=("${pkgname}-${pkgver}.tar.gz"::"https://github.com/BVLC/caffe/archive/${pkgver}.tar.gz" + 'Makefile.config') +sha256sums=('71d3c9eb8a183150f965a465824d01fe82826c22505f7aa314f700ace03fa77f' + '2f1b37655332587c599791a4e307321bdce7f6acdbc014ecf28a1f3c9bf0d785') + +prepare() { + cd "${_srcname}-${pkgver}" + + local _pythonver + local _pythonmaj + local _opencvmaj + + _pythonver="$(python --version | awk '{ print $2 }' | grep -o '^[0-9]*\.[0-9]*')" + _pythonmaj="$(python --version | awk '{ print $2 }' | awk -F'.' '{ print $1 }')" + _opencvmaj="$(opencv_version | awk -F'.' '{ print $1 }')" + + # copy configuration options + cp -af "${srcdir}/Makefile.config" . + + # make sure to use the correct versions of python and opencv + + if ! grep -q "python${_pythonver}" Makefile.config + then + sed -i "s/python[0-9]*\.[0-9]*/python${_pythonver}/" Makefile.config + fi + + if ! grep -q "boost_python${_pythonmaj}" Makefile.config + then + sed -i "/boost_python[0-9]/s/[0-9]/${_pythonmaj}/" Makefile.config + fi + + if ! grep -q "OPENCV_VERSION[[:space:]]:=[[:space:]]${_opencvmaj}" Makefile.config + then + sed -i "/OPENCV_VERSION/s/[0-9]*$/${_opencvmaj}/" Makefile.config + fi +} + +build() { + cd "${_srcname}-${pkgver}" + + msg2 "Building target 'all'..." + make all + + msg2 "Building target 'pycaffe'..." + make pycaffe + + msg2 "Building target 'docs'..." + rm -rf doxygen + make docs + + msg2 "Building target 'distribute'..." + make distribute +} + +# uncomment this block if you want to run the checks/tests +#check() { +# cd "${_srcname}-${pkgver}" +# msg2 "Building target 'test'..." +# make test +# msg2 "Making target 'runtest'..." +# make runtest +#} + +package() { + local _pythonver + _pythonver="$(python --version | awk '{ print $2 }' | grep -o '^[0-9]*\.[0-9]*')" + + mkdir -p "$pkgdir"/usr/{bin,include,lib/python"$_pythonver"/site-packages,share/doc} + + cd "${_srcname}-${pkgver}/distribute" + + # binaries + install -m755 bin/* "${pkgdir}/usr/bin" + + # library + cp -af lib/libcaffe.so* "${pkgdir}/usr/lib" + chmod 755 "${pkgdir}/usr/lib"/libcaffe.so.*.*.* + + # headers + cp -af include "${pkgdir}/usr" + + # python + install -m755 python/*.py "${pkgdir}/usr/bin" + cp -af python/caffe "${pkgdir}/usr/lib/python${_pythonver}/site-packages" + + # proto + install -D -m644 proto/caffe.proto -t "${pkgdir}/usr/share/caffe" + + cd "${srcdir}/${_srcname}-${pkgver}" + + # docs + cp -af doxygen/html "${pkgdir}/usr/share/doc/${pkgname}" + + # license + install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}" +} |