Open corepointer opened 2 months ago
The github-actions container is already running Ubuntu 24 for about a week now. I fixed the necessary issues to make everything work (compiles and runs the unit tests). Unfortunately, newer compiler versions find new opportunities to complain and warn about issues in the source code. So our "warning-free-compilation" policy that we were silently following needs some attention.
Since summer I'm using Kubuntu 24.04 LTS in a virtual machine for building/running Daphne. As far as I remember, I had the following issues with building Daphne:
After that I had no problems pulling the new code from repository and rebuilding it. I believe this has now been fixed in the install-ubuntu-packages.sh script.
However, in the last month I cannot recompile the new code anymore. I'm not sure if this is due to system updates or something else. I get the following errors:
[9/146] Building CXX object src/api/internal/CMakeFiles/DaphneInternal.dir/daphne_internal.cpp.o
FAILED: src/api/internal/CMakeFiles/DaphneInternal.dir/daphne_internal.cpp.o
/usr/bin/c++ -DSPDLOG_FMT_EXTERNAL -DUSE_PAPI -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/divjak/Work/daphne/thirdparty/installed/include -I/home/divjak/Work/daphne/src -I/home/divjak/Work/daphne/build/src -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -Wimplicit-fallthrough -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fuse-ld=lld -O3 -DNDEBUG -O3 -std=c++20 -std=gnu++17 -fPIC -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -MD -MT src/api/internal/CMakeFiles/DaphneInternal.dir/daphne_internal.cpp.o -MF src/api/internal/CMakeFiles/DaphneInternal.dir/daphne_internal.cpp.o.d -o src/api/internal/CMakeFiles/DaphneInternal.dir/daphne_internal.cpp.o -c /home/divjak/Work/daphne/src/api/internal/daphne_internal.cpp
/home/divjak/Work/daphne/src/api/internal/daphne_internal.cpp: In function ‘int startDAPHNE(int, const char**, DaphneLibResult*, int*, DaphneUserConfig&)’:
/home/divjak/Work/daphne/src/api/internal/daphne_internal.cpp:167:16: error: ‘using enum’ only available with ‘-std=c++20’ or ‘-std=gnu++20’
167 | using enum SelfSchedulingScheme;
| ^~~~~~~~~~~~~~~~~~~~
/home/divjak/Work/daphne/src/api/internal/daphne_internal.cpp:167:36: error: ‘using’ with enumeration scope ‘enum class SelfSchedulingScheme’ only available with ‘-std=c++20’ or ‘-std=gnu++20’
167 | using enum SelfSchedulingScheme;
| ^
/home/divjak/Work/daphne/src/api/internal/daphne_internal.cpp:167:36: error: ‘using’ with enumeration scope ‘enum class SelfSchedulingScheme’ only available with ‘-std=c++20’ or ‘-std=gnu++20’
/home/divjak/Work/daphne/src/api/internal/daphne_internal.cpp:167:36: error: ‘using’ with enumeration scope ‘enum class SelfSchedulingScheme’ only available with ‘-std=c++20’ or ‘-std=gnu++20’
So the errors are related to the C++20 mentioned in the first post. I tried adding the suggested compiler parameters to lines 37-39 of the main CMakeLists.txt:
set(CMAKE_CXX_FLAGS_DEBUG="${CMAKE_CXX_FLAGS_DEBUG} -g -fno-omit-frame-pointer -std=c++20")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -std=c++20")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -O3 -fno-omit-frame-pointer -std=c++20")
But unfortunately this didn't solve the issue. Does anybody have any idea how to solve this?
System info:
Hi @divjakm ,
both, gcc-11
and gcc-13
are able to compile the current HEAD
.
In your error message it seems like the -std=
is set twice, this (at least) does not happen when I compile.
/usr/bin/c++ ... -O3 -std=c++20 -std=gnu++17 ... daphne_internal.cpp
You should not have to add or change any options in order to compile for C++20. This is already done here.
This shall be a place for discussion about upgrades of our software stack.
Until now we focused on Ubuntu 20 as our main development environment as this was the current version at the time this project started. A lot of things can happen in four years and a lot of improvements have been added to all the software we build upon. So it is probably time to face the burden of bringing our base and dependencies up to more recent versions. Another driver of this change is the fact that some features we want to integrate were developed with C++20, which should be more mature in newer compiler versions.
In Ubuntu 20 we used the default GCC version 9.4. In Ubuntu 24, the default is GCC 13.2.