ampl / mp

An open-source library for mathematical programming
https://mp.ampl.com
Other
229 stars 42 forks source link

Error: expected unqualified-id before numeric constant #108

Closed sagitter closed 8 years ago

sagitter commented 8 years ago

Hi all.

mp-3.1.0 does not compile on Fedora 26 (development branch) with following error:

/builddir/build/BUILD/mp-3.1.0/include/mp/format.h: In member function 'void fmt::internal::ArgFormatterBase<Impl, Char>::visit_char(int)':
/builddir/build/BUILD/mp-3.1.0/include/mp/format.h:1750:20: error: expected unqualified-id before numeric constant
     const unsigned CHAR_WIDTH = 1;
                    ^

GCC 6.2.1 Full build log: http://koji.fedoraproject.org/koji/getfile?taskID=16453533&name=build.log

vitaut commented 8 years ago

Caused by https://github.com/fmtlib/fmt/issues/398.

sagitter commented 8 years ago

Sorry, i don't understand: mp does not require fmt for compiling.

vitaut commented 8 years ago

It includes fmt: https://github.com/ampl/mp/blob/master/include/mp/format.h. @fdabrandao, could you update the fmt version used here?

sagitter commented 8 years ago

Can mp work with fmt from Fedora (that means unbundling format.h from mp).

vitaut commented 8 years ago

The goal is to have mp self-contained, but it's possible to add a macro to control this. I'm no longer working on this project though, just wanted to point out a fix.

fdabrandao commented 8 years ago

Thank you for reporting this issue, @sagitter. And thank you @vitaut for pointing out the fix. I have just updated fmt version to 3.0.1 so the problem should be fixed. It took a lot longer than expected because of a few very long compile errors in code related to ilogcp that appeared with the update.

sagitter commented 8 years ago

Thanks.