snitch-org / snitch

Lightweight C++20 testing framework.
Boost Software License 1.0
257 stars 7 forks source link

Obtaining # error Unsupported compiler #78

Closed victimsnino closed 1 year ago

victimsnino commented 1 year ago

Hey, in my CI i'm obtaining # error Unsupported compiler error during compilation on GCC-10 and clang-14 on ubuntu. gcc clang

it looks strange for me due to they are not "custom" compilers and your code is supporting it as i can see...

cschreib commented 1 year ago

Hi there. I'm not sure what's going on there, I suspect something fishy with your CI script. I tried cloning your repo on the v2_1 branch on my local machine and it all worked fine:

cmake --preset ci-ubuntu-gcc-tests .
cmake --build --preset ci-build

Output of the first command:

Preset CMake variables:

  CMAKE_BUILD_TYPE="Release"
  CMAKE_CXX_CLANG_TIDY="clang-tidy;-header-filter=/home/cschreib/programming/ReactivePlusPlus/src/.*;-checks=bugprone-*,concurrency-*,performance-*,-macro*;-warnings-as-errors=*;-extra-arg=-std=c++20"
  CMAKE_CXX_CPPCHECK="cppcheck;--inline-suppr;--std=c++20;--enable=all;--check-config;--suppress=missingIncludeSystem"
  CMAKE_CXX_EXTENSIONS="OFF"
  CMAKE_CXX_FLAGS="-Wall -Werror -Wextra -Wpedantic -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wno-gnu-zero-variadic-macro-arguments"
  CMAKE_CXX_STANDARD="20"
  CMAKE_CXX_STANDARD_REQUIRED="ON"
  CMAKE_EXPORT_COMPILE_COMMANDS="ON"
  RPP_BUILD_EXAMPLES="ON"
  RPP_BUILD_QT_CODE="OFF"
  RPP_BUILD_SFML_CODE="OFF"
  RPP_BUILD_TESTS="ON"
  RPP_DEVELOPER_MODE="ON"
  RPP_GCOV_TOOL="/usr/bin/gcov-10"

Preset environment variables:

  CC="gcc-10"
  CXX="g++-10"

-- The CXX compiler identification is GNU 10.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-10 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found Python3: /usr/bin/python3.8 (found version "3.8.10") found components: Interpreter 
-- Configuring done (3.7s)
-- Generating done (0.0s)
CMake Warning:
  Manually-specified variables were not used by the project:

    RPP_GCOV_TOOL

-- Build files have been written to: /home/cschreib/programming/ReactivePlusPlus/build

Output of the second command:

[ 14%] Generating snitch/snitch_all.hpp
[ 28%] Building CXX object _deps/snitch-build/CMakeFiles/snitch.dir/src/snitch.cpp.o
[ 28%] Built target snitch-header-only-impl
[ 28%] Built target rpp
[ 42%] Linking CXX static library ../../bin/libsnitch.a
[ 42%] Built target snitch
[ 57%] Building CXX object src/tests/CMakeFiles/test_disposables.dir/rpp/test_disposables.cpp.o
[ 71%] Building CXX object src/tests/CMakeFiles/test_observers.dir/rpp/test_observers.cpp.o
Checking /home/cschreib/programming/ReactivePlusPlus/src/tests/rpp/test_disposables.cpp ...
[ 85%] Linking CXX executable ../../bin/test_disposables
[ 85%] Built target test_disposables
Checking /home/cschreib/programming/ReactivePlusPlus/src/tests/rpp/test_observers.cpp ...
[100%] Linking CXX executable ../../bin/test_observers
[100%] Built target test_observers

FYI, your CMakeLists.txt says minimum CMake version of 3.14, but your preset files don't work at all with 3.18. I had to install the latest CMake (3.26) to get things to work.

victimsnino commented 1 year ago

Yeah, looks like you are right. but i've got this error several times.... looks like can be closed