[Scons-users] F90PPCOM vs F90COM not invoked correctly

Bill Deegan bill at baddogconsulting.com
Thu Apr 16 11:12:16 EDT 2020


When you run under msys, which python are you using? windows or msys?
The code in question is in SCons/Tools/f*.py FortranCommon.py gfortran.py

As far as I can see there's no F90PPSuffixes defined by default?

On Thu, Apr 16, 2020 at 7:34 AM Luke Robison <lukerobison at gmail.com> wrote:

> It looks like the manpage mentions this:
>
> SCons handles the upper-case .F file suffix differently, depending on the
> capabilities of the underlying system. On a case-sensitive system such as
> Linux or UNIX, SCons treats a file with a .F suffix as a Fortran source
> file that is to be first run through the standard C preprocessor. On a
> case-insensitive system such as Windows, SCons treats a file with a .F suffix
> as a Fortran source file that should *not* be run through the C
> preprocessor.
>
> Can anyone point me to the Scons module that makes that decision?  Windows
> is somewhat case sensitive, so this seems like an unnecessary fallback when
> all tools can recognize .f vs .F (indeed, Glob itself well fail to find .F
> files if given "*.f").
>
> Luke
>
> On Wed, Apr 15, 2020 at 5:23 PM Luke Robison <lukerobison at gmail.com>
> wrote:
>
>> I am running scons-3.1.2 under MSYS, and realizing it does not recognize
>> .F90 files as requiring the F90PPCOM command.  Instead scons is running the
>> F90COM command, which doesn't include the CPPDEFINES.
>>
>> On the other hand, gfortran is recognizing the .F90 vs .f90 extension and
>> performing preprocessing as requested, it just doesn't have the correct
>> $CPPFLAGS to work.
>>
>> Using scons 3.0.1 under WSL, the correct F90PPCOM is executed.  Is this a
>> bug in the newer version of scons?  Additionally I think my scons-3.1.2 is
>> run under python3, while my scons-3.0.1 is run under python-2.7 (but I'm
>> not sure about that).
>>
>> ----
>>
>> env_clean = Environment()
>> env_clean.Append(CPPDEFINES={'DEFINEDVAL':'1'})
>> env_clean.Alias('test',env_clean.Program('test1.f90'))
>> env_clean.Alias('testpp',env_clean.Program('test2.F90'))
>>
>> ----
>>
>> $ scons --debug=presub testpp
>> scons: Reading SConscript files ...
>> scons: done reading SConscript files.
>> scons: Building targets ...
>> Building test2.o with action:
>>   *$F90COM*
>> gfortran -o test2.o -c test2.F90
>> test2.F90:3:2:
>>
>>     3 | #warning "this has been PreProcessed"
>>       |  1~~~~~~
>> Warning: #warning "this has been PreProcessed" [-Wcpp]
>> test2.F90:6:20:
>>
>>     6 |     bar = DEFINEDVAL
>>       |                    1
>> Error: Symbol 'definedval' at (1) has no IMPLICIT type
>> scons: *** [test2.o] Error 1
>> scons: building terminated because of errors.
>>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20200416/6746b28d/attachment-0001.html>


More information about the Scons-users mailing list