scons icon indicating copy to clipboard operation
scons copied to clipboard

Fortran: Problems with dependencies on Windows

Open jglezplatas opened this issue 6 years ago • 14 comments

  • 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 avatar May 05 '19 08:05 jglezplatas

@jglezplatas - Please fill in the issue template information above.

bdbaddog avatar May 06 '19 01:05 bdbaddog

@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.

bdbaddog avatar May 06 '19 15:05 bdbaddog

Please add info on which fortran compiler and how you installed it on your system. (URL,etc)

bdbaddog avatar May 07 '19 17:05 bdbaddog

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?

bdbaddog avatar May 07 '19 17:05 bdbaddog

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

bdbaddog avatar May 07 '19 17:05 bdbaddog

The correct order was written on Sconstruct in sources list. Why in Linux compile but not in Windows? Casuality?

jglezplatas avatar May 07 '19 18:05 jglezplatas

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.

jglezplatas avatar May 07 '19 18:05 jglezplatas

Can you paste a log of building on windows and on other platforms? Also what is the "Correct" order?

bdbaddog avatar May 07 '19 18:05 bdbaddog

Please paste the output for: scons --tree=prune --taskmastertrace=trace.log Also upload the trace.log as an attachment

bdbaddog avatar May 07 '19 19:05 bdbaddog

Also run same on another platform where the build works and paste output and attach trace.log

bdbaddog avatar May 07 '19 19:05 bdbaddog

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

jglezplatas avatar May 07 '19 19:05 jglezplatas

Correct order could be sources = ['test_1.f90', 'b_test1.f90', 'c_test1.f90', 'test_2.f90', 'a_test2.f90', 'testing.f90']

jglezplatas avatar May 07 '19 19:05 jglezplatas

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 avatar May 08 '19 14:05 mwichmann

@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

dnwillia avatar Jan 09 '25 19:01 dnwillia