diff options
author | Alex Dewar | 2019-05-08 13:59:05 +0100 |
---|---|---|
committer | Alex Dewar | 2019-05-08 13:59:05 +0100 |
commit | 139d7910e4e34b8a7c5eeb6db127f87839844b60 (patch) | |
tree | 2dadc9fac5bca5da1a2b8856e3bff7727668b92d | |
parent | 45dd61644510f022ff097ed7b55f71fbc0eabbb3 (diff) | |
download | aur-139d7910e4e34b8a7c5eeb6db127f87839844b60.tar.gz |
Actually build CUDA backend
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 21 | ||||
-rw-r--r-- | set-CUDA_PATH.patch | 44 |
3 files changed, 53 insertions, 16 deletions
@@ -1,7 +1,7 @@ pkgbase = genn pkgdesc = GeNN: GPU-enhanced neural networks (version 4) pkgver = 4.0.0_RC1 - pkgrel = 2 + pkgrel = 3 url = https://github.com/genn-team/genn arch = x86_64 license = GPL @@ -12,7 +12,7 @@ pkgbase = genn source = https://github.com/genn-team/genn/archive/4.0.0-RC1.tar.gz source = set-CUDA_PATH.patch sha256sums = b94c0b8c05d8525987f9d4279478dd41f68e8d9824cb5344adb5fbe257b38e99 - sha256sums = a42059714b49bb84ec961053507aa4d2f7658b4ecfb059573a43bc101184c33a + sha256sums = 189a47063b408914ac2955ce77a24491aadfd12559397e5061f12f4ceddc2b91 pkgname = genn @@ -1,7 +1,7 @@ # Maintainer: Alex Dewar <a.dewar@sussex.ac.uk> pkgname=genn pkgver=4.0.0_RC1 -pkgrel=2 +pkgrel=3 pkgdesc="GeNN: GPU-enhanced neural networks (version 4)" arch=(x86_64) url="https://github.com/genn-team/genn" @@ -12,23 +12,27 @@ options=(staticlibs !emptydirs) source=("$url/archive/${pkgver//_/-}.tar.gz" "set-CUDA_PATH.patch") sha256sums=('b94c0b8c05d8525987f9d4279478dd41f68e8d9824cb5344adb5fbe257b38e99' - 'a42059714b49bb84ec961053507aa4d2f7658b4ecfb059573a43bc101184c33a') + '189a47063b408914ac2955ce77a24491aadfd12559397e5061f12f4ceddc2b91') prepare() { cd genn-${pkgver//_/-} - # Set install path - sed -i 's|/usr/local|'$pkgdir'/usr|' Makefile + # Set output dir + sed -i "s|/usr/local|$pkgdir/usr|" Makefile # Set CUDA_PATH to correct location on Arch - patch -Np0 < ../set-CUDA_PATH.patch + patch -Nlp0 < ../set-CUDA_PATH.patch + + # Delete tmp files + find . -name '*~' -delete } build() { cd genn-${pkgver//_/-} # Generate documentation with doxygen - ./makedoc + msg2 "Generating documentation" + ./makedoc > /dev/null # Build libgenn.a etc. make @@ -38,9 +42,12 @@ package() { cd genn-${pkgver//_/-} # Install libs and headers - PREFIX="$pkgdir"/usr/ make install + CUDA_PATH=/opt/cuda PREFIX="$pkgdir"/usr/ make cuda install # Install documentation mkdir -p "$pkgdir"/usr/share/genn/documentation cp -rf documentation/html/* "$pkgdir"/usr/share/genn/documentation + + # Copy userproject + cp -R userproject "$pkgdir"/usr/src/genn } diff --git a/set-CUDA_PATH.patch b/set-CUDA_PATH.patch index 0a9b22d176e6..0d5d4b2a2436 100644 --- a/set-CUDA_PATH.patch +++ b/set-CUDA_PATH.patch @@ -1,14 +1,44 @@ --- bin/genn-buildmodel.sh 2019-04-16 17:59:16.000000000 +0100 -+++ bin/genn-buildmodel2.sh 2019-04-30 15:16:07.374193751 +0100 -@@ -70,9 +70,8 @@ ++++ bin/genn-buildmodel.sh.new 2019-05-08 13:40:02.973103666 +0100 +@@ -70,9 +70,10 @@ GENERATOR="$GENERATOR"_coverage fi - + -# If CUDA path isn't set, default to standard path for (at least Ubuntu) Linux systems -# **NOTE** setting CUDA_PATH is a REQUIRED post-installation action when installing CUDA so this shouldn't be required --export CUDA_PATH=${CUDA_PATH-/usr/local/cuda} -+# Set to default path for Arch Linux -+export CUDA_PATH=/opt/cuda - +-export CUDA_PATH=${CUDA_PATH-/usr/local/cuda} ++if [[ -n "$DEBUG" ]]; then ++ # Set to Arch Linux default ++ CUDA_PATH=/opt/cuda ++fi + # generate model code BASEDIR=$(dirname "$0") +--- src/genn/generator/MakefileCUDA 2019-04-16 17:59:16.000000000 +0100 ++++ src/genn/generator/MakefileCUDA.new 2019-05-08 13:44:58.872080590 +0100 +@@ -2,9 +2,9 @@ + BACKEND_NAME :=cuda + BACKEND_NAMESPACE :=CUDA + +-# Check CUDA is present + ifndef CUDA_PATH +- $(error Environment variable CUDA_PATH must be defined) ++ # Set to Arch Linux default ++ CUDA_PATH := /opt/cuda + endif + + # Include common makefile +--- src/spineml/generator/MakefileCUDA 2019-04-16 17:59:16.000000000 +0100 ++++ src/spineml/generator/MakefileCUDA.new 2019-05-08 13:44:14.894583524 +0100 +@@ -3,9 +3,9 @@ + BACKEND_NAMESPACE :=CUDA + GENERATOR_NAME :=spineml_generator_cuda + +-# Check that CUDA path is set + ifndef CUDA_PATH +- $(error Environment variable CUDA_PATH must be defined - this is a required post-installation action when installing CUDA) ++ # Set to Arch Linux default ++ CUDA_PATH := /opt/cuda + endif + + # Include common makefile |