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

Build failure with Clang 15 or later #67

Closed
RyanGlScott opened this issue May 26, 2023 · 1 comment · Fixed by #68
Closed

Build failure with Clang 15 or later #67

RyanGlScott opened this issue May 26, 2023 · 1 comment · Fixed by #68

Comments

@RyanGlScott
Copy link
Contributor

Building libpoly with Clang 15 or later fails due to the -Wunused-but-set-variable warning being triggered, which causes -Werror to fail. To reproduce the error:

$ cd build/

$ CC=~/Software/clang+llvm-15.0.6/bin/clang CXX=~/Software/clang+llvm-15.0.6/bin/clang++ cmake .. 
-- The C compiler identification is Clang 15.0.6
-- The CXX compiler identification is Clang 15.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/ryanglscott/Software/clang+llvm-15.0.6/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/ryanglscott/Software/clang+llvm-15.0.6/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- GMP headers: /usr/include/x86_64-linux-gnu
-- GMP library: /usr/lib/x86_64-linux-gnu/libgmp.so
-- Looking for open_memstream
-- Looking for open_memstream - found
-- Found PythonInterp: /usr/bin/python3.10 (found version "3.10.6") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.10.so (found version "3.10.6") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ryanglscott/Documents/Hacking/Haskell/libpoly/build

$ make -j8
[  1%] Building C object src/CMakeFiles/static_pic_poly.dir/utils/assignment.c.o
[  1%] Building C object src/CMakeFiles/poly.dir/utils/debug_trace.c.o
[  1%] Building C object src/CMakeFiles/static_pic_poly.dir/utils/debug_trace.c.o
[  1%] Building C object src/CMakeFiles/poly.dir/utils/assignment.c.o
[  1%] Building C object src/CMakeFiles/poly.dir/utils/output.c.o
[  2%] Building C object src/CMakeFiles/poly.dir/utils/statistics.c.o
[  2%] Building C object src/CMakeFiles/static_pic_poly.dir/utils/statistics.c.o
[  2%] Building C object src/CMakeFiles/static_poly.dir/utils/debug_trace.c.o
[  3%] Building C object src/CMakeFiles/static_pic_poly.dir/utils/output.c.o
[  4%] Building C object src/CMakeFiles/poly.dir/utils/sign_condition.c.o
[  5%] Building C object src/CMakeFiles/static_pic_poly.dir/utils/sign_condition.c.o
[  5%] Building C object src/CMakeFiles/static_poly.dir/utils/assignment.c.o
[  5%] Building C object src/CMakeFiles/poly.dir/utils/u_memstream.c.o
[  6%] Building C object src/CMakeFiles/poly.dir/number/integer.c.o
[  7%] Building C object src/CMakeFiles/static_pic_poly.dir/utils/u_memstream.c.o
[  7%] Building C object src/CMakeFiles/static_pic_poly.dir/number/integer.c.o
[  7%] Building C object src/CMakeFiles/poly.dir/number/rational.c.o
[  8%] Building C object src/CMakeFiles/poly.dir/number/algebraic_number.c.o
[  8%] Building C object src/CMakeFiles/poly.dir/number/dyadic_rational.c.o
[  9%] Building C object src/CMakeFiles/static_pic_poly.dir/number/rational.c.o
[ 10%] Building C object src/CMakeFiles/static_poly.dir/utils/output.c.o
[ 10%] Building C object src/CMakeFiles/static_poly.dir/utils/statistics.c.o
[ 11%] Building C object src/CMakeFiles/poly.dir/number/value.c.o
[ 11%] Building C object src/CMakeFiles/static_poly.dir/utils/sign_condition.c.o
[ 11%] Building C object src/CMakeFiles/static_pic_poly.dir/number/dyadic_rational.c.o
[ 12%] Building C object src/CMakeFiles/static_poly.dir/utils/u_memstream.c.o
[ 12%] Building C object src/CMakeFiles/static_poly.dir/number/integer.c.o
[ 13%] Building C object src/CMakeFiles/static_pic_poly.dir/number/algebraic_number.c.o
[ 14%] Building C object src/CMakeFiles/static_poly.dir/number/rational.c.o
[ 14%] Building C object src/CMakeFiles/static_poly.dir/number/dyadic_rational.c.o
[ 14%] Building C object src/CMakeFiles/poly.dir/interval/interval.c.o
[ 15%] Building C object src/CMakeFiles/poly.dir/interval/arithmetic.c.o
[ 16%] Building C object src/CMakeFiles/static_poly.dir/number/algebraic_number.c.o
[ 16%] Building C object src/CMakeFiles/static_pic_poly.dir/number/value.c.o
[ 16%] Building C object src/CMakeFiles/static_poly.dir/number/value.c.o
[ 17%] Building C object src/CMakeFiles/static_pic_poly.dir/interval/interval.c.o
[ 18%] Building C object src/CMakeFiles/static_poly.dir/interval/interval.c.o
[ 18%] Building C object src/CMakeFiles/static_poly.dir/interval/arithmetic.c.o
[ 18%] Building C object src/CMakeFiles/poly.dir/variable/variable_db.c.o
[ 19%] Building C object src/CMakeFiles/poly.dir/variable/variable_list.c.o
[ 19%] Building C object src/CMakeFiles/poly.dir/variable/variable_order.c.o
[ 20%] Building C object src/CMakeFiles/static_poly.dir/variable/variable_db.c.o
[ 20%] Building C object src/CMakeFiles/static_pic_poly.dir/interval/arithmetic.c.o
[ 20%] Building C object src/CMakeFiles/static_poly.dir/variable/variable_list.c.o
[ 21%] Building C object src/CMakeFiles/static_pic_poly.dir/variable/variable_db.c.o
[ 21%] Building C object src/CMakeFiles/static_pic_poly.dir/variable/variable_order.c.o
[ 21%] Building C object src/CMakeFiles/static_pic_poly.dir/variable/variable_list.c.o
[ 22%] Building C object src/CMakeFiles/poly.dir/upolynomial/umonomial.c.o
[ 23%] Building C object src/CMakeFiles/static_poly.dir/variable/variable_order.c.o
[ 24%] Building C object src/CMakeFiles/static_pic_poly.dir/upolynomial/umonomial.c.o
[ 24%] Building C object src/CMakeFiles/static_poly.dir/upolynomial/umonomial.c.o
[ 25%] Building C object src/CMakeFiles/static_poly.dir/upolynomial/upolynomial.c.o
[ 25%] Building C object src/CMakeFiles/static_poly.dir/upolynomial/output.c.o
[ 25%] Building C object src/CMakeFiles/static_pic_poly.dir/upolynomial/upolynomial.c.o
[ 26%] Building C object src/CMakeFiles/static_poly.dir/upolynomial/upolynomial_dense.c.o
[ 26%] Building C object src/CMakeFiles/static_poly.dir/upolynomial/bounds.c.o
[ 26%] Building C object src/CMakeFiles/poly.dir/upolynomial/upolynomial.c.o
[ 27%] Building C object src/CMakeFiles/static_pic_poly.dir/upolynomial/output.c.o
[ 27%] Building C object src/CMakeFiles/static_pic_poly.dir/upolynomial/upolynomial_dense.c.o
[ 27%] Building C object src/CMakeFiles/static_poly.dir/upolynomial/gcd.c.o
[ 28%] Building C object src/CMakeFiles/static_poly.dir/upolynomial/factors.c.o
[ 29%] Building C object src/CMakeFiles/poly.dir/upolynomial/output.c.o
[ 29%] Building C object src/CMakeFiles/static_poly.dir/upolynomial/factorization.c.o
[ 29%] Building C object src/CMakeFiles/poly.dir/upolynomial/upolynomial_dense.c.o
[ 30%] Building C object src/CMakeFiles/poly.dir/upolynomial/bounds.c.o
[ 31%] Building C object src/CMakeFiles/static_poly.dir/upolynomial/root_finding.c.o
[ 31%] Building C object src/CMakeFiles/poly.dir/upolynomial/gcd.c.o
[ 32%] Building C object src/CMakeFiles/static_pic_poly.dir/upolynomial/bounds.c.o
[ 32%] Building C object src/CMakeFiles/static_poly.dir/polynomial/monomial.c.o
[ 32%] Building C object src/CMakeFiles/static_pic_poly.dir/upolynomial/gcd.c.o
/home/ryanglscott/Documents/Hacking/Haskell/libpoly/src/upolynomial/factorization.c:1269:7: error: variable 'enabled_count' set but not used [-Werror,-Wunused-but-set-variable]
  int enabled_count = 0;
      ^
1 error generated.
make[2]: *** [src/CMakeFiles/static_poly.dir/build.make:398: src/CMakeFiles/static_poly.dir/upolynomial/factorization.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 33%] Building C object src/CMakeFiles/static_pic_poly.dir/upolynomial/factors.c.o
make[1]: *** [CMakeFiles/Makefile2:256: src/CMakeFiles/static_poly.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 33%] Building C object src/CMakeFiles/static_pic_poly.dir/upolynomial/factorization.c.o
[ 34%] Building C object src/CMakeFiles/poly.dir/upolynomial/factors.c.o
[ 34%] Building C object src/CMakeFiles/poly.dir/upolynomial/factorization.c.o
[ 35%] Building C object src/CMakeFiles/static_pic_poly.dir/upolynomial/root_finding.c.o
[ 35%] Building C object src/CMakeFiles/poly.dir/upolynomial/root_finding.c.o
[ 36%] Building C object src/CMakeFiles/poly.dir/polynomial/monomial.c.o
[ 36%] Building C object src/CMakeFiles/static_pic_poly.dir/polynomial/monomial.c.o
[ 36%] Building C object src/CMakeFiles/poly.dir/polynomial/coefficient.c.o
[ 37%] Building C object src/CMakeFiles/poly.dir/polynomial/output.c.o
/home/ryanglscott/Documents/Hacking/Haskell/libpoly/src/upolynomial/factorization.c:1269:7: error: variable 'enabled_count' set but not used [-Werror,-Wunused-but-set-variable]
  int enabled_count = 0;
      ^
1 error generated.
make[2]: *** [src/CMakeFiles/poly.dir/build.make:398: src/CMakeFiles/poly.dir/upolynomial/factorization.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 38%] Building C object src/CMakeFiles/static_pic_poly.dir/polynomial/coefficient.c.o
[ 38%] Building C object src/CMakeFiles/static_pic_poly.dir/polynomial/output.c.o
/home/ryanglscott/Documents/Hacking/Haskell/libpoly/src/upolynomial/factorization.c:1269:7: error: variable 'enabled_count' set but not used [-Werror,-Wunused-but-set-variable]
  int enabled_count = 0;
      ^
1 error generated.
[ 39%] Building C object src/CMakeFiles/static_pic_poly.dir/polynomial/gcd.c.o
make[2]: *** [src/CMakeFiles/static_pic_poly.dir/build.make:398: src/CMakeFiles/static_pic_poly.dir/upolynomial/factorization.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:204: src/CMakeFiles/poly.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:308: src/CMakeFiles/static_pic_poly.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

This was originally discovered in a CVC5 context in cvc5/cvc5#9265. CVC5 works around the issue by applying the patch in cvc5/cvc5#9266, so a similar fix would likely work here.

@ianamason
Copy link
Member

Might want to update this too @ahmed-irfan

https://github.com/SRI-CSL/homebrew-sri-csl

RyanGlScott added a commit to GaloisInc/what4-solvers that referenced this issue Feb 4, 2024
Among other fixes, this brings in a fix for
SRI-CSL/libpoly#67, which is necessary to allow
`libpoly` to build with Clang 15 or later. This proves essential for building
`libpoly` (and therefore `yices`) on recent `macos-14` GitHub Actions CI
runners.
RyanGlScott added a commit to GaloisInc/what4-solvers that referenced this issue Feb 4, 2024
Among other fixes, this brings in a fix for
SRI-CSL/libpoly#67, which is necessary to allow
`libpoly` to build with Clang 15 or later. This proves essential for building
`libpoly` (and therefore `yices`) on recent `macos-14` GitHub Actions CI
runners.
RyanGlScott added a commit to GaloisInc/what4-solvers that referenced this issue Feb 4, 2024
Among other fixes, this brings in a fix for
SRI-CSL/libpoly#67, which is necessary to allow
`libpoly` to build with Clang 15 or later. This proves essential for building
`libpoly` (and therefore `yices`) on recent `macos-14` GitHub Actions CI
runners.
RyanGlScott added a commit to GaloisInc/what4-solvers that referenced this issue Feb 5, 2024
Among other fixes, this brings in a fix for
SRI-CSL/libpoly#67, which is necessary to allow
`libpoly` to build with Clang 15 or later. This proves essential for building
`libpoly` (and therefore `yices`) on recent `macos-14` GitHub Actions CI
runners.
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

Successfully merging a pull request may close this issue.

2 participants