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

Broken build on linux with gcc 13.2.0 #613

Open
bradh opened this issue May 26, 2024 · 1 comment
Open

Broken build on linux with gcc 13.2.0 #613

bradh opened this issue May 26, 2024 · 1 comment

Comments

@bradh
Copy link
Contributor

bradh commented May 26, 2024

Doing a default build on a newly upgraded Kubuntu 24.04 machine, I'm hitting:

[ 42%] Building CXX object externals/coda-oss/modules/c++/str/CMakeFiles/str-c++.dir/source/Convert.cpp.o
In file included from /home/bradh/coding/nitro/externals/coda-oss/modules/c++/str/include/str/Convert.h:39,
                 from /home/bradh/coding/nitro/externals/coda-oss/modules/c++/str/source/Convert.cpp:35:
/home/bradh/coding/nitro/externals/coda-oss/modules/c++/coda_oss/include/coda_oss/string.h:54:20: error: identifier ‘char8_t’ is a keyword in C++20 [-Werror=c++20-compat]
   54 |         enum class char8_t : unsigned char { }; // https://en.cppreference.com/w/cpp/language/types
      |                    ^~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [externals/coda-oss/modules/c++/str/CMakeFiles/str-c++.dir/build.make:76: externals/coda-oss/modules/c++/str/CMakeFiles/str-c++.dir/source/Convert.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3328: externals/coda-oss/modules/c++/str/CMakeFiles/str-c++.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

It looks like there is code in the header that tries to deal with this, but for some reason it doesn't work for me, and I'm not sure why.

Is there a useful cmake flag I could be providing here? Or anything else I can do to help debug / fix this?

@pgsocks
Copy link

pgsocks commented Oct 3, 2024

I fixed this by bumping the C++ standard to 20 in the CMake files for the main project and CODA-OSS.

From 4fc9f4a9079901236354ee995ee71c7137672a42 Mon Sep 17 00:00:00 2001                                                                                                                                                                                                                      
From: pgsocks <[email protected]>                                                                                                                                                                                                                                                               
Date: Thu, 3 Oct 2024 18:12:58 -0500                                                                                                                                                                                                                                                        
Subject: [PATCH 2/2] Increase C++ standard to 20                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                            
---                                                                                                                                                                                                                                                                                         
 CMakeLists.txt                    | 2 +-                                                                                                                                                                                                                                                   
 externals/coda-oss/CMakeLists.txt | 2 +-                                                                                                                                                                                                                                                   
 2 files changed, 2 insertions(+), 2 deletions(-)                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                                                                            
diff --git a/CMakeLists.txt b/CMakeLists.txt                                                                                                                                                                                                                                                
index 6bd74b73..3df312f6 100644                                                                                                                                                                                                                                                             
--- a/CMakeLists.txt                                                                                                                                                                                                                                                                        
+++ b/CMakeLists.txt                                                                                                                                                                                                                                                                        
@@ -1,7 +1,7 @@                                                                                                                                                                                                                                                                             
 cmake_minimum_required(VERSION 3.14)                                                                                                                                                                                                                                                       
 project(nitro)                                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                            
-set(CMAKE_CXX_STANDARD 14)                                                                                                                                                                                                                                                                 
+set(CMAKE_CXX_STANDARD 20)                                                                                                                                                                                                                                                                 
 set(CXX_STANDARD_REQUIRED true)                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                            
 if (${CMAKE_PROJECT_NAME} STREQUAL nitro)                                                                                                                                                                                                                                                  
diff --git a/externals/coda-oss/CMakeLists.txt b/externals/coda-oss/CMakeLists.txt                                                                                                                                                                                                          
index f512d520..342b1c57 100644                                                                                                                                                                                                                                                             
--- a/externals/coda-oss/CMakeLists.txt                                                                                                                                                                                                                                                     
+++ b/externals/coda-oss/CMakeLists.txt                                                                                                                                                                                                                                                     
@@ -5,7 +5,7 @@                                                                                                                                                                                                                                                                             
 cmake_minimum_required(VERSION 3.14)                                                                                                                                                                                                                                                       
 project(coda-oss)                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                            
-set(CMAKE_CXX_STANDARD 14)                                                                                                                                                                                                                                                                 
+set(CMAKE_CXX_STANDARD 20)                                                                                                                                                                                                                                                                 
 set(CXX_STANDARD_REQUIRED true)                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                            
 if (EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")                                                                                                                                                                                                                                     
--                                                                                                                                                                                                                                                                                          
2.45.2  

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

2 participants