summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorSimone Cimarelli2021-08-15 15:53:51 +0200
committerSimone Cimarelli2021-08-15 15:53:51 +0200
commit9f1fe7ec9635bd1e6392a499729325a26aa714d3 (patch)
treedf2a36c879bc60c90f8f7bdf4778771dad414e7c /PKGBUILD
parent76f5d9cd92de5621d199978ac735cea37c65acad (diff)
downloadaur-9f1fe7ec9635bd1e6392a499729325a26aa714d3.tar.gz
Set -march=native to appease build system
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD28
1 files changed, 25 insertions, 3 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 1326e6362973..afcbb4b83b28 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,9 +5,9 @@
_pkg=cado-nfs
pkgname=${_pkg}-git
pkgver=20210806.c5b20eac1
-pkgrel=1
+pkgrel=2
pkgdesc="Implementation of the Number Field Sieve (NFS) algorithm for factoring integers"
-arch=('i686' 'pentium4' 'x86_64')
+arch=('x86_64')
url="http://cado-nfs.gforge.inria.fr/"
license=('LGPL2')
# We configure with optional curl, hwloc, gmp-ecm.
@@ -22,6 +22,22 @@ provides=('cado-nfs')
source=("git+https://gitlab.inria.fr/cado-nfs/${_pkg}.git")
md5sums=('SKIP')
+# Need -march for SIMD support. Makes the resulting package less portable.
+_march=native
+
+_update_march()
+{
+ local flags_no_march=''
+
+ for f in $1; do
+ if ! [[ "$f" =~ -march=.* ]]; then
+ flags_no_march+=" $f"
+ fi
+ done
+
+ echo "${flags_no_march} -march=$_march"
+}
+
pkgver() {
cd "$_pkg"
git log -1 --format="%cd.%h" --date=short | sed 's/-//g'
@@ -29,6 +45,11 @@ pkgver() {
build() {
cd "$_pkg"
+
+ CFLAGS="$(_update_march "$CFLAGS")"
+ CPPFLAGS="$(_update_march "$CPPFLAGS")"
+ CXXFLAGS="$(_update_march "$CXXFLAGS")"
+
cat <<EOF >local.sh
PREFIX=/usr
HWLOC=$PREFIX
@@ -37,7 +58,8 @@ CURL=$PREFIX
# Remove 32-bit barriers to big factorizations
FLAGS_SIZE="-DSIZEOF_P_R_VALUES=8 -DSIZEOF_INDEX=8"
EOF
- make CFLAGS="$CFLAGS -march=x86-64-v4" CPPFLAGS="$CPPFLAGS -march=x86-64-v4"
+
+ make
}
package() {