madMAx43v3r / chia-plotter

Apache License 2.0
2.28k stars 665 forks source link

error: call to non-‘constexpr’ function ‘long int sysconf(int)’ #1002

Open xorinox opened 2 years ago

xorinox commented 2 years ago

Cannot compile code on Fedora 35, v33 was just fine.

gcc --version gcc (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9) Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

cmake --version cmake version 3.22.2 CMake suite maintained and supported by Kitware (kitware.com/cmake).

make --version GNU Make 4.3 Built for x86_64-redhat-linux-gnu Copyright (C) 1988-2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

git log commit ecec17d25cd547fa4bb64b2eb7455b831c8a2882 (HEAD -> master, origin/master, origin/HEAD) Merge: efa5b2a 70bb67f Author: Max max.wittal@mwittal.de Date: Fri Feb 11 19:27:08 2022 +0100

Merge pull request #988 from risner/stage-option

Add -s stagedir option

[100%] Linking CXX executable runbench In file included from /usr/include/signal.h:328, from /opt/madMAx43v3r/chia-plotter/lib/bls-signatures/src/../contrib/catch/catch.hpp:8034, from /opt/madMAx43v3r/chia-plotter/lib/bls-signatures/src/test.cpp:20: /opt/madMAx43v3r/chia-plotter/lib/bls-signatures/src/../contrib/catch/catch.hpp:10822:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’ 10822 | static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ; | ^~~ In file included from /usr/include/bits/sigstksz.h:24, from /usr/include/signal.h:328, from /opt/madMAx43v3r/chia-plotter/lib/bls-signatures/src/../contrib/catch/catch.hpp:8034, from /opt/madMAx43v3r/chia-plotter/lib/bls-signatures/src/test.cpp:20: /usr/include/unistd.h:640:17: note: ‘long int sysconf(int)’ declared here 640 | extern long int sysconf (int name) THROW; | ^~~ compilation terminated due to -fmax-errors=1. make[2]: [lib/bls-signatures/src/CMakeFiles/runtest.dir/build.make:76: lib/bls-signatures/src/CMakeFiles/runtest.dir/test.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:895: lib/bls-signatures/src/CMakeFiles/runtest.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... [100%] Built target runbench [100%] Linking CXX executable UnitTests_bech32 [100%] Linking CXX executable test_phase_3 [100%] Linking CXX executable test_phase_1 [100%] Built target test_phase_3 [100%] Built target test_phase_1 [100%] Built target UnitTests_bech32 [100%] Linking CXX executable chia_plot_k34 [100%] Linking CXX executable chia_plot [100%] Built target chia_plot_k34 [100%] Built target chia_plot make: [Makefile:136: all] Error 2

compile.log

mthqwork commented 2 years ago

I guess you have tried it with make_release.sh. Had the same issue with it, while building with make_devel.sh worked fine.

nining commented 1 year ago

manual change this file lib/bls-signatures/contrib/catch/catch.hpp : static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ; to static constexpr std::size_t sigStackSize = 32768;

usmn001 commented 7 months ago

This https://github.com/madMAx43v3r/chia-plotter/issues/1002#issuecomment-1219024593 worked for me. Thanks :).