graph-prototype icon indicating copy to clipboard operation
graph-prototype copied to clipboard

cmake fails to run with clang 20

Open marcusmueller opened this issue 4 months ago • 4 comments

… bit surprising, tbh, since modern clang is explicitly listed as supported

mkdir testbuild && cd testbuild
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ${graph-proto directory}

yields

-- The CXX compiler identification is Clang 20.1.8
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMake version: 3.31.6
Building Tests and benchmarks.
-- Using /usr/lib64/ccache/clang++ to compile the gnuradio_4_0_parse_registrations tool
-- Configuring parser tool in /home/marcus/src/graph-prototype/testbuild/blocklib_generator/tools_build...
-- Building parser tool in /home/marcus/src/graph-prototype/testbuild/blocklib_generator/tools_build...
CMake Error at blocklib_generator/CMakeLists.txt:52 (message):
  Failed to build gnuradio_4_0_parse_registrations tool:
  /home/marcus/src/graph-prototype/blocklib_generator/tools/parse_registrations.cpp:21:10:
  fatal error: 'algorithm' file not found

     21 | #include <algorithm>
        |          ^~~~~~~~~~~

  1 error generated.

  gmake[3]: ***
  [CMakeFiles/gnuradio_4_0_parse_registrations.dir/build.make:79:
  CMakeFiles/gnuradio_4_0_parse_registrations.dir/parse_registrations.cpp.o]
  Error 1

  gmake[2]: *** [CMakeFiles/Makefile2:87:
  CMakeFiles/gnuradio_4_0_parse_registrations.dir/all] Error 2

  gmake[1]: *** [CMakeFiles/Makefile2:94:
  CMakeFiles/gnuradio_4_0_parse_registrations.dir/rule] Error 2

  gmake: *** [Makefile:124: gnuradio_4_0_parse_registrations] Error 2 [ 50%]
  Building CXX object
  CMakeFiles/gnuradio_4_0_parse_registrations.dir/parse_registrations.cpp.o


-- Configuring incomplete, errors occurred!

marcusmueller avatar Sep 13 '25 19:09 marcusmueller

Do you have libc++ headers installed ?

iamsergio avatar Sep 13 '25 23:09 iamsergio

yes, but it also fails without – are we sure we need a specific C++ std library just to build a parser tool?

marcusmueller avatar Sep 13 '25 23:09 marcusmueller

the build forces libc++ if clang, the parser tool is just the first to fail if headers are missing

iamsergio avatar Sep 14 '25 12:09 iamsergio

yes, but it also fails without – are we sure we need a specific C++ std library just to build a parser tool?

Yes, this is needed for platforms that do not provide a stdlibc++ and/or use a cross-compiler incompatible with it (e.g. WASM, iOS, ...).

RalphSteinhagen avatar Sep 15 '25 06:09 RalphSteinhagen