Skip to content

CMake installation method#30

Merged
fmalatino merged 26 commits intoNOAA-GFDL:mainfrom
fmalatino:cmake
Mar 23, 2026
Merged

CMake installation method#30
fmalatino merged 26 commits intoNOAA-GFDL:mainfrom
fmalatino:cmake

Conversation

@fmalatino
Copy link
Copy Markdown
Contributor

@fmalatino fmalatino commented Mar 6, 2026

Description
This PR introduces a method for installing cFMS through CMake. This will enable changes within pyFMS to move away from the current install method, which relies on interrupting the build method of setuptools to run a shell script to installFMS and cFMS. A subsequent PR in pyFMS will change the build backend of the package to scikit-build-core, which allows for CMake based installations of extension modules for Python packages.

As is seen in the CMakeLists.txt, FMS can either be installed via a call to FetchContent or add_subdirectory methods of CMake. If the former is used, FMS would no longer be required as a submodule to cFMS, as it would be installed directly from its GitHub repository. The latter method was chosen for this PR given the current structure of the cFMS repository.

This PR should be reviewed after the merge of PR 1850 in FMS, which will prevent the automatic building of the FMS unit tests.

@fmalatino fmalatino marked this pull request as ready for review March 16, 2026 14:17
@fmalatino fmalatino requested review from mlee03 and rem1776 March 16, 2026 14:17
Copy link
Copy Markdown
Contributor

@rem1776 rem1776 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@mlee03 mlee03 left a comment

Choose a reason for hiding this comment

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

Thinking about a future where a build change needs to be made, I think I prefer to have one main CMakeLists.txt that needs to be changed instead of having one for each module. But I'm no expert and I will go with what you guys decide :)

Comment thread c_fms/c_fms.F90
@fmalatino fmalatino merged commit 5fd0c52 into NOAA-GFDL:main Mar 23, 2026
3 checks passed
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.

3 participants