Replies: 13 comments 2 replies
-
"Intentional" doesn't necessarily mean correct, it just means to proceed with caution, if someone meant it that way :-) You can get SCons to say what it's (not) doing here with a flag to turn on the appropriate warnings - "no dependency generated":
|
Beta Was this translation helpful? Give feedback.
-
To be clear, SCons doesn't fail resolving all fortran modules, but it is failing with your particular configuration. |
Beta Was this translation helpful? Give feedback.
-
We do have the (quite "mature") issue #2022 indicating that modules in a subdirectory have been a concern for a while (and something I was poking at earlier this year). Looking at this as time allows - it actually appears quite straightforward to fix, but that fix trips up several places in the test suite, so have to look at those to see if it's bad test assumptions or actually breaking other Fortran things - so it may not be so simple. |
Beta Was this translation helpful? Give feedback.
-
I guess this behaviour is not related to the subdir problem #2022. I created an "flat" version of the source file layout with no subdirs in |
Beta Was this translation helpful? Give feedback.
-
It is and it isn't, which is a long story. Anyway, using the short
and with my working patch (which builds):
|
Beta Was this translation helpful? Give feedback.
-
Thanks for all the effort so far. There seems to be a lot of things going on internally. As a plain user I'm interested in any workaround. Which version (your |
Beta Was this translation helpful? Give feedback.
-
In theory, yes - that's what |
Beta Was this translation helpful? Give feedback.
-
and the work is not secret, just the current bit isn't up anywhere; it builds off pending #4380, which tries to fix problems with handling of a Fortran (and D) module directory. I'll put up a further patch presently, that's not, as noted, fully debugged/vetted. |
Beta Was this translation helpful? Give feedback.
-
Here's the temporary patchfile (gzipped because of silly github file-suffix rules) |
Beta Was this translation helpful? Give feedback.
-
Also I've forked your repo, and see SConstruct.simple2 for your init2 example Probably could be more simplified. But this seems to work. SConstruct.simple2 also seems to work for your init3 sample |
Beta Was this translation helpful? Give feedback.
-
basically you want the object for the source which uses a module to depend on the .mod generated from the source providing that module. @mwichmann's gzip'd patch should fix SCons to do the right thing with my SConstruct.simple, but if for some reason you can't patch your scons install, then SConstruct.simple2, should likely work. |
Beta Was this translation helpful? Give feedback.
-
One additional note here. |
Beta Was this translation helpful? Give feedback.
-
Glad you can proceed; meanwhile this clearly identified an issue in how |
Beta Was this translation helpful? Give feedback.
-
Issue: SCons fails resolving Fortran module deps.
Importance: SCons failing for a standard Fortran project makes it unusable, questioning Fortran support.
I was asked to switch this SE discussion https://stackoverflow.com/questions/77681762/scons-mwe-for-a-generic-fortran-project to the SCons repo.
In this example SCons is not able to resolve standard dependencies between modules.
module0
depends onmodule1
andmodule2
, but SCons issuesgfortran -o src/module0.o -c src/module0.f90
which results in an error sincemodule1.mod
is missing.There is a python script to set up the Fortran sources in the repo https://github.com/alexksr/SconsMWE.
init1.py
is a trivial example. For the sources generates byinit2.py
SCons shows the issue.@mwichmann looked at the SCons code and pointed out this may be intentional. If this behaviour of SCons is really ment to be the default, please help me tell SCons the dependencies via
Depends
. Do I need the (quite stable) external packagefortdepend
to get the dependencies or is there an internal method?Beta Was this translation helpful? Give feedback.
All reactions