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 world builder to version 0.5.0. #5164
Conversation
3de97d4
to
c974d11
Compare
8e3ec34
to
f959c14
Compare
f959c14
to
dc0fdfe
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.
My comments so far. Now testing to compile against different worldbuilder versions on some of my systems.
CMakeLists.txt
Outdated
@@ -135,66 +135,71 @@ if(ASPECT_WITH_WORLD_BUILDER) | |||
MESSAGE(STATUS "World Builder not found. Using internal version.") | |||
SET(WORLD_BUILDER_SOURCE_DIR "${CMAKE_SOURCE_DIR}/contrib/world_builder/" CACHE PATH "" FORCE) | |||
ENDIF() | |||
|
|||
# add source and include dirs: | |||
MESSAGE(STATUS "Using World Builder version ${WORLD_BUILDER_VERSION} found at ${WORLD_BUILDER_SOURCE_DIR}.") |
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.
This line needs to be below 142 and 143 to give the correct WORLD_BUILDER_VERSION.
CMakeLists.txt
Outdated
SET(UNITY_WB_LAST_FILES | ||
"${WORLD_BUILDER_SOURCE_DIR}/source/parameters.cc") | ||
IF(WORLD_BUILDER_VERSION VERSION_GREATER_EQUAL 0.5.0 AND NOT WORLD_BUILDER_VERSION_LABEL MATCHES "pre") | ||
ADD_SUBDIRECTORY("${WORLD_BUILDER_SOURCE_DIR}" ${CMAKE_BINARY_DIR}/world_builder/ SYSTEM) |
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.
SYSTEM is a keyword that was only added in cmake 3.26.1. It works fine without the keyword for me (cmake 3.22).
@@ -16,35 +16,72 @@ if(POLICY CMP0058) | |||
endif() | |||
|
|||
# load in version info and export it | |||
SET(WORLD_BUILDER_SOURCE_DIR ${CMAKE_SOURCE_DIR}) | |||
INCLUDE("${CMAKE_SOURCE_DIR}/cmake/version.cmake") | |||
SET(WORLD_BUILDER_SOURCE_DIR ${PROJECT_SOURCE_DIR}) |
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.
Line 1 triggers a warning from my cmake (Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.). Requiring cmake 2.8.12 removes the warning and 2.8.12 was release in 2013, so I would guess there is no harm in increasing WorldBuilder's minimum cmake version to 2.8.12? ASPECT already requires cmake 3.1.0 so we could also just require a higher version for the worldbuilder version inside ASPECT.
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.
Currently the minimum cmake version in the world builder is 2.8.4, but that has been the case since probably version 0.3.0, so almost 3 year (but at least 2). I see no harm in, and I think it is a good idea to increase it to 2.8.12. I will make the changes.
SET(UNITY_WB_LAST_FILES | ||
"${WORLD_BUILDER_SOURCE_DIR}/source/world_builder/parameters.cc") | ||
ENDIF() | ||
IF(WORLD_BUILDER_VERSION VERSION_LESS 0.5.0) |
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.
If we bundle 0.5, we might as well set the minimum supported version to 0.5.
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.
Because there may be a lot of users out there with custom world builder files and versions below 0.5 release (us for example). World builder files for version 0.4 do not work with 0.5, and requiring 0.5 forces a lot of people to upgrade their workflow immediately after release of world builder 0.5. I would rather wait until the next ASPECT release before we do that.
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.
Are you sure it's worth it for us to be forward and backward compatible? If a user updates to a new aspect release we can also expect that they are willing to upgrade WB. There is value in bundling the oldest supported version to improve test coverage.
Anyways, not a big deal if you feel confident this will still work..
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.
Well we bundled 0.4.0 up to now, so we are sure it works at the moment. I am ok dropping support for World Builder 0.4.0 right after ASPECT's release, but I would like to keep it for the release. Mostly, to not surprise users who are currently using ASPECT's development environment and WB 0.4.0, then update the ASPECT version by a few days and suddenly need to use the bundled WB 0.5.0 immediately at the time of the WB release.
ec5488e
to
51d669d
Compare
So we found an issue with including the world builder cmake system into ASPECT's system that currently makes me think we should hold off on integrating the cmake changes immediately for this version (at least for the combination of world builder version and aspect release that we plan to ship for aspect 2.5). On clusters with compiler modules (at least on Frontera) world builder finds a different C/CXX/Fortran compiler than the one that is used by the MPI system (in my case it defaulted to the compilers in /usr/bin). This of course causes havoc when compiling. The system seems to work nicely on PC systems where the found compiler is usually the only one on the system. I can still compile on Frontera with the following additional lines in the ASPECT CMakeLists.txt before the call to
@tjhei: Do you have an idea for how to prevent a cmake project from finding the wrong compiler? the Menno: As discussed, I would like to still integrate the changes we made in this PR, we are much closer to using the cmake system now, just dont activate them yet for the combination of WB and ASPECT that we are going to release (we can activate it afterwards in aspects developer version). |
@gassmoeller, I have changed the check from 0.5.0-pre to 0.6.0(-pre) as discussed for now. If we can find a satisfactory solution before the release, we can change it back, otherwise we keep it. |
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.
Ok, this looks good to me then. Let's keep this PR open for a few days before merging to give others the chance to comment. But at least from ASPECT's side there should be no barrier left for the world builder release.
CMakeLists.txt
Outdated
@@ -135,66 +135,71 @@ if(ASPECT_WITH_WORLD_BUILDER) | |||
MESSAGE(STATUS "World Builder not found. Using internal version.") | |||
SET(WORLD_BUILDER_SOURCE_DIR "${CMAKE_SOURCE_DIR}/contrib/world_builder/" CACHE PATH "" FORCE) | |||
ENDIF() | |||
|
|||
# Always include the header files. | |||
|
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.
Remove whitespace
51d669d
to
92c9869
Compare
found a relevant quote on the issue we are having: https://cmake.org/pipermail/cmake/2011-June/045037.html
So that would mean we need to focus on getting the right c++ into the world builder and not the right mpi compiler. |
92c9869
to
46dd9b5
Compare
I think I may have found a solution, but I am currently unable to test it on stampede2. The idea is that since the world builder needs to select a good enough compiler (c++14 or higher), we can enforce that. My hope if that if it sees that the compiler it normally found isn't good enough, it will hopefully select the better one (and hopefully the same as aspect found). I have updated this pull request with the relevant cmake statement, let me know if it solve the issue for you. |
Yes, do not specify MPI compilers directly. I am a bit worried that other settings could also break this setup: compiler flags are handled correctly for example? What is the advantage of using the GWB cmake file? I am not aware of any advantages over including the files manually. If there are no big advantages, let's wait until after the release... |
It is build as a completely separate project, so it has its own compiler flags and then aspect links to the build library.
There are a few adantages. It simplifies the aspect cmake, it really separates out the world builder and enables unity build (although that could also be done within aspect), it provides users with the tools to quickly view initial conditions so that they don't have to run it aspect every time. Non of them are requires, or exclusive to this approach, but I thought this would be more clean within aspect. I agree that it would be good for this to have more time for testing. The current code does the previous approach for the bundled world builder, but will use the new approach for the next development version which users would have to point aspect to themselfs. Does this approach work for you Timo or do you want the new cmake code removed? |
Ok, interesting. What does GWB produce in this setup: a shared library, a static library, or an object file? |
hmm, good question. I think it is static. It was a bit of a hunt in the cmake manual, but here are the revelant links:
|
It is build as a static library in Not sure if this is the best option, or if it matters. I find it a bit weird that is is installed into bin/ and not lib/, @MFraters I think this is caused by world_builder CMakelists:544. @tjhei: Would you prefer Menno split this into two PRs, one that includes the new WB version but the current cmake system, and then another PR that includes the cmake changes? We would like to release the new WB version as soon as possible to do some testing before the release, but the cmake changes are not critical right now. |
If it is a static library, it doesn't need to be installed at all because it will be linked into the aspect binary. We do need to be careful to have identical compiler flags. Imagine ASPECT and GWB having different c++ standard flags for example. |
Up to you guys. I am ok merging both if you think it's ready. I would assume most users of ASPECT releases use the bundled GWB anyways. |
I think this PR is ready. In the current form the new cmake system is disabled until either a user compiles against a new non-bundled worldbuilder or until we bundle the next world builder release or decide to manually activate it. The new system already works fine on regular systems (only clusters can make problems). I agree we need to find a solution to ensure the same compiler and flags, but I think we can handle that later. Maybe we can let the bundled worldbuilder cmakelists modify to use the deal.II macros? @MFraters: Want to go ahead with the world builder release? When that is done we can merge this PR. |
ok, sounds good. I will make the release and update this pull request. |
46dd9b5
to
5c745d1
Compare
The world builder has been released and I have added a changelog entry for aspect. I think this pull request is now ready :) |
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.
Good to go then. Thanks
This is a work in progress pull request for updating the world builder. It does two things:
Do not merge! Merging needs to wait until the release is done, but I would like approval of this pull request before I make the release. I have made a todo here: GeodynamicWorldBuilder/WorldBuilder#493
Reviews are very welcome!