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

Trouble Building #307

Open
keks opened this issue Sep 28, 2023 · 13 comments
Open

Trouble Building #307

keks opened this issue Sep 28, 2023 · 13 comments

Comments

@keks
Copy link

keks commented Sep 28, 2023

Hi,

I am trying to build on Manjaro Linux (basically Arch).

Software versions:

  • GCC 12.3.0
  • Bazel 6.3.2
  • nlopt 2.7.1
  • ibex v2.8.9
  • dreal4 git:945aa82 (latest happy commit in CI)

I first tried building the latest release, which didn't work for multiple reasons. First complained about the @bazel_tools/platforms -> @platforms migration, then about something else. I gave up and I tried building the latest that passes CI.

This is the output of bazel build:

$ CC=gcc-12 bazel build //...
INFO: Analyzed 543 targets (0 packages loaded, 0 targets configured).
INFO: Found 543 targets...
ERROR: /home/keks/studies/aur-package-real-solvers/dreal4/git/dreal4/dreal/util/BUILD.bazel:398:20: Compiling dreal/util/test/box_test.cc failed: (Exit 1): gcc-12 failed: error executing command (from target //dreal/util:box_test) /usr/bin/gcc-12 -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 93 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
dreal/util/test/box_test.cc: In member function 'virtual void dreal::{anonymous}::BoxTest_IsNothrowMoveConstructible_Test::TestBody()':
dreal/util/test/box_test.cc:280:63: error: static assertion failed: Box::Interval should be nothrow_move_constructible.
  280 |   static_assert(is_nothrow_move_constructible<Box::Interval>::value,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
dreal/util/test/box_test.cc:282:69: error: static assertion failed: Box::IntervalVector should be nothrow_move_constructible.
  282 |   static_assert(is_nothrow_move_constructible<Box::IntervalVector>::value,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
dreal/util/test/box_test.cc:284:53: error: static assertion failed: Box should be nothrow_move_constructible.
  284 |   static_assert(is_nothrow_move_constructible<Box>::value,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
INFO: Elapsed time: 51.301s, Critical Path: 36.97s
INFO: 67 processes: 24 internal, 43 linux-sandbox.
FAILED: Build did NOT complete successfully

It seems that this assert has been there for at least 6 years, so I am not sure what the problem is. Any help is appreciated! Once I get it to build I'll be happy to publish/upstream my PKGBUILD file to make building on Arch-based Linux distros easier.

@soonhokong
Copy link
Member

@keks , thanks for the report. I'll take a look.

@soonhokong
Copy link
Member

@keks , can you try this branch of IBEX and see if you can still reproduce this build issue?

https://github.com/dreal-deps/ibex-lib/tree/ibex-2.7.4_15

@keks
Copy link
Author

keks commented Sep 28, 2023

I'll see what I can do. I've been using the cmake build system before to build ibex, and it looks like that branch doesn't support that. Let me see if I can switch to waf.

@soonhokong
Copy link
Member

SGTM. FYI, I'm using CXXFLAGS=-std=c++0x ./waf configure --enable-shared --with-optim --with-solver --with-affine-extended --interval-lib=filib --lp-lib=clp to configure it.

@soonhokong
Copy link
Member

First complained about the @bazel_tools/platforms -> https://github.com/platforms migration

I don't see those warnings when I use bazel-6.3.2. Can you share with me how to reproduce those warnings/errors?

@keks
Copy link
Author

keks commented Sep 28, 2023

SGTM. FYI, I'm using CXXFLAGS=-std=c++0x ./waf configure --enable-shared --with-optim --with-solver --with-affine-extended --interval-lib=filib --lp-lib=clp to configure it.

Thanks, this came just in time, my build without these arguments just failed but now it's chugging along. I'll get back to you when I made more progress.

@keks
Copy link
Author

keks commented Sep 28, 2023

First complained about the @bazel_tools/platforms -> https://github.com/platforms migration

I don't see those warnings when I use bazel-6.3.2. Can you share with me how to reproduce those warnings/errors?

The error happens e.g. here: https://github.com/dreal/dreal4/blame/f50155f02dc39689e244b72c2fa2deb847922980/tools/BUILD#L34C31-L34C31 - the issue is fixed, but not in 4.21.06.02.

The error message pointed me to this issue: bazelbuild/bazel#8622

Do you need the precise error message?

@soonhokong
Copy link
Member

Oh, I see. No worries. I just to release a new version.

@keks
Copy link
Author

keks commented Sep 28, 2023

Using that version seemed to have fixed this issue, thanks!

Looks like I need to package some more dependencies. Ah, fun...

Thank you for your help! If I run into more trouble I'll ask you again, otherwise I'll submit a PKGBUILD to the AUR. I'll try to remember to let you know and leave a note in this repo's documentation.

@soonhokong
Copy link
Member

Great!

@keks
Copy link
Author

keks commented Oct 3, 2023

Hi @soonhokong, I ran into another issue.

I think I have managed to build all dependencies now, I hope they are the right versions. The PKGBUILDS I use are in https://github.com/keks/dreal-pkgbuilds.

The dreal build now fails with

ERROR: /home/keks/studies/dreal-pkgbuilds-clean/dreal4/src/dreal4/dreal/contractor/BUILD.bazel:122:20: Compiling dreal/contractor/test/contractor_ibex_fwdbwd_test.cc failed: (Exit 1): gcc failed: error executing command (from target //dreal/contractor:contractor_ibex_fwdbwd_test) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 122 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
dreal/contractor/test/contractor_ibex_fwdbwd_test.cc: In member function 'virtual void dreal::{anonymous}::ContractorIbexFwdbwdTest_TestSmt2Problem20Lowlevel_Test::TestBody()':
dreal/contractor/test/contractor_ibex_fwdbwd_test.cc:134:15: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
  134 |   const auto& x = ibex::ExprSymbol::new_();
      |               ^
dreal/contractor/test/contractor_ibex_fwdbwd_test.cc:134:41: note: the temporary was destroyed at the end of the full expression 'ibex::ExprSymbol::new_(ibex::Dim::scalar())'
  134 |   const auto& x = ibex::ExprSymbol::new_();
      |                   ~~~~~~~~~~~~~~~~~~~~~~^~
dreal/contractor/test/contractor_ibex_fwdbwd_test.cc:135:15: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
  135 |   const auto& y = ibex::ExprSymbol::new_();
      |               ^
dreal/contractor/test/contractor_ibex_fwdbwd_test.cc:135:41: note: the temporary was destroyed at the end of the full expression 'ibex::ExprSymbol::new_(ibex::Dim::scalar())'
  135 |   const auto& y = ibex::ExprSymbol::new_();
      |                   ~~~~~~~~~~~~~~~~~~~~~~^~
dreal/contractor/test/contractor_ibex_fwdbwd_test.cc:136:15: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
  136 |   const auto& z = ibex::ExprSymbol::new_();
      |               ^
dreal/contractor/test/contractor_ibex_fwdbwd_test.cc:136:41: note: the temporary was destroyed at the end of the full expression 'ibex::ExprSymbol::new_(ibex::Dim::scalar())'
  136 |   const auto& z = ibex::ExprSymbol::new_();
      |                   ~~~~~~~~~~~~~~~~~~~~~~^~
cc1plus: all warnings being treated as errors
INFO: Elapsed time: 35.978s, Critical Path: 32.04s
INFO: 1549 processes: 1460 internal, 89 linux-sandbox.

Any ideas would be much appreciated!

@soonhokong
Copy link
Member

Thanks for the report. I'll take a look and get back to you.

@soonhokong
Copy link
Member

Hi @keks , could you teach me how to reproduce this problem? For instance, I'd like to know the Linux distro that I need to install and the instructions from there.

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