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

Update cmake #275

Merged
merged 22 commits into from
Jan 23, 2025
Merged

Update cmake #275

merged 22 commits into from
Jan 23, 2025

Conversation

chillenzer
Copy link
Contributor

@chillenzer chillenzer commented Jan 15, 2025

This is a major reorganisation of the repository including setting up proper CMake support. It is strongly inspired by ModernCppStarter with some notable changes resulting from discussion with and preferences of @psychocoderHPC. As kind of a byproduct, also includes some modern features that are however not yet tweaked to production quality.

This PR is tested with KitGenBench and picongpu. Hint for the review: The first commit removes alpaka and is quite unwieldy. Viewing the diff from the second commit on shows that it's really just cmake stuff and files moved.

I'll try to summarise the new layout and features:

  • The main directory now provides a CMakeLists.txt that provides the library and optionally includes tests and examples via mallocMC_BUILD_TESTING/EXAMPLES.
  • Directories containing source code are include, examples and test. The latter two are self-contained cmake subdirectories that can be built independently.
  • All external source code is removed from the repository (except for a patched version of CPM).
  • CPM is used for adding dependencies. This means that given internet access the library is fully self-contained and can download and build all dependencies itself if it must.
  • Fine-grained control over the dependencies' origin is provided by variables of the form mallocMC_USE_... allowing ON (no downloading), ON_ALLOW_FETCH (default if required), ON_ALWAYS_FETCH (for best reproducibility), AUTO (default for optional dependencies) and OFF. Alternatively, the variable is allowed to contain a path pointing to the source location for this dependency.
  • All details about the dependencies are specified in cmake/package-lock.cmake. Only ever touch this, if you want to change a version or the like. (Updating alpaka should be significantly less painful now.)
  • Without internet connection one can simply download dependencies on another computer specifying the -DCPM_SOURCE_CACHE=/some/convenient/path, copy that to the offline system and point the same variable there for the build -DCPM_SOURCE_CACHE=/where/you/copied/the/source/cache. This is probably the closest we can get to offline support without shipping external code.
  • In copying over from ModernCppStarter, we acquired a number of tools including platform-independent sanitizer, static analysis and code coverage support. At the time of writing, this is not yet properly configured and would need some tinkering with to produce useful output. (Currently, it can be run but most warnings I've seen are about alpaka and Catch2. It's hard to say at this point if there are useful messages about mallocMC among the noise.)

@chillenzer chillenzer force-pushed the update-cmake branch 6 times, most recently from f677e22 to d09d548 Compare January 16, 2025 07:45
@chillenzer chillenzer marked this pull request as ready for review January 16, 2025 07:51
@psychocoderHPC psychocoderHPC added this to the 3.0.0 milestone Jan 17, 2025
Copy link
Member

@psychocoderHPC psychocoderHPC left a comment

Choose a reason for hiding this comment

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

mostly variables without prefix mallocMC_ were exposed.

.github/workflows/ci.yml Show resolved Hide resolved
.github/workflows/ci.yml Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
cmake/tools.cmake Outdated Show resolved Hide resolved
cmake/tools.cmake Outdated Show resolved Hide resolved
examples/vectorAdd/CMakeLists.txt Outdated Show resolved Hide resolved
test/multithreaded/CMakeLists.txt Outdated Show resolved Hide resolved
test/unit/CMakeLists.txt Outdated Show resolved Hide resolved
@psychocoderHPC psychocoderHPC merged commit cd4e065 into alpaka-group:dev Jan 23, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants