Package Details: ggnfs-svn 441-1

Git Clone URL: (read-only, click to copy)
Package Base: ggnfs-svn
Description: GGNFS is an open source implementation of General Number Field Sieve algorithm for factoring integers.
Upstream URL:
Licenses: GPL2
Conflicts: ggnfs
Provides: ggnfs
Submitter: khampf
Maintainer: khampf
Last Packager: khampf
Votes: 3
Popularity: 0.000000
First Submitted: 2016-01-12 22:31 (UTC)
Last Updated: 2016-01-13 20:01 (UTC)

Dependencies (3)

Required by (1)

Sources (3)

Latest Comments

ccorn commented on 2020-12-07 13:22 (UTC)

I have accumulated several changes to the PKGBUILD on my private branch:

  • Add libgmp-static to makedepends, as linking is done with -static.
  • Adaptations for GCC 10. This includes use of -fcommon and changing the declarations of some duplicated inline functions to static.
  • Provide our build flags, but let GGNFS override them. This avoids ExecStack/RELRO/PIE warnings, except for the lasieve executables, which may be due to the assembly parts.
  • Build the PDF documentation. This needs texlive-core in makedepends.
  • Install doc, tests, and contrib stuff.
  • Minor cleanups.

Here is the diff:

@@ -10,10 +10,10 @@ pkgname=('ggnfs-lasieve4e-x86_64-svn' 'ggnfs-svn')
 pkgdesc="GGNFS is an open source implementation of General Number Field Sieve algorithm for factoring integers."
-arch=('i686' 'x86_64')
+makedepends=('subversion' 'libgmp-static' 'texlive-core')
@@ -33,8 +33,21 @@ pkgver() {

 prepare() {
   cd "${srcdir}/${_svnmod}"
-  patch -p1 < "$srcdir/makefile-lasieve4_64.patch"
-  patch -p1 < "$srcdir/lasieve4_64-athlon64-i7.patch"
+  patch -p1 -i "$srcdir/makefile-lasieve4_64.patch"
+  patch -p1 -i "$srcdir/lasieve4_64-athlon64-i7.patch"
+  # Provide our build flags, but let GGNFS-provided build flags override ours.
+  # Still gives ExecStack/RELRO/PIE warnings about the lasieve executables,
+  # although the flags are provided now, except for the assembly parts.
+  CFLAGS+=" -fcommon"
+  sed -i.orig -E \
+    -e "s#-lgmp #/usr/lib/libgmp.a #" \
+    -e "s#-lgmp\$#/usr/lib/libgmp.a#" \
+    -e "s#^ *CFLAGS *= *#&$CFLAGS #" \
+    -e "s#^ *LIBFLAGS *= *#&$LDFLAGS #" \
+    -e 's/^ *GMP_BUG *=/#&/' \
+    $(find src -name Makefile)
+  sed -i.orig -e 's/^inline /static /' \
+    src/fbgen.c src/experimental/lasieve4_64/fbgen.c
   cd "${srcdir}/${_svnmod}/src/experimental/lasieve4_64"
   if [ "$_lasieveL1bits" != "15" ]; then
     echo "Patching asm code for ${_lasieveL1bits}-bit L1 data cache ..."
@@ -45,50 +58,41 @@ prepare() {

 build() {
-  msg "Starting ggnfs-lasieve4e-${CARCH}-svn build..."
   cd "${srcdir}/${_svnmod}/src/experimental/lasieve4_64"
-  msg "Starting ggnfs-svn build..."
   cd "${srcdir}/${_svnmod}"
   make "$_ggnfstarget"
+  cd doc/ggnfs-doc
+  latexmk -pdf ggnfs-doc
+  latexmk -c

 package_ggnfs-lasieve4e-x86_64-svn() {
   pkgdesc="lasieve4e is a lattice siever for GGNFS by Jens Franke and T. Kleinjung."
-  arch=('x86_64')

   cd "${srcdir}/${_svnmod}"
-#  install -D -m755 src/experimental/lasieve4_64/gnfs-lasieve4I1?e "${pkgdir}/usr/bin"
-  install -d -m755 "${pkgdir}/usr/bin"
-  install -D -m755 bin/gnfs-lasieve4I1?e "${pkgdir}/usr/bin"
+  install -D -m755 -t "${pkgdir}/usr/bin" bin/gnfs-lasieve4I1?e

 package_ggnfs-svn() {
-  arch=('i686' 'x86_64')   # select ggnfs target other than nocona
-  optdepends=('gnuplot')
+  optdepends=('gnuplot: For'
+              'bash: For and tests'
+              'make: For tests and contrib stuff'
+              'perl: For factoring scripts')

   cd "${srcdir}/${_svnmod}"
-  install -d -m755 "${pkgdir}/usr/bin"
-  install -D -m755 bin/ "${pkgdir}/usr/bin"
-  install -D -m755 bin/makefb "${pkgdir}/usr/bin"
-  install -D -m755 bin/matbuild "${pkgdir}/usr/bin"
-  install -D -m755 bin/matprune "${pkgdir}/usr/bin"
-  install -D -m755 bin/matsolve "${pkgdir}/usr/bin"
-  install -D -m755 bin/pol51m0b "${pkgdir}/usr/bin"
-  install -D -m755 bin/pol51m0n "${pkgdir}/usr/bin"
-  install -D -m755 bin/pol51opt "${pkgdir}/usr/bin"
-  install -D -m755 bin/polyselect "${pkgdir}/usr/bin"
-  install -D -m755 bin/procrels "${pkgdir}/usr/bin"
-  install -D -m755 bin/sieve "${pkgdir}/usr/bin"
-  install -D -m755 bin/sqrt "${pkgdir}/usr/bin"
+  install -D -m755 -t "${pkgdir}/usr/bin" bin/[^dg]*
+  install -d -m755 "${pkgdir}/usr/share/doc"
+  cp -RT doc "${pkgdir}/usr/share/doc/${pkgname}"
   install -d -m755 "${pkgdir}/usr/share/${pkgname}"
-  install -D -m644 bin/def-nm-params.txt "${pkgdir}/usr/share/${pkgname}"
-  install -D -m644 bin/def-par.txt "${pkgdir}/usr/share/${pkgname}"
+  cp -R bin/def-* contrib tests "${pkgdir}/usr/share/${pkgname}"
+  ln -sfT "../doc/${pkgname}" "${pkgdir}/usr/share/${pkgname}/doc"
+  install -D -m644 -t "${pkgdir}/usr/share/licenses/$pkgname" LICENSE

 # vim:set ts=2 sw=2 et:

ccorn commented on 2020-09-20 12:47 (UTC)

I had to add libgmp-static and gcc9 to makedepends and add CC=gcc-9 to both make invocations to get the package built.

Current gcc 10.2.0 produces linker errors. I first tried -fcommon, but that did not resolve all issues, so I resorted to GCC 9 for building. That is a quick hack; with some more (yet unknown) options it should be possible to get the code built with GCC 10.

vs220 commented on 2018-04-08 09:05 (UTC) (edited on 2018-04-08 09:06 (UTC) by vs220)

olegkyka downgrade gmp -> gmp-5.1.2-1

olegkyka commented on 2018-04-03 13:42 (UTC)

/usr/bin/ld: cannot find -lgmp collect2: ошибка: выполнение ld завершилось с кодом возврата 1 make: *** [Makefile:58: ../../../bin/gnfs-lasieve4I11e] Ошибка 1 ==> ОШИБКА: Произошел сбой в build().