Open hernanponcedeleon opened 1 week ago
What are your requirements in terms of supported clang/libc++ versions? I think the code uses some modern features (C++20 and higher) that your library version does not support.
Interestingly, I cannot compile master either but for a different reason. It seems some code is missing.
I just tested it with the same version (clang 14) and got the same problems. However, it works if I use 15.0.0 version preinstalled on my Mac:
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
I'm not sure if this is really a problem of outdated Clang or an outdated libc++. Is it possible for you to test Clang 15?
The compiler does not seem to be the problem (I assume the warnings are harmless), maybe the library
> cmake -DCMAKE_BUILD_TYPE=Release -S . -B ./build
-- The CXX compiler identification is Clang 15.0.7
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- system: /usr/local;/usr;/;/usr;/usr/local;/usr/X11R6;/usr/pkg;/opt
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0")
-- Boost version: 1.74.0
-- Found ANTLR: /usr/local/lib/antlr-4.10.1-complete.jar (found version "4.1")
CMake Warning (dev) at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2251 (message):
Policy CMP0114 is not set: ExternalProject step targets fully adopt their
steps. Run "cmake --help-policy CMP0114" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
ExternalProject target 'antlr4_runtime' would depend on the targets for
step(s) 'build_static' under policy CMP0114, but this is being left out for
compatibility since the policy is not set.
Call Stack (most recent call first):
cmake/ExternalAntlr4Cpp.cmake:132 (ExternalProject_Add_StepTargets)
CMakeLists.txt:28 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2251 (message):
Policy CMP0114 is not set: ExternalProject step targets fully adopt their
steps. Run "cmake --help-policy CMP0114" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
ExternalProject target 'antlr4_runtime' would depend on the targets for
step(s) 'build_shared' under policy CMP0114, but this is being left out for
compatibility since the policy is not set.
Call Stack (most recent call first):
cmake/ExternalAntlr4Cpp.cmake:149 (ExternalProject_Add_StepTargets)
CMakeLists.txt:28 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/drc/git/rat/build
So it works now? At least there are no errors.
No ... The above shows the output of running cmake -DCMAKE_BUILD_TYPE=Release -S . -B ./build
... I.e. I have clang 15 now. However running cmake --build ./build --target rat -j 10
still fails due to e.g. "format file not found"
I see. I think on Linux, the compiler always uses libstdc++
as standard implementation which is not provided by Clang and thus upgrading Clang doesn't change anything. It seems to be not so trivial to upgrade libstdc++
without also upgrading the Ubuntu version though.
However, Clang provides libc++
which you might be able to use by passing -stdlib=libc++
to the compiler (e.g., by adding it to CPPFLAGS
).
This did not help much. After running cmake -DCMAKE_BUILD_TYPE=Release -S . -B ./build
, I manually edited build/CMakeCache.txt
and set CMAKE_CXX_FLAGS:STRING=-stdlib=libc++
. But now It complains about several other things
In file included from : /usr/include/spdlog/spdlog.h10/home/drc/git/rat/src/basic/Literal.hfatal error: ::fatal error: :fatal error: 12 fatal error: fatal error: 2:
:'optional' file not foundIn file included from 'optional' file not found10'optional' file not found/usr/include/spdlog/common.hfatal error: 'algorithm' file not found'format' file not found:
...
fatal error: 'atomic' file not found#include <optional>
...
/usr/include/boost/config/detail/select_stdlib_config.hpp:26:14: fatal error: 'cstddef' file not found
Commit id:
dedec4655ee906af5d84d19a05eeb993e62b31dd
Compiler version:
Ubuntu clang version 14.0.6
Problem: