[coin-or-lemon] Enable LP and MIP solvers

amluto amluto at fedoraproject.org
Mon Jun 9 20:09:27 UTC 2014


commit 97e99333deaaa8b15c77d3244832cb45ffb05799
Author: Andy Lutomirski <luto at amacapital.net>
Date:   Mon Jun 9 13:04:11 2014 -0700

    Enable LP and MIP solvers

 coin-or-lemon.spec         |   17 ++++++++++++-----
 lemon-1.3-lp-linkage.patch |   21 +++++++++++++++++++++
 2 files changed, 33 insertions(+), 5 deletions(-)
---
diff --git a/coin-or-lemon.spec b/coin-or-lemon.spec
index 59fcc55..4719832 100644
--- a/coin-or-lemon.spec
+++ b/coin-or-lemon.spec
@@ -1,6 +1,6 @@
 Name:           coin-or-lemon
 Version:        1.3
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        A C++ template library providing many common graph algorithms
 
 License:        Boost and BSD
@@ -10,7 +10,10 @@ Source0:        http://lemon.cs.elte.hu/pub/sources/lemon-%{version}.tar.gz
 # Fix for upstream bug #476, needed for tests to pass.
 Patch0:         lemon-1.3-tsp_test-1ba759c76810.patch
 
-BuildRequires:  cmake
+# Fix for upstream bug #481, needed to link LP solvers
+Patch1:         lemon-1.3-lp-linkage.patch
+
+BuildRequires:  cmake coin-or-Clp-devel coin-or-Cbc-devel glpk-devel
 
 # We need to force a soname, because upstream doesn't provide one.  See:
 # http://lemon.cs.elte.hu/trac/lemon/ticket/482
@@ -52,6 +55,7 @@ The %{name}-doc package contains a %{name}'s API documentation.
 %prep
 %setup -q -n lemon-%{version}
 %patch0 -p1
+%patch1 -p1
 
 # Force a soname
 sover_prefix="SET_TARGET_PROPERTIES(lemon PROPERTIES OUTPUT_NAME emon"
@@ -61,13 +65,13 @@ sed -i -e "s/${sover_prefix})/${sover_prefix} VERSION %{libemon_soversion} SOVER
 
 %build
 
-# We can't easily build using GLPK (#481), CPLEX (aka ILOG) is non-free,
-# and the COIN requisites aren't packaged, so turn them all off.
+# CPLEX (aka ILOG) and SOPLEX are non-free, so don't try to detect them.
 #
 # We suppress detection of ghostscript, doxygen, and python to make
 # the build behave the same way with and without them installed -- we
 # don't actually need them, since we don't need to rebuild the docs.
-%cmake -DLEMON_ENABLE_GLPK=NO -DLEMON_ENABLE_ILOG=NO -DLEMON_ENABLE_COIN=NO \
+%cmake -DLEMON_ENABLE_GLPK=YES -DLEMON_ENABLE_ILOG=NO -DLEMON_ENABLE_COIN=YES \
+    -DLEMON_ENABLE_SOPLEX=no \
     -DGHOSTSCRIPT_EXECUTABLE= -DDOXYGEN_EXECUTABLE= -DPYTHON_EXECUTABLE=
 
 make %{?_smp_mflags}
@@ -125,6 +129,9 @@ mv %{buildroot}/%{_datadir}/lemon %{buildroot}/%{_datadir}/%{name}
 
 
 %changelog
+* Mon Jun 09 2014 Andy Lutomirski <luto at mit.edu> - 1.3-5
+- Enable GLPK, Clp, and Cbc.
+
 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.3-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
 
diff --git a/lemon-1.3-lp-linkage.patch b/lemon-1.3-lp-linkage.patch
new file mode 100644
index 0000000..bf5a634
--- /dev/null
+++ b/lemon-1.3-lp-linkage.patch
@@ -0,0 +1,21 @@
+--- lemon-1.3/lemon/CMakeLists.txt.orig	2014-06-09 12:31:38.849953902 -0700
++++ lemon-1.3/lemon/CMakeLists.txt	2014-06-09 12:56:17.414366025 -0700
+@@ -59,6 +59,18 @@
+   SET_TARGET_PROPERTIES(lemon PROPERTIES OUTPUT_NAME emon)
+ ENDIF()
+ 
++IF(LEMON_HAVE_GLPK)
++  TARGET_LINK_LIBRARIES(lemon ${GLPK_LIBRARIES})
++ENDIF()
++
++IF(LEMON_HAVE_CLP)
++  TARGET_LINK_LIBRARIES(lemon ${COIN_CLP_LIBRARIES})
++ENDIF()
++
++IF(LEMON_HAVE_CBC)
++  TARGET_LINK_LIBRARIES(lemon ${COIN_CBC_LIBRARIES})
++ENDIF()
++
+ INSTALL(
+   TARGETS lemon
+   ARCHIVE DESTINATION lib


More information about the scm-commits mailing list