-
Notifications
You must be signed in to change notification settings - Fork 11
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
Modernize CMake #99
Modernize CMake #99
Conversation
Does the Code Style step use cmake-format? |
Yes, I think cmake-format is used on all CMake files. |
Oh, sorry I somehow missed that, I'll check how it looks when formatted with cmake-format, depending on the outcome I might tweak it's config a little (I'm mostly not too much of a fan of cmake-formats output by default because it makes some parts less readable imo) Edit: Also interesting that the Linux build fails due to missing OpenGL, |
If you refactored the whole CMake file with CPM in a nicely readable way, we could also consider dropping the cmake-format coding style condition. Check if the cmake-format output is very off, otherwise you could still apply it to the CMakeLists file. |
Will do 👍 |
I think CMake-Format version also looks fine in this case. This way it might also be easier for other people to adhere to the coding style. Could then please update your code with the format-project.sh script? |
Will do! |
Curiously some of the tests (FileWriter, Serialize and VisualizationMesh) failed because the sanitizer found some errors:
We should probably investigate those further |
@@ -30,22 +30,24 @@ jobs: | |||
key: viennals-dependency-cache-${{ runner.os }}-${{env.BUILD_TYPE}}-${{ hashFiles( './external/upstream/**CMakeLists.txt' ) }} |
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.
https://github.com/cpm-cmake/CPM.cmake?tab=readme-ov-file#cpm_source_cache
We should use the CPM_SOURCE_CACHE in the workflows to cache
I've disabled the sanitizer by default currently - To see if the functionality works as intended. Let me know if we should re-enable the sanitizer by default for debug builds or leave it as opt-in. I could also simplify the workflows a little by using actions to move steps that are commonly duplicated into a single action that can be re-used but I'd rather make a separate PR for that ^^ Edit: Also, we could add a linux workflow that installs vtk (and maybe others as well, for example pybind) as a system dependency to make sure that CPM finds the system dependencies correctly but mainly just so that we can have quicker feedback on the workflow test runs |
I think it is good to have the sanitizer on for the tests. But since there are currently some issues with the tests, we could disable it for now and then enable it later when everything is fixed.
That would be nice ^^
Normally, the vtk build should be cached such that the dependencies can be set up quickly. But I am not sure if this only works on workflows on the master branch. Also, currently, CPM looks specifically for VTK 9.3.0. Since I only have VTK 9.1.0 installed on my system, it did not use the system installation but downloaded and built version 9.3.0. Since we are not using any super recent VTK functionalities, it would definitely be enough to use any VTK version >9.0. Is it possible for CPM to look for any VTK version >9.0? |
The caching is currently broken due to the CPM switch - I'll fix it and then we can just rely on that
I'll look into it! |
Also, the Windows workflow is currently failing because of this upstream issue: https://gitlab.kitware.com/vtk/vtk/-/issues/19166 So it should be fixed by upgrading to vtk 9.3.1 (as soon as that's available) |
* This should also fix the windows workflows as we've switched to a commit that includes upstream!10542
This should be fixed now, let me know if it works on your machine (And let's hope the windows workflow properly builds now ^^) Edit: Seems like the tests build properly on windows now, however it has trouble finding some DLLs, unfortunately the CLI output does not indicate which ones, so I guess I'll have to set this up in a VM on the Weekend |
* early return behavior in macro may vary in different cmake versions
Features
CMakeLists.txt
Fix some shellcheck warnings in
format-project.sh
Add missing
<cstdint>
include inlsPointData.hpp
To Discuss
I have currently incorporated the wholeCPM.cmake
file (which is the recommended installation method), however we could also use theget_cpm
script which downloads the specified CPM version once and then reuses itThis has the drawback that full offline builds will get more difficultThe folders
Python
,Examples
andTests
use different casing than the other folders, should we consider renaming them to all lower case?The doxygen documentation is present in the root folder, maybe we should consider removing it from git¹ and instead let the user generate it on demand?
ViennaHRLE
has no tags currently - If it had tags we could handle the versioning of it as a dependency betterIt is common practice to have all headers reside in a sub-directory, i.e.
<ls/advect.hpp>
instead of<lsAdvect.hpp>
, which would also simplify the install target slightly, maybe we should consider moving the headers into a sub-directory and therefore remove theirls
prefix?¹ or have it in a dedicated Github-Pages branch instead of master
Breaking / Important Changes
Things I've tested