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

cmake: don't recompile at each build #60

Closed
wants to merge 1 commit into from

Conversation

dguibert
Copy link
Collaborator

Without this patch, the file fesom_version_info-generated.F90 is generated
at each build, rebuilding all its dependencies up to the fesom executable.

The patch generates the fesom_version_info-generated.F90 only when the
FESOM_GIT_SHA value changes to reflect the current git status at the
time of building Fesom.
With this patch it allows to not recompile Fesom if not necessary. For
example calling make; make (in a row), without any new commits between
the two make will compile fesom only once. Currently, with this example,
fesom_version_info-generated.F90 is recompiled because of a new
timestamp, thus recompiling fesom.

@hegish
Copy link
Collaborator

hegish commented Jan 27, 2021

not working for me, I get
fatal: not a git repository (or any of the parent directories): .git
when running cmake and the SHA is empty

@dguibert
Copy link
Collaborator Author

not working for me, I get
fatal: not a git repository (or any of the parent directories): .git
when running cmake and the SHA is empty

On the same setup but without this patch, does it fill the FESOM_GIT_SHA variable?
I assume that your source directory has been copied to the cluster without the .git directory.

@koldunovn
Copy link
Member

@hegish Any news on this one? :)

@hegish
Copy link
Collaborator

hegish commented Feb 3, 2021

O sorry, I did not notice the PR has changed. Will try again ASAP.

Without this patch, the file `fesom_version_info-generated.F90` is generated
at each build, rebuilding all its dependencies up to the fesom executable.

The patch generates the fesom_version_info-generated.F90 only when the
FESOM_GIT_SHA value changes to reflect the current git status at the
time of building Fesom.
With this patch it allows to not recompile Fesom if not necessary. For
example calling make; make (in a row), without any new commits between
the two make will compile fesom only once. Currently, with this example,
fesom_version_info-generated.F90 is recompiled because of a new
timestamp, thus recompiling fesom.
@dguibert dguibert force-pushed the dg/git-repository-info branch from 607582c to 0778b81 Compare February 16, 2021 08:28
@dguibert
Copy link
Collaborator Author

Hi, @hegish I've pushed an update, worth to try.
It is simplified and it works when the build directory is outside the source directory.

@hegish
Copy link
Collaborator

hegish commented Feb 16, 2021

Ah, did the previous PR not work with out of source builds? This maybe was the issue I had with it.

@dguibert
Copy link
Collaborator Author

The issue was that the working directory of the git describe command was wrong and we get the error:

fatal: not a git repository (or any of the parent directories): .git

It's now fixed in the latest update.

@dguibert
Copy link
Collaborator Author

Any issue on this one?

@dguibert
Copy link
Collaborator Author

This has been integrated in #515

@suvarchal
Copy link
Collaborator

This has been integrated in #515

Sorry and apologies for being tardy and not merge changes from this PR before.

@suvarchal suvarchal closed this Dec 13, 2023
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.

4 participants