Use the file() CREATE_LINK command to create symlinks when running ake - #1504
Use the file() CREATE_LINK command to create symlinks when running ake#1504jim-p-w wants to merge 1 commit into
Conversation
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
left a comment
There was a problem hiding this comment.
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.
fe57fe5 to
857d236
Compare
|
@fmahebert Thanks for the suggestion. I changed |
|
@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. |
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).