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

Replacing in-built sio with FetchContent mechanism #181

Merged
merged 5 commits into from
Dec 6, 2023

Conversation

arummler
Copy link
Contributor

@arummler arummler commented Dec 3, 2023

BEGINRELEASENOTES

  • Replace the copy of SIO that is used for builtin SIO support with the necessary cmake configuration to fetch it on the fly via CMake's FetchContent as this simplifies the maintenance of the vendored version of SIO greatly. This is a transparent change for users, as long as internet connection to fetch the SIO sources during building is available

ENDRELEASENOTES

Full build which can be still stripped down by setting the cmake args. Also explicit check for in-built SIO can be replaced by commented our FetchContent argument. Proposal for realising #179

Copy link
Contributor

@tmadlener tmadlener left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I think this looks good. Just kicked off CI. Let me also briefly check how our CI coverage is for this or whether there is some tweaking to do there as well.

CMakeLists.txt Outdated Show resolved Hide resolved
tests/CMakeLists.txt Outdated Show resolved Hide resolved
@tmadlener
Copy link
Contributor

One of the workflows seems to have an issue with the root dictionary genaration: https://github.com/iLCSoft/LCIO/actions/runs/7086894395/job/19286078781?pr=181#step:4:473

This looks a bit like some missing include directories, resp. root being too old in that environment to pick them up from the targets

@tmadlener
Copy link
Contributor

My suspicion is that we are missing an SIO::sio here:

TARGET_LINK_LIBRARIES( lcioDict ${ROOT_LIBRARIES} lcio )

@arummler
Copy link
Contributor Author

arummler commented Dec 4, 2023

Okay, I had tested locally only with the newest root 6.30.02. Always cutting edge. I will try to add it.

@tmadlener
Copy link
Contributor

Yes, it seems to get better with newer root version at least in CI. If we can get nothing to work here easily, we can also just upgrade CI, as we are most likely not using a builtin SIO on systems that still run on effectively LCG_97.

@arummler
Copy link
Contributor Author

arummler commented Dec 4, 2023

I guess you will have to update the CI to Alma 9 soon anyhow due to EOL of CC7. At least in ATLAS we are in the middle of the migration and should be concluded until the end of the YETS.

@arummler
Copy link
Contributor Author

arummler commented Dec 4, 2023

Hmm, I think the SIO includes might not be properly filled here:

# include directories to be passed over to rootcint
SET( ROOT_DICT_INCLUDE_DIRS
    ${LCIO_AID_HEADERS_OUTPUT_DIR}
    ${LCIO_CXX_HEADERS_DIR}
    ${SIO_INCLUDE_DIRS}

Probably one needs to have BUILD_ROOTDICT define a proper target which depends then on SIO.

@tmadlener
Copy link
Contributor

tmadlener commented Dec 4, 2023

Ah that would make sense because the SIO_INCLUDE_DIRS are only set n SIO when it is find_packaged:

https://github.com/iLCSoft/SIO/blob/37eeb0aba1b5161bcc8f60f1e76b2d0df889bff6/cmake/SIOConfig.cmake.in#L28-L30

So maybe a get_target_property to get back the include dirs from the SIO::sio target does the trick for now.

GIT_TAG v00-01
GIT_SHALLOW 1
# FIND_PACKAGE_ARGS
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
)
)
get_target_property(SIO_VERSION SIO::sio VERSION)
get_target_property(SIO_INCLUDE_DIRS SIO::sio INCLUDE_DIRECTORIES)

Just saw that these are use in a print out just here below and with FetchContent they are empty. This should hopefully also fix the ROOT dictionary issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sorry for delay, got only now around to it. Workaround works; I had previously not generated the rootDicts so I did not see the problem. It naturally is independent of the version. For the moment it should be okay but using root_generate_dictionary from the modern root cmake instead of the self made macros in MacroRootDict.cmake, the relevant target and MODULE option is I guess the way to go:
https://cliutils.gitlab.io/modern-cmake/chapters/packages/ROOT.html
root-project/root#8308

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries. Thanks for putting in the work :)

Yeah, switching to a more modern approach here has been on my list for quite some time, but haven't yet had time to come around to that.

@tmadlener tmadlener linked an issue Dec 6, 2023 that may be closed by this pull request
@tmadlener tmadlener merged commit 3687a34 into iLCSoft:master Dec 6, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use sio via git submodules
2 participants