Skip to content

Use the file() CREATE_LINK command to create symlinks when running ake - #1504

Open
jim-p-w wants to merge 1 commit into
MPAS-Dev:developfrom
jim-p-w:feature/cmake-symlink
Open

Use the file() CREATE_LINK command to create symlinks when running ake#1504
jim-p-w wants to merge 1 commit into
MPAS-Dev:developfrom
jim-p-w:feature/cmake-symlink

Conversation

@jim-p-w

@jim-p-w jim-p-w commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

This PR replaces the cmake execute_process() command with the file() command to create symlinks.

Using execute_process to make symlinks is expensive; it spawns a new cmake process.
The file() command is more efficient; it makes the symlink in the currently executing cmake process.

This was tested by running cmake directly against a clone of the MPAS-Model repository, as well
as running cmake against a clone of the mpas-bundle repository (which include MPAS-Model).

@mgduda mgduda added Atmosphere Build System Changes related to the build system, either `Make` or `CMake`. labels Aug 19, 2026
@mgduda
mgduda requested review from byoung-joo and mgduda August 19, 2026 18:52
@mgduda

mgduda commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

@svahl991 -- @jim-p-w suggested adding you as a reviewer as well. If you'd like, I can first add you as a collaborator, then add you as a formal reviewer. Otherwise, if you'd just like to comment on the PR, that should be fine, too.

Comment thread src/core_atmosphere/CMakeLists.txt Outdated
@svahl991

Copy link
Copy Markdown
Contributor

@svahl991 -- @jim-p-w suggested adding you as a reviewer as well. If you'd like, I can first add you as a collaborator, then add you as a formal reviewer. Otherwise, if you'd just like to comment on the PR, that should be fine, too.

This looks fine to me, but I will also pass this buck down the line to @fmahebert, who was the one who put together all the PR's similar to this one in the JEDI repositories.

@fmahebert fmahebert left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This matches what I'd expect based on what I did in JEDI.

My only suggestion would be to make sure cmake_minimum_required(VERSION 3.14) is specified, for CREATE_LINK support.

Thanks, @jim-p-w !

(Context for those not following JEDI repo developments: doing this change across most of jedi-bundle repos eliminated ~4000 subprocess launches. That saves ~7 seconds of CMake configuration time on a Apple M2 based dev system, and >60 seconds on one HPC system with a network filesystem (and perhaps policies that limit process launching?). The benefit in any particular repo would be proportional to the number of symlinks/processes involved in the configuration.)

…ake.

Using execute_process to make symlinks is expensive; it spawns a new
cmake process.
The file() command is more efficient; it makes the symlink in the
currently executing cmake process.
@jim-p-w
jim-p-w force-pushed the feature/cmake-symlink branch from fe57fe5 to 857d236 Compare August 20, 2026 16:45
@jim-p-w

jim-p-w commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

@fmahebert Thanks for the suggestion. I changed cmake_minimum_required from 3.12 to 3.26 (which was released in 2023 and is the oldest version currently available on derecho).

@fmahebert

Copy link
Copy Markdown

@jim-p-w sounds good, thanks — for those of at JCSDA, we've had access to CMake 3.27+ since spack-stack 1.8 from two years ago, so shouldn't be a problem.

@fmahebert fmahebert left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

non-expert review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Atmosphere Build System Changes related to the build system, either `Make` or `CMake`.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants