From 123e33a0715d52a7fedfb1b5495161d99bb98aa4 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Sun, 19 Mar 2023 09:08:27 -0500 Subject: [PATCH 1/3] Added -Wstrict-prototypes, removed -fno-strict-overflow -fno-strict-overflow is implied by -fwrapv and generates compiler unused option warning. --- dpctl/CMakeLists.txt | 5 ++++- libsyclinterface/CMakeLists.txt | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dpctl/CMakeLists.txt b/dpctl/CMakeLists.txt index 6ccca33dd6..6febae5dd8 100644 --- a/dpctl/CMakeLists.txt +++ b/dpctl/CMakeLists.txt @@ -13,6 +13,7 @@ if(WIN32) "-Wunused-function " "-Wuninitialized " "-Wmissing-declarations " + "-Wstrict-prototypes " "-Wno-unused-parameter " ) string(CONCAT SDL_FLAGS @@ -36,6 +37,8 @@ elseif(UNIX) "-Wunused-function " "-Wuninitialized " "-Wmissing-declarations " + "-Wstrict-prototypes " + "-Wno-unused-parameter " "-fdiagnostics-color=auto " ) string(CONCAT SDL_FLAGS @@ -46,7 +49,7 @@ elseif(UNIX) "-D_FORTIFY_SOURCE=2 " "-Wformat " "-Wformat-security " - "-fno-strict-overflow " +# "-fno-strict-overflow " # no-strict-overflow is implied by -fwrapv "-fno-delete-null-pointer-checks " "-fwrapv " ) diff --git a/libsyclinterface/CMakeLists.txt b/libsyclinterface/CMakeLists.txt index 7076fe53c3..79cea3696d 100644 --- a/libsyclinterface/CMakeLists.txt +++ b/libsyclinterface/CMakeLists.txt @@ -110,6 +110,8 @@ if(WIN32) "-Wunused-function " "-Wuninitialized " "-Wmissing-declarations " + "-Wstrict-prototypes " + "-Wno-unused-parameter " ) string(CONCAT SDL_FLAGS "/GS " @@ -131,6 +133,8 @@ elseif(UNIX) "-Wunused-function " "-Wuninitialized " "-Wmissing-declarations " + "-Wstrict-prototypes " + "-Wno-unused-parameter " "-fdiagnostics-color=auto " ) string(CONCAT SDL_FLAGS @@ -141,7 +145,7 @@ elseif(UNIX) "-D_FORTIFY_SOURCE=2 " "-Wformat " "-Wformat-security " - "-fno-strict-overflow " +# "-fno-strict-overflow " # implied by -fwrapv "-fno-delete-null-pointer-checks " "-fwrapv " ) From 3d61870124cad419ce0cb1b4d6ba833746565a3d Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Mon, 20 Mar 2023 06:00:12 -0500 Subject: [PATCH 2/3] Adding commented out line to visualized target dependency tree --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d97ca9ae8f..b57c02d845 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) +# set_property(GLOBAL PROPERTY GLOBAL_DEPENDS_DEBUG_MODE 1) # Option to generate code coverage report using llvm-cov and lcov. option(DPCTL_GENERATE_COVERAGE From 4f74938321cbb51d99db77797f2879c9c8983007 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Mon, 20 Mar 2023 06:00:20 -0500 Subject: [PATCH 3/3] Added target cythonize_${_trgt} for each Cython file --- dpctl/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dpctl/CMakeLists.txt b/dpctl/CMakeLists.txt index 6febae5dd8..487a5782e2 100644 --- a/dpctl/CMakeLists.txt +++ b/dpctl/CMakeLists.txt @@ -140,9 +140,11 @@ set(CMAKE_INSTALL_RPATH "$ORIGIN") function(build_dpctl_ext _trgt _src _dest) add_cython_target(${_trgt} ${_src} CXX OUTPUT_VAR _generated_src) + set(_cythonize_trgt "${_trgt}_cythonize_pyx") + add_custom_target(${_cythonize_trgt} DEPENDS ${_src}) add_library(${_trgt} MODULE ${_generated_src}) target_include_directories(${_trgt} PRIVATE ${NumPy_INCLUDE_DIR} ${DPCTL_INCLUDE_DIR}) - add_dependencies(${_trgt} _build_time_create_dpctl_include_copy) + add_dependencies(${_trgt} _build_time_create_dpctl_include_copy ${_cythonize_trgt}) if (DPCTL_GENERATE_COVERAGE) target_compile_definitions(${_trgt} PRIVATE CYTHON_TRACE=1 CYTHON_TRACE_NOGIL=1) target_compile_options(${_trgt} PRIVATE -fno-sycl-use-footer)