Fortran: Problems with dependencies on Windows
-
Link to SCons Users thread discussing your issue. https://pairlist4.pair.net/pipermail/scons-users/2019-May/007752.html
-
Version of SCons 3.0.5
-
Version of Python 3.6.7
-
Which python distribution if applicable (python.org, cygwin, anaconda, macports, brew,etc) anaconda
-
How you installed SCons conda install -c scons anaconda
-
What Platform are you on? (Linux/Windows and which version) Windows 10 64 bits
-
How to reproduce your issue? Please include a small self contained reproducer. Likely a SConstruct should do for most issues. Seems that compilation is done using alphabetic order. Fortran_Dependencies.zip
-
How you invoke scons (The command line you're using "scons --flags some_arguments") scons
@jglezplatas - Please fill in the issue template information above.
@jglezplatas - You've still not edited the bug summary... Go to the top part where the template is. Click the three ...'s and then edit. Also please delete your other comments. We ask users to not file issues until approved on the users mailing list. Which has not yet happened. Also I asked for you to create a repro on the mailing list and create a git repo to simplify seeing the issue.
Please add info on which fortran compiler and how you installed it on your system. (URL,etc)
Is it safe to assume that the order is wrong because the required .smod files are not built before they are used in your example?
I'm 99% sure this is effectively a duplicate of #3366 On windows what order is it actually compiling on? I'm guessing testing.f90 gets compiled before files in your subdir which is what produces the .smod's
The correct order was written on Sconstruct in sources list. Why in Linux compile but not in Windows? Casuality?
The installer for fortran in windows was taken from https://sourceforge.net/projects/mingw-w64/files/
After I have selected the packages for 32bits and for 64bits. The version of compiler is 8.1.
Can you paste a log of building on windows and on other platforms? Also what is the "Correct" order?
Please paste the output for: scons --tree=prune --taskmastertrace=trace.log Also upload the trace.log as an attachment
Also run same on another platform where the build works and paste output and attach trace.log
OK Here you have the trace.log in my MacOS system where I can get the executable. Also the trace.log in windows where scons fails. I hope that it help you. trace_macos.log trace_windows.log
Correct order could be sources = ['test_1.f90', 'b_test1.f90', 'c_test1.f90', 'test_2.f90', 'a_test2.f90', 'testing.f90']
I think it's been mentioned before, but you don't tell scons the order, it figures it out based on computed dependencies. You can influence this a bit - take a look at Depends() (though in my case, I've never had Depends do quite what I expected it to do, I probably don't understand it right). If it's missing information, which we already know is the case for the smod files, it may well get the order wrong, or it might get it right by chance.
@mwichmann and @bdbaddog I think this is the same issue mentioned in #4177 which I would consider solved now. v4.8.1 seems to be working correctly with modules at least for the examples here:
https://github.com/dnwillia/SConsTests