geodynamics / Rayleigh

Rayleigh: Pseudo-spectral MHD
GNU General Public License v3.0
59 stars 49 forks source link

add CMake support #536

Closed tukss closed 1 month ago

tukss commented 1 month ago

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:

gassmoeller commented 1 month ago

Oh, I am glad I didnt make the PR ;-). Did you see https://github.com/geodynamics/Rayleigh/pull/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 commented 1 month ago

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 commented 1 month ago

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

tukss commented 1 month ago

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

gassmoeller commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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