From 12677f2c53bec83b18624a66d78878ac84582333 Mon Sep 17 00:00:00 2001 From: Sajid Ali Date: Fri, 9 Jun 2023 10:40:28 -0500 Subject: [PATCH 1/5] openPMD: set software attrs modified: src/particles/elements/diagnostics/openPMD.cpp --- src/particles/elements/diagnostics/openPMD.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/particles/elements/diagnostics/openPMD.cpp b/src/particles/elements/diagnostics/openPMD.cpp index 641e0a35d..4044a18fd 100644 --- a/src/particles/elements/diagnostics/openPMD.cpp +++ b/src/particles/elements/diagnostics/openPMD.cpp @@ -9,6 +9,7 @@ */ #include "openPMD.H" +#include "ImpactXVersion.H" #include "particles/ImpactXParticleContainer.H" #include @@ -198,6 +199,7 @@ namespace detail # endif , "adios2.engine.usesteps = true" ); + series.setSoftware("impactx", IMPACTX_VERSION); series.setIterationEncoding( series_encoding ); m_series = series; m_unique_series[m_series_name] = series; From 8bdb3ab57ce261d5e8e9e1fdf49ba5f1761c65a9 Mon Sep 17 00:00:00 2001 From: Sajid Ali Date: Mon, 12 Jun 2023 17:17:32 -0500 Subject: [PATCH 2/5] minor enhancements for use with clangd --- .gitignore | 4 ++++ CMakeLists.txt | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/.gitignore b/.gitignore index 7e8820fd6..602e7d2dd 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,10 @@ cmake-build-*/ .kdev?/ *.kdev? +# clangd LSP files +compile_commands.json +**.cache/clangd + # File-based project format: *.iws diff --git a/CMakeLists.txt b/CMakeLists.txt index 6366a5ce6..17052f1a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,14 @@ cmake_minimum_required(VERSION 3.20.0) project(ImpactX VERSION 23.06) +# generate compile_commands.json +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +# and place it in the source directory https://stackoverflow.com/a/60910583 +add_custom_target( + copy-compile-commands ALL + ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_BINARY_DIR}/compile_commands.json ${CMAKE_CURRENT_LIST_DIR}) + include(${ImpactX_SOURCE_DIR}/cmake/ImpactXFunctions.cmake) # In-source tree builds are messy and can screw up the build system. From 261de483e907343ec69883d21e0bafa6003aa03a Mon Sep 17 00:00:00 2001 From: Sajid Ali Date: Fri, 16 Jun 2023 13:20:45 -0500 Subject: [PATCH 3/5] Update CMakeLists.txt Co-authored-by: Axel Huebl --- CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17052f1a2..689de2b38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,12 +4,14 @@ cmake_minimum_required(VERSION 3.20.0) project(ImpactX VERSION 23.06) # generate compile_commands.json -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -# and place it in the source directory https://stackoverflow.com/a/60910583 -add_custom_target( - copy-compile-commands ALL - ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_BINARY_DIR}/compile_commands.json ${CMAKE_CURRENT_LIST_DIR}) +if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + # and place it in the source directory https://stackoverflow.com/a/60910583 + add_custom_target( + copy-compile-commands ALL + ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_BINARY_DIR}/compile_commands.json ${PROJECT_SOURCE_DIR}) +endif() include(${ImpactX_SOURCE_DIR}/cmake/ImpactXFunctions.cmake) From 9c98645f39a60534014867cfdedd0f6cc2ed1373 Mon Sep 17 00:00:00 2001 From: Sajid Ali Date: Thu, 10 Aug 2023 08:51:38 -0500 Subject: [PATCH 4/5] limit the generation of compile_commands.json to Unix Makefiles and Ninja generators only modified: CMakeLists.txt --- CMakeLists.txt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 689de2b38..abc50463a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,13 +4,16 @@ cmake_minimum_required(VERSION 3.20.0) project(ImpactX VERSION 23.06) # generate compile_commands.json -if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) - set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - # and place it in the source directory https://stackoverflow.com/a/60910583 - add_custom_target( - copy-compile-commands ALL - ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_BINARY_DIR}/compile_commands.json ${PROJECT_SOURCE_DIR}) +if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" OR ${CMAKE_GENERATOR} STREQUAL + "Ninja") + if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + # and place it in the source directory https://stackoverflow.com/a/60910583 + add_custom_target( + copy-compile-commands ALL + ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_BINARY_DIR}/compile_commands.json ${PROJECT_SOURCE_DIR}) + endif() endif() include(${ImpactX_SOURCE_DIR}/cmake/ImpactXFunctions.cmake) From a3da9faa8a3660db22a024150404446483626d9b Mon Sep 17 00:00:00 2001 From: Sajid Ali Date: Thu, 10 Aug 2023 09:08:04 -0500 Subject: [PATCH 5/5] do not copy compile_commands.json to source directory modified: .gitignore modified: CMakeLists.txt --- .gitignore | 1 - CMakeLists.txt | 5 ----- 2 files changed, 6 deletions(-) diff --git a/.gitignore b/.gitignore index 602e7d2dd..b44ff01f4 100644 --- a/.gitignore +++ b/.gitignore @@ -46,7 +46,6 @@ cmake-build-*/ *.kdev? # clangd LSP files -compile_commands.json **.cache/clangd # File-based project format: diff --git a/CMakeLists.txt b/CMakeLists.txt index abc50463a..2edb41be6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,11 +8,6 @@ if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" OR ${CMAKE_GENERATOR} STREQUAL "Ninja") if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - # and place it in the source directory https://stackoverflow.com/a/60910583 - add_custom_target( - copy-compile-commands ALL - ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_BINARY_DIR}/compile_commands.json ${PROJECT_SOURCE_DIR}) endif() endif()