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

LIS build system does not include non-module Fortran files in dependencies #636

Open
emkemp opened this issue Nov 19, 2020 · 3 comments
Open
Labels
bug Something isn't working

Comments

@emkemp
Copy link
Contributor

emkemp commented Nov 19, 2020

The current LIS build system only adds Fortran modules and C headers to the autogenerated dependency files. For example, timeinterp_PALSmetdata.d contains:

timeinterp_PALSmetdata.o timeinterp_PALSmetdata.d : timeinterp_PALSmetdata.F90
timeinterp_PALSmetdata.o : PALSmetdata_forcingMod.o
timeinterp_PALSmetdata.o : LIS_constantsMod.o
timeinterp_PALSmetdata.o : LIS_misc.h
timeinterp_PALSmetdata.o : LIS_timeMgrMod.o
timeinterp_PALSmetdata.o : LIS_logMod.o
timeinterp_PALSmetdata.o : LIS_coreMod.o
timeinterp_PALSmetdata.o : LIS_metforcingMod.o
timeinterp_PALSmetdata.o : LIS_FORC_AttributesMod.o

This should also include zterp.o, which is created from a standalone Fortran source file (no module).

This interferes with the "strict check" (-3) build option, where the Intel compiler automatically generates Fortran interfaces so subroutine and function argument lists can be changed. Because of the missing dependency, the build system may not compile the true dependencies in the correct order, and the interface is not generated in time for checking.

This is only an issue for the "strict check" option.

@emkemp
Copy link
Contributor Author

emkemp commented Nov 19, 2020

The longer term/easier solution may be to migrate all standalone Fortran files into modules.

@jvgeiger
Copy link
Contributor

jvgeiger commented Nov 19, 2020

The makedep.py tool searches only for use, include, and #include statements. It does not try to parse the source code to find function or subroutine calls.

I agree that the most straight forward solution is to migrate these bare subroutines into modules.

@dmocko dmocko added the bug Something isn't working label Dec 14, 2020
@emkemp
Copy link
Contributor Author

emkemp commented Jul 16, 2024

We'll get to this. Someday....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants