Opened 8 years ago

Last modified 4 years ago

#12703 closed defect

GLPK fails to build with LTO (`gcc -flto ...`) — at Version 3

Reported by: leif Owned by: leif
Priority: minor Milestone: sage-6.4
Component: packages: standard Keywords: link time optimization nm glpsol spkg upgrade update
Cc: ncohen, SimonKing, tscrim Merged in:
Authors: Leif Leonhardy Reviewers:
Report Upstream: Reported upstream. Developers acknowledge bug. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by leif)

Even the latest upstream version (4.47) fails to build when link-time optimization (LTO, gcc -flto ...) is enabled.

While configure shows an error message, it continues normally and doesn't exit with an error. Only later during the build, a shell syntax error caused by libtool makes the build finally fail. The solution is to re-autotoolize the package with more recent autotools.

I have an spkg with updated autogenerated files which also upgrades GLPK within Sage to the latest stable version, 4.47.

New spkg:

md5sum: 090ee5d398582db531b27e49deab6749 glpk-4.47.p1.spkg

glpk-4.47.p1 (Leif Leonhardy, March 22nd 2012)

  • #12703: Make GLPK work with LTO (gcc -flto ...). Export CPPFLAGS, since sage-env currently *doesn't*.

glpk-4.47.p0 (Leif Leonhardy, March 19th 2012)

  • #12703: Make GLPK work with LTO (gcc -flto ...). This just involves updating the lib- and autotools files, but thereby upgrading to the latest version (4.47) shouldn't hurt either. Note that the src/ directory now isn't vanilla, since upstream hasn't yet fixed the bug (i.e., updated these files). The "real" source files in contrast of course *are*. See "Special Update/Build? Instructions" above on how to update the files of a fresh upstream tarball if necessary.
  • Cleaned up spkg-install and spkg-check (and this file ;-)
  • Running the test suite now uses $MAKE instead of make as well.
  • CPPFLAGS and LDFLAGS no longer get overwritten in spkg-install.

Change History (3)

comment:1 Changed 8 years ago by leif

  • Authors set to Leif Leonhardy
  • Cc ncohen SimonKing added
  • Description modified (diff)
  • Keywords upgrade update added
  • Status changed from new to needs_review

comment:2 Changed 8 years ago by leif

To also motivate the upgrade:

GLPK 4.47 (release date: Sep 09, 2011)

The new API routine glp_intfeas1() was added to the package. This routine is a tentative implementation of the integer (0-1) feasibility solver based on the CNF-SAT solver (which currently is MiniSat). It may be used in the same way as glp_intopt() to find either any integer feasible solution or a solution, for which the objective function is not worse than the specified value. Detailed description of this routine can be found in the document "CNF Satisfiability Problem", which is included in the distribution (see doc/cnfsat.pdf).

The following two options were added to glpsol:

--minisat translate 0-1 feasibility problem to CNF-SAT

problem and solve it with glp_intfeas1()/MiniSat (if the problem instance is already in CNF-SAT format, no translation is performed)

--objbnd bound add inequality obj <= bound (minimization) or

obj >= bound (maximization) to 0-1 feasibility problem (this option assumes --minisat)

The paint-by-numbers puzzle model (pbn.mod) included in the distribution is a nice example of the 0-1 feasibility problem, which can be efficiently solved with glp_intfeas1()/MiniSat. This model along with a brief instruction (pbn.pdf) and benchmark examples from <> encoded in GNU MathProg (*.dat) can be found in subdirectory examples/pbn/.

The glpsol lp/mip solver was modified to bypass postprocessing of MathProg models if the solution reported is neither optimal nor feasible.

A minor bug in examples/ was fixed to correctly build glpk in a separate directory. Thanks to Marco Atzeri <marco.atzeri@…> for bug report and patch.

GLPK 4.46 (release date: Aug 09, 2011)

The following new API routines were added:

glp_read_cnfsat() read CNF-SAT problem data in DIMACS format glp_check_cnfsat() check for CNF-SAT problem instance glp_write_cnfsat() write CNF-SAT problem data in DIMACS format glp_minisat1() solve CNF-SAT problem instance with MiniSat

The routine glp_minisat1() is a driver to MiniSat, a CNF-SAT solver developed by Niklas Een and Niklas Sorensson, Chalmers University of Technology, Sweden. This routine is similar to the routine glp_intopt(), however, it is intended to solve a 0-1 programming problem instance, which is the MIP translation of a CNF-SAT problem instance.

Detailed description of these new API routines can be found in the document "CNF Satisfiability Problem", which is included in the distribution (see files doc/cnfsat.tex and doc/cnfsat.pdf).

The following new glpsol command-line options were added:

--cnf filename read CNF-SAT problem instance in DIMACS

format from filename and translate it to MIP

--wcnf filename write CNF-SAT problem instance in DIMACS

format to filename

--minisat solve CNF-SAT problem instance with MiniSat


The zlib compression library (version 1.2.5) was ANSIfied, modified according to GLPK requirements and included in the distribution as an external software module. Thus, now this feature is platform independent.

Some bugs were fixed in the SQL table driver. Thanks to Xypron <xypron.glpk@…>.

GLPK 4.45 (release date: Dec 05, 2010)

This is a bug-fix release.

Several bugs/typos were fixed. Thanks to Xypron <xypron.glpk@…>, Robbie Morrison <robbie@…>, and Ali Baharev <ali.baharev@…> for reports.

Some glpk documents was re-formatted and merged into a single document. Now the glpk documentation consists of the following three main documents (all included in the distribution):

GLPK: Reference Manual

GLPK: Graph and Network Routines

Modeling Language GNU MathProg: Language Reference

Last edited 8 years ago by leif (previous) (diff)

comment:3 Changed 8 years ago by leif

  • Description modified (diff)

The new p1 spkg fixes a potential error if CPPFLAGS aren't exported. (sage-env currently doesn't export CPPFLAGS, which I assumed it also does.)

Note: See TracTickets for help on using tickets.