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

CMake changes for ASPECT DebugRelease mode #686

Merged
merged 3 commits into from
Mar 2, 2024

Conversation

tjhei
Copy link
Contributor

@tjhei tjhei commented Feb 28, 2024

This PR adds a number of CMake options to rename the name of the gwb library and to disable certain targets/features. This change allows us to configure a debug and a release mode build of GWB when ASPECT is configured as DebugRelease mode.

This PR should not change anything in the default configuration.

tjhei added a commit to tjhei/aspect that referenced this pull request Feb 28, 2024
We incorrectly always only built the debug version of an external GWB
version 0.6 or newer if ASPECT was in DebugRelease mode. With
GeodynamicWorldBuilder/WorldBuilder#686 we can
now configure GWB twice inside the build directory of ASPECT and link to
the correct library.
tjhei added a commit to tjhei/aspect that referenced this pull request Feb 28, 2024
We incorrectly always only built the debug version of an external GWB
version 0.6 or newer if ASPECT was in DebugRelease mode. With
GeodynamicWorldBuilder/WorldBuilder#686 we can
now configure GWB twice inside the build directory of ASPECT and link to
the correct library.
tjhei added a commit to tjhei/aspect that referenced this pull request Feb 28, 2024
We incorrectly always only built the debug version of an external GWB
version 0.6 or newer if ASPECT was in DebugRelease mode. With
GeodynamicWorldBuilder/WorldBuilder#686 we can
now configure GWB twice inside the build directory of ASPECT and link to
the correct library.
Copy link

github-actions bot commented Feb 28, 2024

Benchmark Main Feature Difference (99.9% CI)
Slab interpolation simple none 1.018 ± 0.005 (s=443) 1.015 ± 0.004 (s=445) -0.5% .. -0.3%
Slab interpolation curved simple none 1.014 ± 0.003 (s=451) 1.017 ± 0.003 (s=438) +0.2% .. +0.3%
Spherical slab interpolation simple none 1.166 ± 0.005 (s=376) 1.167 ± 0.005 (s=398) -0.0% .. +0.2%
Slab interpolation simple curved CMS 1.066 ± 0.005 (s=413) 1.067 ± 0.004 (s=433) +0.1% .. +0.3%
Spherical slab interpolation simple CMS 1.550 ± 0.011 (s=302) 1.549 ± 0.009 (s=281) -0.2% .. +0.1%
Spherical fault interpolation simple none 1.173 ± 0.007 (s=398) 1.172 ± 0.006 (s=372) -0.2% .. +0.0%
Cartesian min max surface 2.309 ± 0.022 (s=194) 2.305 ± 0.015 (s=199) -0.5% .. +0.1%
Spherical min max surface 7.213 ± 0.054 (s=60) 7.200 ± 0.038 (s=67) -0.6% .. +0.2%

CMakeLists.txt Outdated
@@ -528,7 +551,7 @@ if(MAKE_PYTHON_WRAPPER)
endif()
endif()

set_target_properties(${TARGET} PROPERTIES PREFIX "_" OUTPUT_NAME "gwb")
set_target_properties(${WB_TARGET} PROPERTIES PREFIX "_" OUTPUT_NAME "gwb")
Copy link
Member

Choose a reason for hiding this comment

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

This change seem sot be tripping it up. Note that ${TARGET} is not equal to WorldBuilder but to either _gwb or gwb.

The main problem is that the c/cpp/fortran examples expect a library called libWorldBuilder.a, which with this change is no longer generated, but it instead generated _gwb.a. Commenting out the line seems to let the testers pass on my system. I think this line may have been faulty an not executed.

@MFraters MFraters mentioned this pull request Feb 29, 2024
11 tasks
Copy link

codecov bot commented Feb 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.31%. Comparing base (786dc8a) to head (51d965f).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #686      +/-   ##
==========================================
+ Coverage   98.30%   98.31%   +0.01%     
==========================================
  Files         107      107              
  Lines        7358     7358              
==========================================
+ Hits         7233     7234       +1     
+ Misses        125      124       -1     

see 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 786dc8a...51d965f. Read the comment docs.

@tjhei
Copy link
Contributor Author

tjhei commented Feb 29, 2024

okay, seems to work now. Thank you, @MFraters . The script is somewhat messy, but I don't know of a better way to make this work within ASPECT. What do you think?
The only alternative I can think of is that you also support a DebugRelease mode (similar to deal.II where two libary files are produced). This is not a very typical thing to do and maybe not worth the headache.

Copy link
Member

@MFraters MFraters left a comment

Choose a reason for hiding this comment

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

Thanks for your work on this @tjhei! Although supporting DebugRelease in the future would be great, I don't think it needs to be done now.

I have two small comments on the new cmake variables, but otherwise it looks good to me.

CMakeLists.txt Outdated
set(WB_ENABLE_APPS ON CACHE BOOL "If enabled, applications gwb-grid and gwb-dat are built.")
set(WB_ENABLE_HELPER_TARGETS ON CACHE BOOL "If enabled, targets to indenting and switching to debug/release mode are configured.")
set(WB_ENABLE_TESTS ON CACHE BOOL "If enabled, tests are configured.")
set(WB_ENABLE_DOCUMENTATION ON CACHE BOOL "If enabled, building of the documentation is configured.")
Copy link
Member

Choose a reason for hiding this comment

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

There is already an option called WB_BUILD_DOCUMENTATION in doc/CMakeList.txt. I am fine with removing that in favor of WB_ENABLE_DOCUMENTATION, but that would need to be done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the option I introduced also doesn't do anything. :-) removed.

@@ -40,6 +40,12 @@ ENDIF()

set (WORLD_BUILDER_SOURCE_DIR ${PROJECT_SOURCE_DIR})

# define some config options:
set(WB_ENABLE_APPS ON CACHE BOOL "If enabled, applications gwb-grid and gwb-dat are built.")
Copy link
Member

Choose a reason for hiding this comment

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

The apps are used in the tester, so if this is off and the testers are on, it needs to only run the tests which do not require either gwb-grid or gwb-dat. Can you add a github tester which turns off the apps, but leaves the tester on?

Copy link
Member

Choose a reason for hiding this comment

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

For the test, please put it in test.yml and set needs: [test_indentation,coverage]. If you want me to add the tester, let me know, I am happy to do it.

@tjhei
Copy link
Contributor Author

tjhei commented Mar 2, 2024

Ok, this should be good to go. Would you mind adding the additional CI step, @MFraters ?

tjhei added 2 commits March 1, 2024 20:26
This PR adds a number of CMake options to rename the name of the gwb
library and to disable certain targets/features. This change allows us
to configure a debug and a release mode build of GWB when ASPECT is
configured as DebugRelease mode.
@tjhei tjhei force-pushed the cmake-subproject branch from 57f075b to d148e94 Compare March 2, 2024 01:26
Copy link
Member

@MFraters MFraters left a comment

Choose a reason for hiding this comment

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

Sure, I will make a follow up pull request for that. Thanks for working on this!

@MFraters MFraters merged commit 6131388 into GeodynamicWorldBuilder:main Mar 2, 2024
34 of 35 checks passed
@tjhei tjhei deleted the cmake-subproject branch March 2, 2024 01:54
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.

2 participants