Closed maxamsler closed 7 months ago
Dear @maxamsler,
I am not able to reproduce the build failures with gcc 13.2
Which linux distribution are you building on?
Hi @maxamsler,
I was able to reproduce your problem on arch linux x86 with gcc 13.2. Indeed the include statement is not only missing in the random_generator.hpp
but also in one of h5 package header files! So as a hotfix you can add the include statement in
triqs/c++/triqs/mc_tools/random_generator.hpp
and
triqs/build/deps/h5_src/c++/h5/object.hpp
Note that triqs will automatically pull the h5 src when running cmake / make. So run it once until you hit the error and then fix the source file.
After adding these two includes I was able to compile with gcc 13.2.1 and all tests are passing. Let me know if that solves your problem.
I will push a fix to the unstable branch later today and we will run it through the CI first before applying it to 3.2.x.
Best, Alex
@maxamsler Can you confirm that the first issue is resolved for you?
The second issue you point out looks to be unrelated to triqs, but rather like a standard library issue. Are you still seeing this problem?
@Wentzell and @the-hampel, I can confirm that the first issue was indeed fixed with the relevant commits. Thanks a lot!
The second error however still persists. I am on Red Hat Enterprise Linux 8.5. I also tried to compile with GCC 12.3.0 with the same outcome.
Hi @maxamsler, we are having trouble reproducing the error here. Could you please compile triqs in verbose mode:
VERBOSE=1 make -j1
(make sure to compile from scratch with make clean
beforehand) and attach the full output, i.e. store the output in a file and upload?
The problem is quite certainly not in TRIQS and rather in some external library that your compiler tries to use.
Hi @the-hampel , Thanks for your help. I think I found the issue. Following your advice I checked all libraries, and I installed the latest Boost libraries (1.83.0), which solved the problem! Previously I was using 1.73.0. I was under the impression that minimum required is 1.53.x.
The tests are running mostly (3 failing, currently investigating the issues there):
99% tests passed, 3 tests failed out of 277
Total Test time (real) = 145.45 sec
The following tests FAILED:
245 - py_gf_init (SEGFAULT)
251 - py_gf_dlr (SEGFAULT)
275 - py_g_k_iw (SEGFAULT)
Ah interesting, In ubuntu 22.04 we are using Boost 1.74 in the testing CI, which works fine. I checked the changelog of boost (https://www.boost.org/users/history/version_1_74_0.html) but could not find anything related. But maybe they changed something. The is_move_constructible
functionality etc. was part of boost (I think). So maybe newer compilers have problems with old boost versions. I will try to test an older boost version and change the official requirement. Those things are always hard to find, glad it works now.
@Wentzell I propose to just raise the boost requirement to ver 1.74 , since this is the boost version shipped with Ubuntu 22.04. The version was released over 3 years ago. I think it is unnecessary to find out if older versions are supported at this point.
@the-hampel I checked explicitly the bessel function include with gcc 13.2 and boost version 1.73, see https://godbolt.org/z/65xEc6jTM
It compiles without Problems.
Okay yes I can confirm this. I build now triqs 3.2.x successfully on Ubuntu 23.10, gcc-13.2 python-3.11, boost-1.73 with all tests passing. Relevant cmake output:
Installation directory will be /triqs
The C compiler identification is GNU 13.2.0
The CXX compiler identification is GNU 13.2.0
...
-------- Python detection -------------
Python interpreter /.venv/py311/bin/python3
Python interpreter and modules are ok : version 3.11.6
PYTHON_INCLUDE_DIRS = /usr/include/python3.11
PYTHON_NUMPY_INCLUDE_DIR = /.venv/py311/lib/python3.11/site-packages/numpy/core/include
PYTHON_NUMPY_VERSION = 1.26.2
PYTHON_SITE_PKG = /.venv/py311/lib/python3.11/site-packages
PYTHON_LIBRARY = /usr/lib/x86_64-linux-gnu/libpython3.11.so
...
-------- MPI detection -------------
Found MPI_CXX: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so (found version "3.1")
Found MPI: TRUE (found version "3.1") found components: CXX
Found OpenMP_CXX: -fopenmp (found version "4.5")
Found OpenMP: TRUE (found version "4.5") found components: CXX
...
=============== Configuring Dependency nda ===============
...
-------- Lapack detection -------------
Found BLAS: /usr/lib/x86_64-linux-gnu/libopenblas.so
Found LAPACK: /usr/lib/x86_64-linux-gnu/libopenblas.so;/usr/lib/x86_64-linux-gnu/libopenblas.so
...
-------- Boost detection -------------
Found Boost: /usr/local/include (found suitable version "1.73.0", minimum required is "1.53")
Boost include dir: /usr/local/include
...
I am not sure what went wrong in your case @maxamsler . Since I have a working setup right now I will try no with the minimum 1.53 to check if the requirement is still good on the doc. I will share my dockerfile to build later.
So I tried now and boost version 1.63 is the oldest version that still works with gcc 13.2. For earlier versions I get:
In file included from /usr/local/include/boost/format/alt_sstream.hpp:173,
from /usr/local/include/boost/format/internals.hpp:23,
from /usr/local/include/boost/format.hpp:38,
from /usr/local/include/boost/math/policies/error_handling.hpp:31,
from /usr/local/include/boost/math/special_functions/gamma.hpp:23,
from /usr/local/include/boost/math/special_functions/detail/bessel_jy.hpp:14,
from /usr/local/include/boost/math/special_functions/bessel.hpp:20,
from /source/triqs.src/c++/triqs/utility/legendre.cpp:20:
/usr/local/include/boost/format/alt_sstream_impl.hpp: In instantiation of 'boost::io::basic_altstringbuf<Ch, Tr, Alloc>::int_type boost::io::basic_altstringbuf<Ch, Tr, Alloc>::overflow(int_type) [with Ch = char; Tr = std::char_traits<char>; Alloc = std::allocator<char>; int_type = i
/usr/local/include/boost/format/alt_sstream_impl.hpp:227:9: required from here
/usr/local/include/boost/format/alt_sstream_impl.hpp:261:45: error: no matching function for call to 'std::allocator<char>::allocate(std::size_t&, char*)'
261 | newptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/string:43,
from /usr/include/c++/13/bits/locale_classes.h:40,
from /usr/include/c++/13/bits/ios_base.h:41,
from /usr/include/c++/13/ios:44,
from /usr/include/c++/13/istream:40,
from /usr/include/c++/13/sstream:40,
from /usr/include/c++/13/complex:45,
from /source/triqs.src/c++/triqs/utility/legendre.hpp:22,
from /source/triqs.src/c++/triqs/utility/legendre.cpp:18:
/usr/include/c++/13/bits/allocator.h:189:7: note: candidate: 'constexpr _Tp* std::allocator< <template-parameter-1-1> >::allocate(std::size_t) [with _Tp = char; std::size_t = long unsigned int]'
189 | allocate(size_t __n)
| ^~~~~~~~
/usr/include/c++/13/bits/allocator.h:189:7: note: candidate expects 1 argument, 2 provided
make[2]: *** [c++/triqs/CMakeFiles/triqs.dir/build.make:370: c++/triqs/CMakeFiles/triqs.dir/utility/legendre.cpp.o] Error 1
I think earlier version are not compatible with the c++ standard we are requiring. Here is the dockerfile for testing. The variable BVER
sets the minor boost version - in case you want to reproduce the problem. Maybe one can fiddle around with the boost compile option to make it work, but I would say we should raise the version requirement to 1.63 .
@the-hampel OK, perhaps my earlier compilation of Boost was faulty. Now all is working as expected. Thanks for your support!
There seem to be issues with compiling TRIQS 3.2 with GCC 13.x
TRIQS compilation fails with GCC 13.2.0 with following error message:
Seems to be related to GNU 13.2.0: https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes . Can be fixed by adding
#include <cstdint>
totriqs.src/c++/triqs/mc_tools/random_generator.hpp
.Further errors occur, e.g.,
Seems to be related to https://eel.is/c++draft/requirements#using.headers-3, but I don't know how to fix it. Sorry.