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 CMake support #536

Merged
merged 15 commits into from
Jun 21, 2024
Merged

add CMake support #536

merged 15 commits into from
Jun 21, 2024

Conversation

tukss
Copy link
Contributor

@tukss tukss commented Jun 19, 2024

This adds support for building Rayleigh using CMake. It is purely optional and does not interfere with the traditional, configure-based approach.

You can try it like this:

cmake -B build
cmake --build build -j

The rayleigh executable will be placed in build/src.

Todo:

  • Fix Run_Param_Header.F. The Fortran flags are currently missing. The linker flags have a SHELL: prefix.
  • Document CMake build procedure including how to make Debug and Release builds.
  • Test on more systems, in particular MKL based ones.
  • Add CI tests for the CMake build.
  • Install the executable in bin.

@gassmoeller
Copy link
Member

Oh, I am glad I didnt make the PR ;-). Did you see #281? I am not sure what we can use from there, but it is worth checking. I am happy to test this branch on my system.

@tukss
Copy link
Contributor Author

tukss commented Jun 19, 2024

Thanks for pointing that out. I've checked and I think the new CMake is already more advanced. In particular the handling of Run_Param_Headers.F and MPI.

@tukss
Copy link
Contributor Author

tukss commented Jun 19, 2024

As a bonus we get support for the new LLVM-based Intel ifx compiler for free.

Copy link
Member

@gassmoeller gassmoeller left a comment

Choose a reason for hiding this comment

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

The system already works well for me. Some small suggestions for the CMakeLists.

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@tukss
Copy link
Contributor Author

tukss commented Jun 19, 2024

It even works fine on Cray systems with the cray-fftw. The main thing I still want to try is pleiades.

@gassmoeller
Copy link
Member

I tested the build on the NSF/TACC systems Stampede3 and Frontera, both use Intel compilers and MKL. I used Intel icc 19.1 on Frontera, and Intel 2024 (the new clang based) on Stampede3. Both worked fine, except I needed to load the fftw3 module.

@tukss tukss force-pushed the cmake branch 9 times, most recently from 80e1f71 to 1d1ecae Compare June 21, 2024 05:43
@tukss tukss marked this pull request as ready for review June 21, 2024 05:50
@tukss
Copy link
Contributor Author

tukss commented Jun 21, 2024

I think this is ready now.

When I added the test, I got an error with the macOS tester because it passed -fallow-argument-mismatch to the clang compiler there. The problem goes away by switching to openmpi, which supports the F08 interface. I don't recall why we used mpich before but we should talk about that.

@tukss tukss force-pushed the cmake branch 2 times, most recently from 4680f45 to 8bfcd35 Compare June 21, 2024 16:22
@tukss
Copy link
Contributor Author

tukss commented Jun 21, 2024

@feathern We have a changelog entry now. Feel free to merge it at any time.

Copy link
Contributor

@feathern feathern left a comment

Choose a reason for hiding this comment

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

Looks good -- approved.

@feathern feathern merged commit 068a1f2 into geodynamics:main Jun 21, 2024
7 checks passed
@tukss tukss deleted the cmake branch June 21, 2024 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants