Package Details: lingeling 180517-1

Git Clone URL: https://aur.archlinux.org/lingeling.git (read-only, click to copy)
Package Base: lingeling
Description: A BSP SAT solver derived from Picosat.
Upstream URL: http://fmv.jku.at/lingeling/
Licenses: MIT
Submitter: keenerd
Maintainer: keenerd
Last Packager: keenerd
Votes: 1
Popularity: 0.000000
First Submitted: 2018-01-29 19:20 (UTC)
Last Updated: 2019-04-29 03:39 (UTC)

Latest Comments

xiretza commented on 2021-05-29 20:28 (UTC)

Another one: to be able to use liblgl.a in shared libraries, objects need to be built with -fPIC (this also requires the build flags patches from the previous comment):

diff --git a/PKGBUILD b/PKGBUILD
index de6311d..4ce208a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
 pkgname=lingeling
 pkgver=180517
 _weirdver=bcj-78ebb86
-pkgrel=3
+pkgrel=4
 pkgdesc="A BSP SAT solver derived from Picosat."
 arch=('i686' 'x86_64')
 url="http://fmv.jku.at/lingeling/"
@@ -24,7 +24,7 @@ prepare() {
 build() {
   cd lingeling-$_weirdver-$pkgver
   # --static?  --aiger=<dir>?  --yalsat=<dir>?  --druplig=<dir>?
-  ./configure.sh
+  CFLAGS="$CFLAGS -fPIC" ./configure.sh
   make
 }

xiretza commented on 2021-05-29 19:24 (UTC)

Hey, two fixes/suggestions:

1) The PKGBUILD doesn't install the library header, making it impossible to actually compile anything against it:

diff --git a/PKGBUILD b/PKGBUILD
index 88801c7..1e597d7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
 pkgname=lingeling
 pkgver=180517
 _weirdver=bcj-78ebb86
-pkgrel=1
+pkgrel=2
 pkgdesc="A BSP SAT solver derived from Picosat."
 arch=('i686' 'x86_64')
 url="http://fmv.jku.at/lingeling/"
@@ -31,6 +31,7 @@ package() {
   install -Dm755 treengeling "$pkgdir/usr/bin/treengeling"

   install -Dm644 liblgl.a    "$pkgdir/usr/lib/liblgl.a"
+  install -Dm644 lglib.h     "$pkgdir/usr/include/lglib.h"

   install -Dm644 COPYING     "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
 } 

2) upstream configure/makefile has a bunch of issues related to build flags, which I patched here, but since upstream isn't particularly active, it might be worth adding the patches to the package:

diff --git a/PKGBUILD b/PKGBUILD
index 1e597d7..de6311d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,14 +3,23 @@
 pkgname=lingeling
 pkgver=180517
 _weirdver=bcj-78ebb86
-pkgrel=2
+pkgrel=3
 pkgdesc="A BSP SAT solver derived from Picosat."
 arch=('i686' 'x86_64')
 url="http://fmv.jku.at/lingeling/"
 license=('MIT')
 depends=('glibc')
-source=("http://fmv.jku.at/lingeling/lingeling-$_weirdver-$pkgver.tar.gz")
-md5sums=('38d59b90298c1977039b34e85493f6aa')
+source=("http://fmv.jku.at/lingeling/lingeling-$_weirdver-$pkgver.tar.gz"
+        "buildflags.patch"
+)
+md5sums=('38d59b90298c1977039b34e85493f6aa'
+         'e4c3254f9fb41dce00d8e9bf1d76d868')
+
+prepare() {
+  cd "$pkgname-$_weirdver-$pkgver"
+
+  patch -p1 < "$srcdir/buildflags.patch"
+}

 build() {
   cd lingeling-$_weirdver-$pkgver
diff --git a/buildflags.patch b/buildflags.patch
new file mode 100644
index 0000000..a778871
--- /dev/null
+++ b/buildflags.patch
@@ -0,0 +1,168 @@
+From 6ee48a998784ae450e11afbb9df3e0051a56c20c Mon Sep 17 00:00:00 2001
+From: Xiretza <xiretza@xiretza.xyz>
+Date: Sat, 29 May 2021 20:38:35 +0200
+Subject: [PATCH 1/3] makefile.in: use LDFLAGS for linking instead of CFLAGS
+
+---
+ configure.sh |  9 +++++----
+ makefile.in  | 17 +++++++++--------
+ 2 files changed, 14 insertions(+), 12 deletions(-)
+
+diff --git a/configure.sh b/configure.sh
+index 097f446..30de9a8 100755
+--- a/configure.sh
++++ b/configure.sh
+@@ -191,7 +191,7 @@ then
+ else
+   [ $olevel = none ] && olevel=-O3
+   CFLAGS="$CFLAGS $olevel"
+-  [ $lto = yes ] && CFLAGS="$CFLAGS -flto -fwhole-program"
++  [ $lto = yes ] && { CFLAGS="$CFLAGS -flto -fwhole-program"; LDFLAGS="$LDFLAGS -flto -fwhole-program"; }
+ fi
+ 
+ LIBS="-lm"
+@@ -232,10 +232,10 @@ then
+ fi
+ 
+ [ $chksol = undefined ] && chksol=$check
+-[ $static = yes ] && CFLAGS="$CFLAGS -static"
+-[ $profile = yes ] && CFLAGS="$CFLAGS -pg"
++[ $static = yes ] && LDFLAGS="$LDFLAGS -static"
++[ $profile = yes ] && { CFLAGS="$CFLAGS -pg"; LDFLAGS="$LDFLAGS -pg"; }
+ [ $coverage = yes ] && CFLAGS="$CFLAGS -ftest-coverage -fprofile-arcs"
+-[ $other = none ] || CFLAGS="$CFLAGS $other"
++[ $other = none ] || { CFLAGS="$CFLAGS $other"; LDFLAGS="$LDFLAGS $other"; }
+ [ $log = no ] && CFLAGS="$CFLAGS -DNLGLOG"
+ [ $check = no ] && CFLAGS="$CFLAGS -DNDEBUG"
+ [ $chksol = no ] && CFLAGS="$CFLAGS -DNCHKSOL"
+@@ -272,6 +272,7 @@ rm -f makefile
+ sed \
+   -e "s,@CC@,$CC," \
+   -e "s,@CFLAGS@,$CFLAGS," \
++  -e "s,@LDFLAGS@,$LDFLAGS," \
+   -e "s,@HDEPS@,$HDEPS," \
+   -e "s,@LDEPS@,$LDEPS," \
+   -e "s,@EXTRAOBJS@,$EXTRAOBJS," \
+diff --git a/makefile.in b/makefile.in
+index 4914087..592f029 100644
+--- a/makefile.in
++++ b/makefile.in
+@@ -2,6 +2,7 @@ MAKEFLAGS=-j $(if $(CORES),$(CORES),1)
+ 
+ CC=@CC@
+ CFLAGS=@CFLAGS@
++LDFLAGS=@LDFLAGS@
+ 
+ LIBS=@LIBS@
+ LDEPS=@LDEPS@
+@@ -27,21 +28,21 @@ liblgl.a: lglib.o lglbnr.o lgldimacs.o lglopts.o makefile $(EXTRAOBJS)
+   ranlib $@
+ 
+ lingeling: lglmain.o liblgl.a makefile $(LDEPS)
+-  $(CC) $(CFLAGS) -o $@ lglmain.o -L. -llgl $(LIBS)
++  $(CC) $(LDFLAGS) -o $@ lglmain.o -L. -llgl $(LIBS)
+ plingeling: plingeling.o liblgl.a makefile $(LDEPS)
+-  $(CC) $(CFLAGS) -pthread -o $@ plingeling.o -L. -llgl $(LIBS)
++  $(CC) $(LDFLAGS) -pthread -o $@ plingeling.o -L. -llgl $(LIBS)
+ treengeling: treengeling.o liblgl.a makefile $(LDEPS)
+-  $(CC) $(CFLAGS) -pthread -o $@ treengeling.o -L. -llgl $(LIBS)
++  $(CC) $(LDFLAGS) -pthread -o $@ treengeling.o -L. -llgl $(LIBS)
+ blimc: blimc.o liblgl.a makefile $(AIGER)/aiger.o $(LDEPS)
+-  $(CC) $(CFLAGS) -o $@ blimc.o -L. $(AIGER)/aiger.o -llgl $(LIBS)
++  $(CC) $(LDFLAGS) -o $@ blimc.o -L. $(AIGER)/aiger.o -llgl $(LIBS)
+ ilingeling: ilingeling.o liblgl.a makefile $(LDEPS)
+-  $(CC) $(CFLAGS) -pthread -o $@ ilingeling.o -L. -llgl $(LIBS)
++  $(CC) $(LDFLAGS) -pthread -o $@ ilingeling.o -L. -llgl $(LIBS)
+ lglmbt: lglmbt.o liblgl.a $(LDEPS)
+-  $(CC) $(CFLAGS) -o $@ lglmbt.o -L. -llgl $(LIBS)
++  $(CC) $(LDFLAGS) -o $@ lglmbt.o -L. -llgl $(LIBS)
+ lgluntrace: lgluntrace.o liblgl.a makefile $(LDEPS)
+-  $(CC) $(CFLAGS) -o $@ lgluntrace.o -L. -llgl $(LIBS)
++  $(CC) $(LDFLAGS) -o $@ lgluntrace.o -L. -llgl $(LIBS)
+ lglddtrace: lglddtrace.o liblgl.a makefile $(LDEPS)
+-  $(CC) $(CFLAGS) -o $@ lglddtrace.o -L. -llgl $(LIBS)
++  $(CC) $(LDFLAGS) -o $@ lglddtrace.o -L. -llgl $(LIBS)
+ 
+ lglmain.o: lglmain.c lglib.h makefile
+   $(CC) $(CFLAGS) -c lglmain.c
+-- 
+2.31.1
+
+From ca550e514f91f631f5d7de419dd8d3691a66a421 Mon Sep 17 00:00:00 2001
+From: Xiretza <xiretza@xiretza.xyz>
+Date: Sat, 29 May 2021 21:05:17 +0200
+Subject: [PATCH 2/3] configure.sh: respect CFLAGS from environment
+
+---
+ configure.sh | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/configure.sh b/configure.sh
+index 30de9a8..b9035e2 100755
+--- a/configure.sh
++++ b/configure.sh
+@@ -183,14 +183,19 @@ fi
+ 
+ [ x"$CC" = x ] && CC=gcc
+ 
+-CFLAGS="-Wall"
++CFLAGS="$CFLAGS -Wall"
+ if [ $debug = yes ]
+ then
+   CFLAGS="$CFLAGS -g3"
+   [ $olevel = none ] || CFLAGS="$CFLAGS $olevel"
+ else
+-  [ $olevel = none ] && olevel=-O3
+-  CFLAGS="$CFLAGS $olevel"
++  case "$CFLAGS" in
++    *-O*) ;;
++    *)
++      [ $olevel = none ] && olevel=-O3
++      CFLAGS="$CFLAGS $olevel"
++      ;;
++  esac
+   [ $lto = yes ] && { CFLAGS="$CFLAGS -flto -fwhole-program"; LDFLAGS="$LDFLAGS -flto -fwhole-program"; }
+ fi
+ 
+-- 
+2.31.1
+
+From 0d5b7a35f7cd010eba1038ad702511445aeca179 Mon Sep 17 00:00:00 2001
+From: Xiretza <xiretza@xiretza.xyz>
+Date: Sat, 29 May 2021 21:12:02 +0200
+Subject: [PATCH 3/3] configure.sh: allow commas in build flags
+
+---
+ configure.sh | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/configure.sh b/configure.sh
+index b9035e2..8c7cf1a 100755
+--- a/configure.sh
++++ b/configure.sh
+@@ -275,13 +275,13 @@ echo "$CC $CFLAGS"
+ 
+ rm -f makefile
+ sed \
+-  -e "s,@CC@,$CC," \
+-  -e "s,@CFLAGS@,$CFLAGS," \
+-  -e "s,@LDFLAGS@,$LDFLAGS," \
+-  -e "s,@HDEPS@,$HDEPS," \
+-  -e "s,@LDEPS@,$LDEPS," \
+-  -e "s,@EXTRAOBJS@,$EXTRAOBJS," \
+-  -e "s,@AIGERTARGETS@,$AIGERTARGETS," \
+-  -e "s,@AIGER@,$AIGER," \
+-  -e "s,@LIBS@,$LIBS," \
++  -e "s#@CC@#$CC#" \
++  -e "s#@CFLAGS@#$CFLAGS#" \
++  -e "s#@LDFLAGS@#$LDFLAGS#" \
++  -e "s#@HDEPS@#$HDEPS#" \
++  -e "s#@LDEPS@#$LDEPS#" \
++  -e "s#@EXTRAOBJS@#$EXTRAOBJS#" \
++  -e "s#@AIGERTARGETS@#$AIGERTARGETS#" \
++  -e "s#@AIGER@#$AIGER#" \
++  -e "s#@LIBS@#$LIBS#" \
+   makefile.in > makefile
+-- 
+2.31.1
+