[Scons-users] ifort (maybe general Fortran): Module directory issues

Dirk Bächle tshortik at gmx.de
Fri Mar 28 12:00:04 EDT 2014


On 28.03.2014 10:00, Markus Hrywniak wrote:

> On 27.03.2014 18:41, Dirk Bächle wrote:

>>

>> You should be able to suppress this, by redefining the variable in

>> question after the Fortran tool was initialized:

>>

>> env = Environment()

>> env['_FORTRANMODFLAG'] = '$( ${_concat(FORTRANMODDIRPREFIX,

>> FORTRANMODDIR, FORTRANMODDIRSUFFIX, __env__, lambda x: x, TARGET,

>> SOURCE)} $)'

>>

>> Then only the directory you specified via FORTRANMODDIR should get added

>> to the command line (untested).

>

> Thank you!

> Helps (sort-of), but it also prevents any of the '#'-pinning magic

> from happening to the module path (i.e. I need to change '#build' to

> 'build'), which is not always possible. For me it's good enough though.

> IMHO this still seems like a slight bug, though. I will see if I can

> come up with something that does not break other uses of VariantDir

> and the like.

>

In that case you can try to replace the filter function "lambda x: x"
with something like "lambda x: __env__.subst(x)", which should then
properly substitute variables and special operators in your paths.
I agree that this is just a hack, but if you find that it's working for
you it seems to be the way to go. Perhaps some other users with more
Fortran experience can judge whether this change (disabling variant dir
lookups for FORTRANMODDIR) would actually make sense, and be free of
side effects.
Then we could open an issue ticket and handle this properly on the more
official channels. ;)

Dirk



More information about the Scons-users mailing list