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

Replace genreflex in favor of rootcling #379

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Get rid of genreflex instances
imorlxs committed Jul 24, 2024
commit 0c3e4c9808ab694d63e30433323e05f8fe34f1b8
4 changes: 2 additions & 2 deletions cmake/BioDynaMo.cmake
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 1 addition & 3 deletions cmake/FindROOT.cmake
Original file line number Diff line number Diff line change
@@ -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()
5 changes: 2 additions & 3 deletions cmake/utils.cmake
Original file line number Diff line number Diff line change
@@ -109,7 +109,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
@@ -549,12 +548,12 @@ Unset the environment variable BDM_LOCAL_LFS to download the file.")
DOWNLOAD_DIR ${DEST_PARENT}
SOURCE_DIR ${DEST}
)

FetchContent_GetProperties(${TAR_FILENAME})
if (NOT ${TAR_FILENAME}_POPULATED)
FetchContent_Populate(${TAR_FILENAME})
endif()

# Remove subbuild files, we don't need them
file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/_deps/)
endif()
2 changes: 1 addition & 1 deletion util/makefile-build/bdm-code-generation
Original file line number Diff line number Diff line change
@@ -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)