From a0a3a04b2916b91a44f9920d67dd9478e136d9b4 Mon Sep 17 00:00:00 2001 From: Kenneth Assogba Date: Wed, 20 Nov 2024 01:38:00 +0100 Subject: [PATCH] Ignore nanobing pedantic warning and remove unroll-loops compile flags --- CMakeLists.txt | 6 ++++-- .../{binding/material.cpp => model/material.bind.cpp} | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) rename src/demeter/{binding/material.cpp => model/material.bind.cpp} (95%) diff --git a/CMakeLists.txt b/CMakeLists.txt index a52adac..8014449 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,11 +5,13 @@ set(CMAKE_CXX_STANDARD 17) # specifying the C++ Standard # set(GCC_COVERAGE_COMPILE_FLAGS "-Wall -Wextra -pedantic") # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}") -set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -funroll-loops -funroll-all-loops -DNDEBUG") +set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG") set(CMAKE_CXX_FLAGS_DEBUG "-g -fsanitize=address,undefined") # -fsanitize=thread is incompatible with -fsanitize=address # -fsanitize=memory also # -fanalizer is also available for gcc +# -funroll-loops Premature optimization is the root of all evil +# -funroll-all-loops is not supported by Clang if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) @@ -72,7 +74,7 @@ set(LINK_LIBS ${LINK_LIBS} demeter) # Compile extension module with size optimization and add demeter library nanobind_add_module(demeter_ext NB_DOMAIN demeter - src/demeter/binding/material.cpp) + src/demeter/model/material.bind.cpp) target_link_libraries(demeter_ext PRIVATE demeter) # Executables diff --git a/src/demeter/binding/material.cpp b/src/demeter/model/material.bind.cpp similarity index 95% rename from src/demeter/binding/material.cpp rename to src/demeter/model/material.bind.cpp index f5198d0..3b9a5ee 100644 --- a/src/demeter/binding/material.cpp +++ b/src/demeter/model/material.bind.cpp @@ -1,8 +1,11 @@ #include "demeter/model/material.hpp" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" #include #include #include +#pragma GCC diagnostic pop namespace nb = nanobind; using namespace nb::literals;