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

Add AMReX_SPACEDIM flag to CMake configure step #142

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

BenWibking
Copy link
Contributor

@BenWibking BenWibking commented Jun 17, 2024

This adds -DAMReX_SPACEDIM= to the CMake configure step when building tests.

Closes #138.

@zingale
Copy link
Member

zingale commented Jun 17, 2024

@ax3l is this change okay with you?

Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!
We added this manually so far, but this is better 👍

https://github.com/ECP-WarpX/WarpX/blob/24.06/Regression/WarpX-tests.ini#L1857-L1859

@ax3l
Copy link
Member

ax3l commented Jun 17, 2024

Oh, well, technically in CMake we delegate this to application code (e.g., WarpX_DIMS, ImpactX_DIMS), which then sets the option for AMReX in superbuilds, too.

This PR only sets AMReX_SPACEDIM, which we usually do not user-configure from applications.

Maybe we could add an option how we like to call the CMake dims variable to the general config to abstract this?

@BenWibking
Copy link
Contributor Author

Oh, well, technically in CMake we delegate this to application code (e.g., WarpX_DIMS, ImpactX_DIMS), which then sets the option for AMReX in superbuilds, too.

This PR only sets AMReX_SPACEDIM, which we usually do not user-configure from applications.

In Quokka, we set AMReX_SPACEDIM directly. Is this a reason to prefer setting another app-specific parameter instead, and then set AMReX_SPACEDIM in the app's CMakeList.txt?

@ax3l
Copy link
Member

ax3l commented Jun 17, 2024

Yes, abstraction. They are different software packages. In practice AMReX can be pre-installed, with 3 different dims at a time. We might just want to build a specific dim or 2 out of three dims of our app.

@BenWibking
Copy link
Contributor Author

Ah, ok. That makes sense. We have always done superbuilds.

But in any case, having a var to change the name of the dim parameter makes sense to me.

@zingale zingale merged commit 26425d9 into AMReX-Codes:main Jun 19, 2024
1 check failed
@BenWibking BenWibking deleted the add_amrex_spacedim_cmake branch June 19, 2024 16:44
@ax3l
Copy link
Member

ax3l commented Jun 19, 2024

Oops, should have removed approval. I think we should first add the extra option we mentioned

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.

does this work with CMake app builds?
3 participants