diff options
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | Makefile.config | 12 | ||||
-rw-r--r-- | PKGBUILD | 48 |
3 files changed, 20 insertions, 46 deletions
@@ -1,8 +1,8 @@ pkgbase = caffe-cuda pkgdesc = A deep learning framework made with expression, speed, and modularity in mind (with cuda) pkgver = 1.0 - pkgrel = 4 - url = http://caffe.berkeleyvision.org/ + pkgrel = 5 + url = https://caffe.berkeleyvision.org/ arch = x86_64 license = BSD makedepends = gcc7 @@ -46,7 +46,7 @@ pkgbase = caffe-cuda source = caffe-cuda-1.0.tar.gz::https://github.com/BVLC/caffe/archive/1.0.tar.gz source = Makefile.config sha256sums = 71d3c9eb8a183150f965a465824d01fe82826c22505f7aa314f700ace03fa77f - sha256sums = c61207ffea4ade927ce66a980f44732c1c2f9b82c500d51e687f5bcf773a4465 + sha256sums = 40d725152bc78326ed230ab9598dc0aec90764cc82b66631ed6d2594ea7d7ae5 pkgname = caffe-cuda diff --git a/Makefile.config b/Makefile.config index 901d7c88b680..e82b03357ff4 100644 --- a/Makefile.config +++ b/Makefile.config @@ -1,8 +1,12 @@ +_PYVER := $(shell python -c 'import sys; print("%s.%s" %sys.version_info[0:2])') +_PYMAJ := $(shell python -c 'import sys; print("%s" %sys.version_info[0])') +_OCVMAJ := $(shell opencv_version | awk -F'.' '{ print $1 }') + USE_CUDNN := 1 USE_OPENCV := 1 USE_LEVELDB := 1 USE_LMDB := 1 -OPENCV_VERSION := 3 +OPENCV_VERSION := $(_OCVMAJ) CUSTOM_CXX := g++-7 CUDA_DIR := /opt/cuda CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \ @@ -17,9 +21,9 @@ CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \ 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_LIBRARIES := boost_python$(_PYMAJ) python$(_PYVER)m +PYTHON_INCLUDE := /usr/include/python$(_PYVER)m \ + /usr/lib/python$(_PYVER)/site-packages/numpy/core/include PYTHON_LIB := /usr/lib WITH_PYTHON_LAYER := 1 INCLUDE_DIRS := $(PYTHON_INCLUDE) @@ -3,10 +3,10 @@ pkgname=caffe-cuda _srcname=caffe pkgver=1.0 -pkgrel=4 +pkgrel=5 pkgdesc='A deep learning framework made with expression, speed, and modularity in mind (with cuda)' arch=('x86_64') -url='http://caffe.berkeleyvision.org/' +url='https://caffe.berkeleyvision.org/' license=('BSD') depends=( # official repositories: @@ -28,38 +28,10 @@ conflicts=('caffe') source=("${pkgname}-${pkgver}.tar.gz"::"https://github.com/BVLC/caffe/archive/${pkgver}.tar.gz" 'Makefile.config') sha256sums=('71d3c9eb8a183150f965a465824d01fe82826c22505f7aa314f700ace03fa77f' - 'c61207ffea4ade927ce66a980f44732c1c2f9b82c500d51e687f5bcf773a4465') + '40d725152bc78326ed230ab9598dc0aec90764cc82b66631ed6d2594ea7d7ae5') 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 + cp -af "${srcdir}/Makefile.config" "${srcdir}/${_srcname}-${pkgver}" } build() { @@ -70,18 +42,16 @@ build() { make docs distribute } -# uncomment this block if you want to run the checks/tests -#check() { -# cd "${_srcname}-${pkgver}" -# make test -# make runtest -#} +check() { + cd "${_srcname}-${pkgver}" + make test runtest +} package() { cd "${_srcname}-${pkgver}/distribute" local _pythonver - _pythonver="$(python --version | awk '{ print $2 }' | grep -o '^[0-9]*\.[0-9]*')" + _pythonver="$(python -c 'import sys; print("%s.%s" %sys.version_info[0:2])')" mkdir -p "$pkgdir"/usr/{bin,include,lib/python"$_pythonver"/site-packages,share/doc} |