From 6782156db4aa701cc9bc026bb082325348b1030c Mon Sep 17 00:00:00 2001 From: Isaac Morales Date: Thu, 11 Jul 2024 12:58:53 +0200 Subject: [PATCH 01/13] Replaced genreflex with rootcling --- cmake/FindROOT.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindROOT.cmake b/cmake/FindROOT.cmake index 5443a8479..7e767ca14 100644 --- a/cmake/FindROOT.cmake +++ b/cmake/FindROOT.cmake @@ -198,7 +198,7 @@ function(REFLEX_GENERATE_DICTIONARY dictionary) #set(rootmapopts --rootmap=${rootmapname} --rootmap-lib=${libprefix}${dictionary}Dict) #---Actual command---------------------------------------- add_custom_command(OUTPUT ${gensrcdict} ${rootmapname} ${dictionary}_rdict.pcm - COMMAND ${LAUNCHER} ${GENREFLEX_EXECUTABLE} ${headerfiles} -o ${gensrcdict} ${rootmapopts} --select=${selectionfile} --noIncludePaths + COMMAND ${LAUNCHER} ${ROOTCLING_EXECUTABLE} --reflex -o ${gensrcdict} ${rootmapopts} ${headerfiles} ${selectionfile} --noIncludePaths ${ARG_OPTIONS} ${includedirs} ${definitions} DEPENDS ${headerfiles} ${selectionfile}) endfunction() From 3e0ff0ada12c6f8d1d458f1a4cd9b5e54a1d999a Mon Sep 17 00:00:00 2001 From: Isaac Morales Date: Wed, 17 Jul 2024 11:39:57 +0200 Subject: [PATCH 02/13] Added solution from FairROOT/#385 --- cmake/FindROOT.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindROOT.cmake b/cmake/FindROOT.cmake index 7e767ca14..0efd370ec 100644 --- a/cmake/FindROOT.cmake +++ b/cmake/FindROOT.cmake @@ -198,7 +198,7 @@ function(REFLEX_GENERATE_DICTIONARY dictionary) #set(rootmapopts --rootmap=${rootmapname} --rootmap-lib=${libprefix}${dictionary}Dict) #---Actual command---------------------------------------- add_custom_command(OUTPUT ${gensrcdict} ${rootmapname} ${dictionary}_rdict.pcm - COMMAND ${LAUNCHER} ${ROOTCLING_EXECUTABLE} --reflex -o ${gensrcdict} ${rootmapopts} ${headerfiles} ${selectionfile} --noIncludePaths + COMMAND ${LAUNCHER} ${ROOTCLING_EXECUTABLE} --reflex -o ${gensrcdict} ${rootmapopts} ${headerfiles} ${selectionfile} --noIncludePaths -inlineInputHeader ${ARG_OPTIONS} ${includedirs} ${definitions} DEPENDS ${headerfiles} ${selectionfile}) endfunction() From 697e34b0aa5b166f037550fd438a529f9f630c52 Mon Sep 17 00:00:00 2001 From: Isaac Morales Date: Wed, 24 Jul 2024 16:16:02 +0200 Subject: [PATCH 03/13] Get rid of genreflex instances --- cmake/BioDynaMo.cmake | 4 ++-- cmake/FindROOT.cmake | 4 +--- cmake/utils.cmake | 1 - util/makefile-build/bdm-code-generation | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/cmake/BioDynaMo.cmake b/cmake/BioDynaMo.cmake index 24f9080ab..12727eadb 100644 --- a/cmake/BioDynaMo.cmake +++ b/cmake/BioDynaMo.cmake @@ -108,7 +108,7 @@ function(build_shared_library TARGET) # We always need dictionaries for the plugins (plugin manager requires class # information) if(dict OR DEFINED ARG_PLUGIN) - # generate dictionary using genreflex + # generate dictionary using rootcling reflex set(DICT_FILE "${CMAKE_CURRENT_BINARY_DIR}/lib${TARGET}_dict") set(BDM_DICT_FILE "${CMAKE_CURRENT_BINARY_DIR}/lib${TARGET}_bdm_dict.cc") @@ -179,7 +179,7 @@ function(generate_rootlogon) set(CONTENT "${CONTENT}\n gROOT->ProcessLine(\"cout << \\\"ERROR: Loading BioDynaMo into ROOT failed!\\\" << endl\;\")\;") set(CONTENT "${CONTENT}\n gROOT->ProcessLine(\"cout << \\\" BioDynaMo was not built with dict=ON\\\" << endl\;\")\;") endif() - + set(CONTENT "${CONTENT}\n}\n") file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/rootlogon.C" ${CONTENT}) endfunction(generate_rootlogon) diff --git a/cmake/FindROOT.cmake b/cmake/FindROOT.cmake index 0efd370ec..6c04bead6 100644 --- a/cmake/FindROOT.cmake +++ b/cmake/FindROOT.cmake @@ -97,8 +97,6 @@ mark_as_advanced(ROOT_CONFIG_EXECUTABLE) include(CMakeParseArguments) find_program(ROOTCLING_EXECUTABLE rootcling HINTS "$ENV{ROOTSYS}/bin" "$ENV{BDM_ROOT_DIR}/bin" "${CMAKE_THIRD_PARTY_DIR}/root/bin") -find_program(GENREFLEX_EXECUTABLE genreflex - HINTS "$ENV{ROOTSYS}/bin" "$ENV{BDM_ROOT_DIR}/bin" "${CMAKE_THIRD_PARTY_DIR}/root/bin") #find_package(GCCXML) # We use the launcher script to emulate a `source thisbdm.sh` call @@ -198,7 +196,7 @@ function(REFLEX_GENERATE_DICTIONARY dictionary) #set(rootmapopts --rootmap=${rootmapname} --rootmap-lib=${libprefix}${dictionary}Dict) #---Actual command---------------------------------------- add_custom_command(OUTPUT ${gensrcdict} ${rootmapname} ${dictionary}_rdict.pcm - COMMAND ${LAUNCHER} ${ROOTCLING_EXECUTABLE} --reflex -o ${gensrcdict} ${rootmapopts} ${headerfiles} ${selectionfile} --noIncludePaths -inlineInputHeader + COMMAND ${LAUNCHER} ${ROOTCLING_EXECUTABLE} --reflex -o ${gensrcdict} ${rootmapopts} ${headerfiles} ${selectionfile} --noIncludePaths -inlineInputHeader -cxxmodule ${ARG_OPTIONS} ${includedirs} ${definitions} DEPENDS ${headerfiles} ${selectionfile}) endfunction() diff --git a/cmake/utils.cmake b/cmake/utils.cmake index 2dd29ef4f..8b957b1f5 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -108,7 +108,6 @@ function(verify_ROOT) SET(ROOT_ETC_DIR ${ROOT_ETC_DIR} PARENT_SCOPE) SET(ROOT_CONFIG_EXECUTABLE ${ROOT_CONFIG_EXECUTABLE} PARENT_SCOPE) SET(ROOTCLING_EXECUTABLE ${ROOTCLING_EXECUTABLE} PARENT_SCOPE) - SET(GENREFLEX_EXECUTABLE ${GENREFLEX_EXECUTABLE} PARENT_SCOPE) else() # When ROOT is found, but it's not C++17 compliant, we exit the installation, because ROOT needs # to be properly sourced prior to invoking CMake (CMake cannot do this for us, because it requires diff --git a/util/makefile-build/bdm-code-generation b/util/makefile-build/bdm-code-generation index cd7dce8b8..1edcf505b 100755 --- a/util/makefile-build/bdm-code-generation +++ b/util/makefile-build/bdm-code-generation @@ -58,7 +58,7 @@ CXX_INCLUDES=$(${BDM_CONFIG} --cxxincludes | sed 's|-isystem |-I|g') CXX_DEFINES=$(${BDM_CONFIG} --cxxdefines) -genreflex ${HEADERS} -o ${DICT} --noIncludePaths --select=${SELECTIONFILE} ${CXX_DEFINES} ${CXX_INCLUDES} $ADDITIONAL_CXX_FLAGS +rootcling -reflex -o ${DICT} ${HEADERS} --noIncludePaths -inlineInputHeader --select=${SELECTIONFILE} ${CXX_DEFINES} ${CXX_INCLUDES} $ADDITIONAL_CXX_FLAGS # Generate bdm dictionary and append to DICT BDM_DICT=$(mktemp) From f46f12c3229e5af107e31e7acf62938d14019480 Mon Sep 17 00:00:00 2001 From: Isaac Morales Date: Wed, 24 Jul 2024 16:29:00 +0200 Subject: [PATCH 04/13] Remove -cxxmodule flag --- cmake/FindROOT.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindROOT.cmake b/cmake/FindROOT.cmake index 6c04bead6..71220cbab 100644 --- a/cmake/FindROOT.cmake +++ b/cmake/FindROOT.cmake @@ -196,7 +196,7 @@ function(REFLEX_GENERATE_DICTIONARY dictionary) #set(rootmapopts --rootmap=${rootmapname} --rootmap-lib=${libprefix}${dictionary}Dict) #---Actual command---------------------------------------- add_custom_command(OUTPUT ${gensrcdict} ${rootmapname} ${dictionary}_rdict.pcm - COMMAND ${LAUNCHER} ${ROOTCLING_EXECUTABLE} --reflex -o ${gensrcdict} ${rootmapopts} ${headerfiles} ${selectionfile} --noIncludePaths -inlineInputHeader -cxxmodule + COMMAND ${LAUNCHER} ${ROOTCLING_EXECUTABLE} --reflex -o ${gensrcdict} ${rootmapopts} ${headerfiles} ${selectionfile} --noIncludePaths -inlineInputHeader ${ARG_OPTIONS} ${includedirs} ${definitions} DEPENDS ${headerfiles} ${selectionfile}) endfunction() From 356f21eef2cef9023fdbba2810765cbb3c3a0b03 Mon Sep 17 00:00:00 2001 From: Isaac Morales Date: Sat, 27 Jul 2024 17:28:09 +0200 Subject: [PATCH 05/13] Remove LAUNCHER invocation --- cmake/FindROOT.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindROOT.cmake b/cmake/FindROOT.cmake index 71220cbab..fa7e20f91 100644 --- a/cmake/FindROOT.cmake +++ b/cmake/FindROOT.cmake @@ -196,7 +196,7 @@ function(REFLEX_GENERATE_DICTIONARY dictionary) #set(rootmapopts --rootmap=${rootmapname} --rootmap-lib=${libprefix}${dictionary}Dict) #---Actual command---------------------------------------- add_custom_command(OUTPUT ${gensrcdict} ${rootmapname} ${dictionary}_rdict.pcm - COMMAND ${LAUNCHER} ${ROOTCLING_EXECUTABLE} --reflex -o ${gensrcdict} ${rootmapopts} ${headerfiles} ${selectionfile} --noIncludePaths -inlineInputHeader + COMMAND ${ROOTCLING_EXECUTABLE} --reflex -o ${gensrcdict} ${rootmapopts} ${headerfiles} ${selectionfile} --noIncludePaths -inlineInputHeader ${ARG_OPTIONS} ${includedirs} ${definitions} DEPENDS ${headerfiles} ${selectionfile}) endfunction() From bc0fcdc798e86d5491cdfab58538f0352673c97d Mon Sep 17 00:00:00 2001 From: Isaac Morales Date: Sat, 27 Jul 2024 18:33:10 +0200 Subject: [PATCH 06/13] Add -f flag to overwrite files According to https://github.com/root-project/root/blob/fb17cef3cb381772f7d930c213801b82b65fef52/core/dictgen/src/rootcling_impl.cxx#L5572 and genreflex -debug, the -f is needed --- cmake/FindROOT.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindROOT.cmake b/cmake/FindROOT.cmake index fa7e20f91..cbcfed3f1 100644 --- a/cmake/FindROOT.cmake +++ b/cmake/FindROOT.cmake @@ -196,7 +196,7 @@ function(REFLEX_GENERATE_DICTIONARY dictionary) #set(rootmapopts --rootmap=${rootmapname} --rootmap-lib=${libprefix}${dictionary}Dict) #---Actual command---------------------------------------- add_custom_command(OUTPUT ${gensrcdict} ${rootmapname} ${dictionary}_rdict.pcm - COMMAND ${ROOTCLING_EXECUTABLE} --reflex -o ${gensrcdict} ${rootmapopts} ${headerfiles} ${selectionfile} --noIncludePaths -inlineInputHeader + COMMAND ${ROOTCLING_EXECUTABLE} --reflex -f ${gensrcdict} ${rootmapopts} ${headerfiles} ${selectionfile} --noIncludePaths -inlineInputHeader ${ARG_OPTIONS} ${includedirs} ${definitions} DEPENDS ${headerfiles} ${selectionfile}) endfunction() From 2e0af1c32163894f8815dddf8decc2bee310f8fc Mon Sep 17 00:00:00 2001 From: Isaac Morales Date: Sat, 27 Jul 2024 18:38:11 +0200 Subject: [PATCH 07/13] Removed double minus to keep the code clean --- cmake/FindROOT.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindROOT.cmake b/cmake/FindROOT.cmake index cbcfed3f1..3d21192d9 100644 --- a/cmake/FindROOT.cmake +++ b/cmake/FindROOT.cmake @@ -196,7 +196,7 @@ function(REFLEX_GENERATE_DICTIONARY dictionary) #set(rootmapopts --rootmap=${rootmapname} --rootmap-lib=${libprefix}${dictionary}Dict) #---Actual command---------------------------------------- add_custom_command(OUTPUT ${gensrcdict} ${rootmapname} ${dictionary}_rdict.pcm - COMMAND ${ROOTCLING_EXECUTABLE} --reflex -f ${gensrcdict} ${rootmapopts} ${headerfiles} ${selectionfile} --noIncludePaths -inlineInputHeader + COMMAND ${ROOTCLING_EXECUTABLE} -reflex -f ${gensrcdict} ${rootmapopts} ${headerfiles} ${selectionfile} -noIncludePaths -inlineInputHeader ${ARG_OPTIONS} ${includedirs} ${definitions} DEPENDS ${headerfiles} ${selectionfile}) endfunction() From 0fbb6678bec0d5550642350e2c54e880b65e9093 Mon Sep 17 00:00:00 2001 From: Isaac Morales Date: Mon, 5 Aug 2024 13:48:21 +0200 Subject: [PATCH 08/13] Fix whitespace changes --- cmake/BioDynaMo.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/BioDynaMo.cmake b/cmake/BioDynaMo.cmake index 12727eadb..7b8b60125 100644 --- a/cmake/BioDynaMo.cmake +++ b/cmake/BioDynaMo.cmake @@ -179,7 +179,7 @@ function(generate_rootlogon) set(CONTENT "${CONTENT}\n gROOT->ProcessLine(\"cout << \\\"ERROR: Loading BioDynaMo into ROOT failed!\\\" << endl\;\")\;") set(CONTENT "${CONTENT}\n gROOT->ProcessLine(\"cout << \\\" BioDynaMo was not built with dict=ON\\\" << endl\;\")\;") endif() - + set(CONTENT "${CONTENT}\n}\n") file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/rootlogon.C" ${CONTENT}) endfunction(generate_rootlogon) From eb2ea6963c2263b94a37521c4feced5aaa78b24f Mon Sep 17 00:00:00 2001 From: Isaac Morales Date: Mon, 5 Aug 2024 14:13:13 +0200 Subject: [PATCH 09/13] Remove --select from bdm-code-generation --- util/makefile-build/bdm-code-generation | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/makefile-build/bdm-code-generation b/util/makefile-build/bdm-code-generation index 1edcf505b..69e5ac0f5 100755 --- a/util/makefile-build/bdm-code-generation +++ b/util/makefile-build/bdm-code-generation @@ -58,7 +58,7 @@ CXX_INCLUDES=$(${BDM_CONFIG} --cxxincludes | sed 's|-isystem |-I|g') CXX_DEFINES=$(${BDM_CONFIG} --cxxdefines) -rootcling -reflex -o ${DICT} ${HEADERS} --noIncludePaths -inlineInputHeader --select=${SELECTIONFILE} ${CXX_DEFINES} ${CXX_INCLUDES} $ADDITIONAL_CXX_FLAGS +rootcling -reflex -f ${DICT} ${HEADERS} --noIncludePaths -inlineInputHeader ${SELECTIONFILE} ${CXX_DEFINES} ${CXX_INCLUDES} $ADDITIONAL_CXX_FLAGS # Generate bdm dictionary and append to DICT BDM_DICT=$(mktemp) From c33f105ced1c9740a7858ecfa9a10d03531a3782 Mon Sep 17 00:00:00 2001 From: Isaac Morales Date: Wed, 7 Aug 2024 18:15:09 +0200 Subject: [PATCH 10/13] Remove trim whitespaces --- .editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index bcd03e659..febd8430e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,7 +6,7 @@ root = true charset = utf-8 end_of_line = lf insert_final_newline = true -trim_trailing_whitespace = true +trim_trailing_whitespace = false indent_style = space indent_size = 2 From 33c3c301b20faf51b6b333f719417f6fd84e6b86 Mon Sep 17 00:00:00 2001 From: Isaac Morales Date: Wed, 7 Aug 2024 18:16:09 +0200 Subject: [PATCH 11/13] Changed rootcling calls to be the same --- cmake/FindROOT.cmake | 2 +- util/makefile-build/bdm-code-generation | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/FindROOT.cmake b/cmake/FindROOT.cmake index 3d21192d9..86b5bba60 100644 --- a/cmake/FindROOT.cmake +++ b/cmake/FindROOT.cmake @@ -196,7 +196,7 @@ function(REFLEX_GENERATE_DICTIONARY dictionary) #set(rootmapopts --rootmap=${rootmapname} --rootmap-lib=${libprefix}${dictionary}Dict) #---Actual command---------------------------------------- add_custom_command(OUTPUT ${gensrcdict} ${rootmapname} ${dictionary}_rdict.pcm - COMMAND ${ROOTCLING_EXECUTABLE} -reflex -f ${gensrcdict} ${rootmapopts} ${headerfiles} ${selectionfile} -noIncludePaths -inlineInputHeader + COMMAND ${ROOTCLING_EXECUTABLE} --reflex -f ${gensrcdict} ${rootmapopts} ${headerfiles} ${selectionfile} --noIncludePaths --inlineInputHeader ${ARG_OPTIONS} ${includedirs} ${definitions} DEPENDS ${headerfiles} ${selectionfile}) endfunction() diff --git a/util/makefile-build/bdm-code-generation b/util/makefile-build/bdm-code-generation index 69e5ac0f5..09fd49152 100755 --- a/util/makefile-build/bdm-code-generation +++ b/util/makefile-build/bdm-code-generation @@ -58,7 +58,7 @@ CXX_INCLUDES=$(${BDM_CONFIG} --cxxincludes | sed 's|-isystem |-I|g') CXX_DEFINES=$(${BDM_CONFIG} --cxxdefines) -rootcling -reflex -f ${DICT} ${HEADERS} --noIncludePaths -inlineInputHeader ${SELECTIONFILE} ${CXX_DEFINES} ${CXX_INCLUDES} $ADDITIONAL_CXX_FLAGS +rootcling --reflex -f ${DICT} ${HEADERS} ${SELECTIONFILE} --noIncludePaths --inlineInputHeader ${CXX_DEFINES} ${CXX_INCLUDES} $ADDITIONAL_CXX_FLAGS # Generate bdm dictionary and append to DICT BDM_DICT=$(mktemp) From 3e1572c7d4f05f852fad48569cd44b91d8182b48 Mon Sep 17 00:00:00 2001 From: Isaac Morales Santana <102816007+imorlxs@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:09:30 +0200 Subject: [PATCH 12/13] Update .editorconfig --- .editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index febd8430e..bcd03e659 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,7 +6,7 @@ root = true charset = utf-8 end_of_line = lf insert_final_newline = true -trim_trailing_whitespace = false +trim_trailing_whitespace = true indent_style = space indent_size = 2 From 054caff4ecfaab18d02b6dbcb39703b920bd5388 Mon Sep 17 00:00:00 2001 From: Isaac Morales Date: Fri, 23 Aug 2024 11:08:23 +0200 Subject: [PATCH 13/13] Add --v2 flag to show warnings --- cmake/FindROOT.cmake | 2 +- util/makefile-build/bdm-code-generation | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/FindROOT.cmake b/cmake/FindROOT.cmake index 86b5bba60..fdad1f84d 100644 --- a/cmake/FindROOT.cmake +++ b/cmake/FindROOT.cmake @@ -196,7 +196,7 @@ function(REFLEX_GENERATE_DICTIONARY dictionary) #set(rootmapopts --rootmap=${rootmapname} --rootmap-lib=${libprefix}${dictionary}Dict) #---Actual command---------------------------------------- add_custom_command(OUTPUT ${gensrcdict} ${rootmapname} ${dictionary}_rdict.pcm - COMMAND ${ROOTCLING_EXECUTABLE} --reflex -f ${gensrcdict} ${rootmapopts} ${headerfiles} ${selectionfile} --noIncludePaths --inlineInputHeader + COMMAND ${ROOTCLING_EXECUTABLE} --reflex --v2 -f ${gensrcdict} ${rootmapopts} ${headerfiles} ${selectionfile} --noIncludePaths --inlineInputHeader ${ARG_OPTIONS} ${includedirs} ${definitions} DEPENDS ${headerfiles} ${selectionfile}) endfunction() diff --git a/util/makefile-build/bdm-code-generation b/util/makefile-build/bdm-code-generation index 09fd49152..cc78053ae 100755 --- a/util/makefile-build/bdm-code-generation +++ b/util/makefile-build/bdm-code-generation @@ -58,7 +58,7 @@ CXX_INCLUDES=$(${BDM_CONFIG} --cxxincludes | sed 's|-isystem |-I|g') CXX_DEFINES=$(${BDM_CONFIG} --cxxdefines) -rootcling --reflex -f ${DICT} ${HEADERS} ${SELECTIONFILE} --noIncludePaths --inlineInputHeader ${CXX_DEFINES} ${CXX_INCLUDES} $ADDITIONAL_CXX_FLAGS +rootcling --reflex --v2 -f ${DICT} ${HEADERS} ${SELECTIONFILE} --noIncludePaths --inlineInputHeader ${CXX_DEFINES} ${CXX_INCLUDES} $ADDITIONAL_CXX_FLAGS # Generate bdm dictionary and append to DICT BDM_DICT=$(mktemp)