Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 16.04 has Boost 1.58, but the required boost::unit_test::data is part of Boost >= 1.59 #3

Closed
marnix opened this issue Apr 9, 2018 · 7 comments

Comments

@marnix
Copy link

marnix commented Apr 9, 2018

The addition of boost::unit_test::data, for xrange (see diff 673f7de#diff-041c9b3c31d7bf42b4e96a5bf35622dfR11) broke the build on Ubuntu 16.04:

g++ -c -m64 -pipe -g -ftemplate-backtrace-limit=0 -Og -std=c++1y -Wall -W -fPIC -DPROJ_DIR="\"/home/marnix/projects/mmpp\"" -DUSE_MICROHTTPD -DUSE_Z3 -I../../mmpp -I. -isystem /usr/include/p11-kit-1 -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -o unification.o ../old/unification.cpp
In file included from ../old/unification.cpp:10:0:
../../mmpp/test/test.h:12:61: fatal error: boost/test/data/monomorphic/generators/xrange.hpp: No such file or directory
compilation terminated.
Makefile:614: recipe for target 'unification.o' failed
make: *** [unification.o] Error 1

At least my system has packages libboost-test1.58-dev and libboost-test1.58.0 for boost::unit_test.

And boost::unit_test::data was added in 1.59, it looks like. (I deduce that from the phrase "data driven test cases" under the 'Boost.Test v3' heading in the Boost 1.59 release notes, together with the 1.59.0 documentation.)

@marnix marnix changed the title Ubuntu 16.04 has Boost 1.58, but boost::unit_test::data requires Boost >= 1.59 Ubuntu 16.04 has Boost 1.58, but the required boost::unit_test::data is part of Boost >= 1.59 Apr 9, 2018
@giomasce
Copy link
Owner

giomasce commented Apr 9, 2018

For the moment xrange is not very used, so the easiest thing is just to work around it. I will push a commit soon. Thanks for reporting!

@giomasce
Copy link
Owner

giomasce commented Apr 9, 2018

Commit pushed, but I do not have an environment to check. Please reopen if the bug is still there.

@marnix
Copy link
Author

marnix commented Apr 10, 2018

Thanks for that fast response! I'm afraid it is not just xrange, though: it is all uses of boost::unit_test::data and boost/test/data that fail with Boost 1.58.

With that additional commit I now see multiple files failing to compile on test_case.hpp:

g++ -c -m64 -pipe -g -ftemplate-backtrace-limit=0 -Og -std=c++1y -Wall -W -fPIC -DPROJ_DIR="\"/home/marnix/projects/mmpp\"" -DUSE_MICROHTTPD -DUSE_Z3 -I../../mmpp -I. -isystem /usr/include/p11-kit-1 -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -o unification.o ../old/unification.cpp
In file included from ../old/unification.cpp:10:0:
../../mmpp/test/test.h:12:41: fatal error: boost/test/data/test_case.hpp: No such file or directory
compilation terminated.
Makefile:614: recipe for target 'unification.o' failed
make: *** [unification.o] Error 1

So to support Boost 1.58 you would probably have to changes all of the following :-( :

$ grep -E -R 'unit_test::data|boost/test/data' ..
../test/test_minor.cpp:BOOST_DATA_TEST_CASE(test_compressed_decoder_encoder, boost::unit_test::data::make(test_enc) ^ boost::unit_test::data::make(test_dec), enc, dec) {
../test/test_parsing.cpp:BOOST_DATA_TEST_CASE(test_unification, boost::unit_test::data::make(unification_data)) {
../test/test_wff.cpp:BOOST_DATA_TEST_CASE(test_type_proving, boost::unit_test::data::make(type_proving_data)) {
../test/test_wff.cpp:BOOST_DATA_TEST_CASE(test_wff_type_prover, boost::unit_test::data::make(wff_data), trivially_true, trivially_false, actually_true, wff) {
../test/test_wff.cpp:BOOST_DATA_TEST_CASE(test_wff_truth_prover, boost::unit_test::data::make(wff_data), trivially_true, trivially_false, actually_true, wff) {
../test/test_wff.cpp:BOOST_DATA_TEST_CASE(test_wff_falsity_prover, boost::unit_test::data::make(wff_data), trivially_true, trivially_false, actually_true, wff) {
../test/test_wff.cpp:BOOST_DATA_TEST_CASE(test_wff_adv_truth_prover, boost::unit_test::data::make(wff_data), trivially_true, trivially_false, actually_true, wff) {
../test/test_wff.cpp:BOOST_DATA_TEST_CASE(test_wff_minisat_prover, boost::unit_test::data::make(wff_data), trivially_true, trivially_false, actually_true, wff) {
../test/test_wff.cpp:BOOST_DATA_TEST_CASE(test_wff_from_pt, boost::unit_test::data::make(wff_from_pt_data)) {
../test/test.h:#include <boost/test/data/test_case.hpp>
../test/test.h:#include <boost/test/data/monomorphic.hpp>
../provers/z3prover.cpp:BOOST_DATA_TEST_CASE(test_wff_minisat_prover, boost::unit_test::data::make(range3), i) {

Removing all of those is probably going in the wrong direction...


Suggestion: What if compiling/running the tests could be optional?

@marnix
Copy link
Author

marnix commented Apr 10, 2018

(Note that I cannot reopen this issue, by GitHub's design, see https://stackoverflow.com/a/21333938/223837 and isaacs/github#583.)

@giomasce
Copy link
Owner

Oh yes, you are right. It is probably better to disable the tests, which should not be a big burden, since I have to do that for Windows anyway.

@giomasce giomasce reopened this Apr 10, 2018
@giomasce
Copy link
Owner

I had another try. Now you can disable all tests by changing DISABLE_TESTS to true in mmpp.pro. Can you confirm it works? Thanks again.

@marnix
Copy link
Author

marnix commented Apr 11, 2018

I have good and bad news. The good news is that this issue has now been resolved: compilation on Ubuntu 16.04 / xenial with Boost 1.58 no longer fails with DISABLE_TESTS set to true.

The bad news is that compilation now fails elsewhere for me, on something that seems related to C++11 vs C++14. I'm still looking into that, and will log an issue probably soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants