Cbc icon indicating copy to clipboard operation
Cbc copied to clipboard

configure.ac uses AC_COIN* macros... undefined

Open SnarkBoojum opened this issue 3 years ago • 4 comments

Trying to update the Debian package for coinor-cbc to 2.10.6, I'm stuck because configure can't be re-built from the sources, because AC_COIN* macros' definitions are missing.

SnarkBoojum avatar Jan 19 '22 16:01 SnarkBoojum

The macros are all in the BuildTools project here: https://github.com/coin-or-tools/BuildTools. It looks like they were included as part of the source here: https://salsa.debian.org/science-team/coinor-cbc. Technically, the BuildTools is a separately versioned project with its own releases, so when Cbc is updated, the BuildTools version should also be updated to the latest (compatible) release. This should also probably be noted somewhere. The current latest release of BuildTools in the stable that goes along with Cbc 2.10 is 0.8.10.

It looks like the autoreconf is done here by adding --include=BuildTools. I guess that's what you need.

There are a lot of gory details about the BuildTools stable/0.8 in the documentation here: https://github.com/coin-or-tools/BuildTools/tree/stable/0.8/docs (although I just noticed that a lot of the links between pages are broken because they're missing the .md.

tkralphs avatar Jan 20 '22 15:01 tkralphs

Now that I'm looking a bit more closely, the git repo here includes files in the Cbc root directory, which are only needed for the old monolithic builds that include dependencies. For packaging purposes, it is only the Cbc subdirectory that is intended to be distributed and used as source. Long back, we had created a separate source repository containing tarballs with only that subdirectory, specifically for Debian packaging here: https://www.coin-or.org/download/pkgsource/Cbc/.

There are two configure scripts, one in the root directory and one in the Cbc subdirectory. The one in the root directory looks for the dependencies in subdirectories and then recursively builds each of them. This design dates back to the days before pkg-config was established and when we were still using subversion with its externals mechanism to make it easy to check out Cbc with all of its dependencies. Over time, we've modularized everything and the new BuildTools that will come with the next major version of Cbc gets rid of all this. But with 2.10, we are temporarily stuck with it.

But in any case, it is Cbc/configure that matters. The outer one can be called, but effectively doesn't do anything. The new coinbrew script that supplants the subversion externals mechanism and essentially replaces the root configure script to manage the build process only looks in the subdirectories when doing builds. The root directories are ignored.

Hope that all makes sense. I know it's ugly and hacky and we have been slowly working on unwinding it over almost a decade.

tkralphs avatar Jan 20 '22 15:01 tkralphs

FYI, this is true for SYMPHONY as well, I'm sure for the same reason. See, e.g., here.

tkralphs avatar Jan 26 '22 03:01 tkralphs

OK, so I asked the maintainer of one of the other COIN-OR packages and it seems that compiling with -g is standard. This way, the executables produced can be used both in the regular package and the -dbg one that ships with debugging symbols by just stripping the symbols out of the one for the main package. However, it seems to be true that NDEBUG is not being defined, which is the real issue raised by @jjhforrest. Our default set of flags includes -DNDEBUG, but these are being replaced by Debian's default flags. I would guess that there is a way that we're supposed to be indicating in configure.ac that we want NDEBUG defined besides just adding it to our default flags. I guess we're probably doing something non-standard.

tkralphs avatar Jan 26 '22 21:01 tkralphs