summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndlessEden2021-08-21 12:41:50 +1000
committerEndlessEden2021-08-21 12:41:50 +1000
commit97968e2b4afdbe65e19089ef2deeed1787468a61 (patch)
tree649c30c960c8a17fa965dc414fecefb366894a1b
parentb7c433cce15a87b65d101588c3761100901c8664 (diff)
downloadaur-97968e2b4afdbe65e19089ef2deeed1787468a61.tar.gz
Added proper cuda supper and testing support(cuda only)
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD27
2 files changed, 33 insertions, 9 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a0a83470720f..de1162ed3e39 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,15 +1,24 @@
pkgbase = ethash-lib
- pkgdesc = C/C++ implementation of Ethash – the Ethereum Proof of Work algorithm
+ pkgdesc = C/C++ implementation of Ethash – the Ethereum Proof of Work algorithm.
pkgver = 0.7.0
pkgrel = 1
url = https://github.com/chfast/ethash
- arch = any
+ arch = x86_64
+ arch = i386
+ arch = i686
+ arch = pentium4
+ arch = core2
+ arch = armv6h
+ arch = armv7h
+ arch = armv8h
+ arch = armv9h
+ arch = arm64
license = GPL3
makedepends = cmake
makedepends = gcc10
makedepends = perl
makedepends = python
- makedepends = git
+ makedepends = gzip
provides = ethash
provides = ethash-lib
conflicts = ethash
diff --git a/PKGBUILD b/PKGBUILD
index b75f37cbb720..8e19163b843b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,17 +4,27 @@ pkgname=ethash-lib
_pkgname=ethash
pkgver=0.7.0
pkgrel=1
-pkgdesc="C/C++ implementation of Ethash – the Ethereum Proof of Work algorithm"
-arch=('any')
+pkgdesc="C/C++ implementation of Ethash – the Ethereum Proof of Work algorithm."
+arch=('x86_64' 'i386' 'i686' 'pentium4' 'core2' 'armv6h' 'armv7h' 'armv8h' 'armv9h' 'arm64')
url="https://github.com/chfast/ethash"
license=('GPL3')
-makedepends=('cmake' 'gcc10' 'perl' 'python' 'git')
+makedepends=('cmake' 'gcc10' 'perl' 'python' 'gzip')
provides=("$_pkgname" "$pkgname")
conflicts=("$_pkgname" "$pkgname" "$_pkgname-git" "$pkgname-git")
source=($_pkgname.tar.gz::"$url/archive/refs/tags/v$pkgver.tar.gz")
md5sums=('935ccbc1ba5f9113cc005b4aad8f068b')
sha256sums=('2cd202e2596cf0e6492fe1d866d537ae41bff62107f577d8d793d5e858173149')
options=(!ccache)
+export cuda=0 # change this to cuda=1 if you want to build with cuda.
+
+if [ "$cuda" -gt "0" ]; then
+ export cudaopts="-DCMAKE_C_COMPILER=/opt/cuda/bin/gcc -DCMAKE_CXX_COMPILER=/opt/cuda/bin/g++"
+ echo "Cuda Superpowers Enabled."
+ makedepends+=('cuda')
+else
+ export cudaopts='-DETHASH_BUILD_TESTS=OFF'
+fi
+
prepare() {
cd "$srcdir"
@@ -32,13 +42,18 @@ build () {
rm -r build
fi
mkdir build && cd build
+
+ if [ $cuda -gt "0" ]; then
+ echo "Building with Cuda"
+ fi
- cmake \
+ cmake .. \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_INSTALL_SBINDIR="bin" \
-DETHASH_NATIVE=ON \
- -DETHASH_BUILD_TESTS=OFF \
- -DNATIVE=ON ..
+ -DNATIVE=ON \
+ $cudaopts
+
# cmake --build .. # BUGGED!
make
}