-
Notifications
You must be signed in to change notification settings - Fork 16
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
base: dev
Are you sure you want to change the base?
Update cmake #275
Conversation
f677e22
to
d09d548
Compare
There was a problem hiding this 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.
@@ -1,5 +1,8 @@ | |||
name: Continuous Integration | |||
on: [push, pull_request] | |||
env: | |||
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of interest: Is this variable also required in normal workflows or will the cache by default places somewhere relative to the build folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Offline discussion: This is not required but recommended. If not set, CPM will redownload for every new build directory. The downloaded files will be put into a local folder inside the build directory (if I recall correctly). The discussion led to another comment: We should document the option to not cache unstable dependencies (like the alpaka dev branch).
@@ -18,26 +21,25 @@ jobs: | |||
runs-on: ubuntu-latest | |||
steps: | |||
- uses: actions/checkout@v4 | |||
- uses: actions/cache@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is all this configuration required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not required but supposed to slightly speed up CI runs by caching downloads. The CI here is only provisional at this point anyways. But concerning caching we should document the option to explicitly disable caching for unstable dependencies.
NAMESPACE ${PROJECT_NAME} | ||
BINARY_DIR ${PROJECT_BINARY_DIR} | ||
INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include | ||
INCLUDE_DESTINATION include/${PROJECT_NAME}-${PROJECT_VERSION} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after installing, are all files in include/malloc-3.0.0/mallocMC/*
?
cmake/tools.cmake
Outdated
|
||
# enables sanitizers support using the the `USE_SANITIZER` flag available values are: Address, | ||
# Memory, MemoryWithOrigins, Undefined, Thread, Leak, 'Address;Undefined' | ||
if(USE_SANITIZER OR USE_STATIC_ANALYZER) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the variables should have the prefix mallocMC_
cmake/tools.cmake
Outdated
endif() | ||
|
||
# enables CCACHE support through the USE_CCACHE flag possible values are: YES, NO or equivalent | ||
if(USE_CCACHE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be mallocMC_USE_CCACHE
examples/vectorAdd/CMakeLists.txt
Outdated
|
||
# --- Import tools ---- | ||
|
||
include(../../cmake/tools.cmake) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should all ../..
start with ${CMAKE_CURRENT_LIST_DIR}/../..
?
test/multithreaded/CMakeLists.txt
Outdated
|
||
# --- Import tools ---- | ||
|
||
include(../../cmake/tools.cmake) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe ${CMAKE_CURRENT_LIST_DIR}/../..
?
test/unit/CMakeLists.txt
Outdated
|
||
# ---- Options ---- | ||
|
||
option(ENABLE_TEST_COVERAGE "Enable test coverage" OFF) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those variables should start with mallocMC_
to clearly show the users that mallocMC behaviour is changed.
This will also group all variables of mallocMC which helps finding all possible cmake switches.
5680693
to
8a80fb1
Compare
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:
CMakeLists.txt
that provides the library and optionally includes tests and examples viamallocMC_BUILD_TESTING/EXAMPLES
.include
,examples
andtest
. The latter two are self-contained cmake subdirectories that can be built independently.mallocMC_USE_...
allowingON
(no downloading),ON_ALLOW_FETCH
(default if required),ON_ALWAYS_FETCH
(for best reproducibility),AUTO
(default for optional dependencies) andOFF
. Alternatively, the variable is allowed to contain a path pointing to the source location for this dependency.cmake/package-lock.cmake
. Only ever touch this, if you want to change a version or the like. (Updatingalpaka
should be significantly less painful now.)-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.