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

Werror: Tracy capture fails to build with gcc 14 #810

Closed
PhilipDeegan opened this issue Jun 6, 2024 · 6 comments
Closed

Werror: Tracy capture fails to build with gcc 14 #810

PhilipDeegan opened this issue Jun 6, 2024 · 6 comments

Comments

@PhilipDeegan
Copy link

PhilipDeegan commented Jun 6, 2024

standard cmake config via cd capture; mkdir build; cd build; cmake ..; make

In file included from /usr/include/c++/14/atomic:50,
                 from /path/to/git/phare/master/subprojects/tracy/capture/build/_deps/tbb-src/src/tbb/../../include/oneapi/tbb/detail/_utils.h:22,
                 from /path/to/git/phare/master/subprojects/tracy/capture/build/_deps/tbb-src/src/tbb/task_dispatcher.h:20,
                 from /path/to/git/phare/master/subprojects/tracy/capture/build/_deps/tbb-src/src/tbb/arena.cpp:17:
In member function ‘void std::__atomic_base<_IntTp>::store(__int_type, std::memory_order) [with _ITp = bool]’,
    inlined from ‘void std::atomic<bool>::store(bool, std::memory_order)’ at /usr/include/c++/14/atomic:109:20,
    inlined from ‘void tbb::detail::r1::concurrent_monitor_base<Context>::notify_one_relaxed() [with Context = long unsigned int]’ at /path/to/git/phare/master/subprojects/tracy/capture/build/_deps/tbb-src/src/tbb/concurrent_monitor.h:300:53:
/usr/include/c++/14/bits/atomic_base.h:477:25: error: ‘void __atomic_store_1(volatile void*, unsigned char, int)’ writing 1 byte into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
  477 |         __atomic_store_n(&_M_i, __i, int(__m));

gcc

Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/14/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,m2,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace --with-libstdcxx-zoneinfo=/usr/share/zoneinfo --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-14.1.1-20240522/obj-x86_64-redhat-linux/isl-install --enable-offload-targets=nvptx-none,amdgcn-amdhsa --enable-offload-defaulted --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.1.1 20240522 (Red Hat 14.1.1-4) (GCC) 

tpp cmake config part

--   Package 'tbb', required by 'virtual:world', not found
-- CPM: Adding package [email protected] (v2021.12.0-rc2)
CMake Warning at build/_deps/tbb-src/CMakeLists.txt:119 (message):
  You are building oneTBB as a static library.  This is highly discouraged
  and such configuration is not supported.  Consider building a dynamic
  library to avoid unforeseen issues.

@wolfpld
Copy link
Owner

wolfpld commented Jun 7, 2024

I can reproduce this, but I can't fix it. TBB is not even a requirement of Tracy, but of gcc / libstdc++, which depends on it to implement parallel STL, but doesn't even try to link with it, leaving the situation to be handled by projects that want to take advantage of parallel algorithms. There is even no way to check whether the STL implementation in use depends on TBB or not. It's a mess.

The recommended way to deal with this is to install TBB through the package manager, so that it can be picked up by pkg-config (which is also not always provided, as far as I can remember, it has to be added manually by distribution packagers), instead of fetching it through CMake and building it manually.

The problem with building is in TBB itself, and there has been no new releases since 2021.12.0, as you can see at https://github.com/oneapi-src/oneTBB/releases.

As a workaround, you can try compiling Tracy with the NO_PARALLEL_SORT define, which disables the use of parallel STL and removes the dependency on TBB. However, this is not currently exposed in the CMake build scripts, so some manual tinkering will be required.

@wolfpld
Copy link
Owner

wolfpld commented Jun 7, 2024

With d9fe3ed you will be able to set NO_PARALLEL_STL.

@PhilipDeegan
Copy link
Author

sounds like this can be closed so, I haven't checked but I will at some point

@sin-ack
Copy link

sin-ack commented Nov 30, 2024

It appears this has broken again with 1c1faef. I get this with GCC 14 now:

[128/131] Linking CXX executable tracy-capture
FAILED: tracy-capture 
: && /usr/bin/c++ -march=native -flto=auto -fno-fat-lto-objects  CMakeFiles/tracy-capture.dir/src/capture.cpp.o -o tracy-capture  libTracyServer.a  libTracyGetOpt.a  _deps/capstone-build/libcapstone.a  libTracyZstd.a && :
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cceL6w8s.ltrans1.ltrans.o: in function `tbb::detail::d1::execution_slot(tbb::detail::d1::execution_data const&)':
<artificial>:(.text+0x4ed2): undefined reference to `tbb::detail::r1::execution_slot(tbb::detail::d1::execution_data const*)'
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cceL6w8s.ltrans1.ltrans.o: in function `tbb::detail::d1::current_thread_index()':
<artificial>:(.text+0x4ee6): undefined reference to `tbb::detail::r1::execution_slot(tbb::detail::d1::execution_data const*)'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

TBB version: 2021.13.0
GCC version: 14.2.1_p20241116

@PhilipDeegan PhilipDeegan reopened this Nov 30, 2024
@PhilipDeegan
Copy link
Author

feel free to close and make a new ticket @wolfpld

@wolfpld
Copy link
Owner

wolfpld commented Dec 26, 2024

Different issue now, let's track it in #950.

@wolfpld wolfpld closed this as completed Dec 26, 2024
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

3 participants