[Scons-users] Picking up gfortran

Dirk Bächle tshortik at gmx.de
Wed May 20 19:05:04 EDT 2015


Hi Christopher,

On 21.05.2015 00:41, Christopher Dimech wrote:
> Should I keep the
>
> tools=['default','gfortran'],
>
> as I will nod be picking the usual gfortran
>

the 'gfortran' Tool is actually included in the list of 'default' Tools that SCons searches for when you don't specify a list of 
Tools explicitly. So you don't need to request it specifically.
What a Tool usually does is, adding new methods/builders like Program() or PDF() to the current environment. These builders use 
Actions that build the final command-line strings that get executed for the single build steps. A typical action string looks like

   $FORTRAN -o $TARGET -c $FORTRANFLAGS $_FORTRANINCFLAGS $_FORTRANMODFLAG $SOURCES

where the variable names refer to variables in your build environment. So for the Fortran "compile" command above, you can influence
the location of your Fortran compiler by simply setting

   env['FORTRAN'] = '/my/special/fortran/compiler/gfortran'

You can inspect the current list of variables by a

   env = Environment()
   print env.Dump()

, also the UserGuide (see its Appendices) lists all default Builders and the Variables they set and use.

Hope this helps you a little further.

Best regards,

Dirk




More information about the Scons-users mailing list