[Scons-users] SCons ignoring FORTRANPATH

Tom Cook tom.k.cook at gmail.com
Wed Sep 24 03:00:59 EDT 2014


Hi,

I have a SCons build which includes a number of Fortran modules.  For
at least some of these modules, the FORTRANPATH variable seems to be
ignored.  The output of env.Dump() is shown at the end of this email,
showing a number of directories listed in FORTRANPATH; however, when
trying to build a Fortran source file, this command-line is used:

gfortran -o "Build/Linux/Product/Calculation/ProductSim
F/DTBWindInit.o" -c -cpp -ffixed-line-length-none
-ffree-line-length-none -fcoarray=single
"-JBuild/Linux/Product/Calculation/ProductSim F"
"Source/Product/Calculation/ProductSim F/DTBInit.f90"

(note that the command-line has been anonymised slightly for
commercial reasons).

What could cause this?

Thanks,
Tom

{ 'AR': 'ar',
  'ARCOM': '$AR $ARFLAGS $TARGET $SOURCES',
  'ARFLAGS': ['rc'],
  'AS': 'as',
  'ASCOM': '$AS $ASFLAGS -o $TARGET $SOURCES',
  'ASFLAGS': [],
  'ASPPCOM': '$CC $ASPPFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c
-o $TARGET $SOURCES',
  'ASPPFLAGS': '$ASFLAGS',
  'BUILDERS': {'Zip': <SCons.Builder.BuilderBase object at
0x7f9aa52d0c90>, 'Jar': <SCons.Builder.BuilderBase object at
0x7f9aa2575110>, 'StaticLibrary': <SCons.Builder.BuilderBase object at
0x7f9aa25699d0>, 'M4': <SCons.Builder.BuilderBase object at
0x7f9aa2569b10>, 'Program': <SCons.Builder.BuilderBase object at
0x7f9aa255e7d0>, 'RPCGenHeader': <SCons.Builder.BuilderBase object at
0x7f9aa2569d10>, 'Object': <SCons.Builder.CompositeBuilder object at
0x7f9aa255efd0>, 'RPCGenXDR': <SCons.Builder.BuilderBase object at
0x7f9aa2569e10>, 'JavaClassDir': <SCons.Builder.BuilderBase object at
0x7f9aa25753d0>, 'LoadableModule': <SCons.Builder.BuilderBase object
at 0x7f9aa255eed0>, 'CopyAs': <SCons.Builder.BuilderBase object at
0x7f9aa52f9b50>, 'SharedLibrary': <SCons.Builder.BuilderBase object at
0x7f9aa255ed90>, 'JavaH': <SCons.Builder.BuilderBase object at
0x7f9aa2575510>, 'CopyTo': <SCons.Builder.BuilderBase object at
0x7f9aa52f9a90>, 'PDF': <SCons.Builder.CompositeBuilder object at
0x7f9aa53017d0>, 'StaticObject': <SCons.Builder.CompositeBuilder
object at 0x7f9aa255efd0>, 'SharedObject':
<SCons.Builder.CompositeBuilder object at 0x7f9aa255e910>, 'Tar':
<SCons.Builder.BuilderBase object at 0x7f9aa52d0b50>, 'JavaClassFile':
<SCons.Builder.BuilderBase object at 0x7f9aa2575310>, 'RPCGenService':
<SCons.Builder.BuilderBase object at 0x7f9aa2569d90>, 'Library':
<SCons.Builder.BuilderBase object at 0x7f9aa25699d0>, 'RMIC':
<SCons.Builder.BuilderBase object at 0x7f9aa5341810>, 'JavaFile':
<SCons.Builder.CompositeBuilder object at 0x7f9aa2575250>,
'RPCGenClient': <SCons.Builder.BuilderBase object at 0x7f9aa2569c90>},
  'CC': 'gcc',
  'CCCOM': '$CC -o $TARGET -c $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES',
  'CCFLAGS': [],
  'CCVERSION': '4.8.2',
  'CFILESUFFIX': '.c',
  'CFLAGS': [],
  'CONFIGUREDIR': '#/.sconf_temp',
  'CONFIGURELOG': '#/config.log',
  'COPYSTR': 'Copy file(s): "$SOURCES" to "$TARGETS"',
  'CPPDEFPREFIX': '-D',
  'CPPDEFSUFFIX': '',
  'CPPSUFFIXES': [ '.c',
                   '.C',
                   '.cxx',
                   '.cpp',
                   '.c++',
                   '.cc',
                   '.h',
                   '.H',
                   '.hxx',
                   '.hpp',
                   '.hh',
                   '.F',
                   '.fpp',
                   '.FPP',
                   '.m',
                   '.mm',
                   '.S',
                   '.spp',
                   '.SPP',
                   '.sx'],
  'CXX': 'g++',
  'CXXCOM': '$CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES',
  'CXXFILESUFFIX': '.cc',
  'CXXFLAGS': [],
  'CXXVERSION': '4.8.2',
  'DSUFFIXES': ['.d'],
  'DVIPDF': 'dvipdf',
  'DVIPDFCOM': 'cd ${TARGET.dir} && $DVIPDF $DVIPDFFLAGS
${SOURCE.file} ${TARGET.file}',
  'DVIPDFFLAGS': [],
  'Dir': <SCons.Defaults.Variable_Method_Caller object at 0x7f9aa6f598d0>,
  'Dirs': <SCons.Defaults.Variable_Method_Caller object at 0x7f9aa6f59910>,
  'ENV': { 'PATH': '/usr/local/bin:/opt/bin:/bin:/usr/bin'},
  'ESCAPE': <function escape at 0x7f9aa53c6140>,
  'F03': 'gfortran',
  'F03COM': '$F03 -o $TARGET -c $F03FLAGS $_F03INCFLAGS
$_FORTRANMODFLAG $SOURCES',
  'F03FLAGS': [],
  'F03PPCOM': '$F03 -o $TARGET -c $F03FLAGS $CPPFLAGS $_CPPDEFFLAGS
$_F03INCFLAGS $_FORTRANMODFLAG $SOURCES',
  'F77': 'gfortran',
  'F77COM': '$F77 -o $TARGET -c $F77FLAGS $_F77INCFLAGS $SOURCES',
  'F77FLAGS': [],
  'F77PPCOM': '$F77 -o $TARGET -c $F77FLAGS $CPPFLAGS $_CPPDEFFLAGS
$_F77INCFLAGS $SOURCES',
  'F90': 'gfortran',
  'F90COM': '$F90 -o $TARGET -c $F90FLAGS $_F90INCFLAGS
$_FORTRANMODFLAG $SOURCES',
  'F90FLAGS': '-cpp -ffixed-line-length-none -ffree-line-length-none
-fcoarray=single',
  'F90PPCOM': '$F90 -o $TARGET -c $F90FLAGS $CPPFLAGS $_CPPDEFFLAGS
$_F90INCFLAGS $_FORTRANMODFLAG $SOURCES',
  'F95': 'gfortran',
  'F95COM': '$F95 -o $TARGET -c $F95FLAGS $_F95INCFLAGS
$_FORTRANMODFLAG $SOURCES',
  'F95FLAGS': [],
  'F95PPCOM': '$F95 -o $TARGET -c $F95FLAGS $CPPFLAGS $_CPPDEFFLAGS
$_F95INCFLAGS $_FORTRANMODFLAG $SOURCES',
  'FORTRAN': 'gfortran',
  'FORTRANCOM': '$FORTRAN -o $TARGET -c $FORTRANFLAGS
$_FORTRANINCFLAGS $_FORTRANMODFLAG $SOURCES',
  'FORTRANFLAGS': '-cpp -ffixed-line-length-none
-ffree-line-length-none -fcoarray=single',
  'FORTRANMODDIR':
'/home/tkcook/Projects/Product-Linux/Build/Linux/Product/Calculation/ProductSim
F',
  'FORTRANMODDIRPREFIX': '-J',
  'FORTRANMODDIRSUFFIX': '',
  'FORTRANMODPREFIX': '',
  'FORTRANMODSUFFIX': '.mod',
  'FORTRANPATH': [
'/home/tkcook/Projects/Product-Linux/Build/Linux/Product/Calculation/product/modal
F',

'/home/tkcook/Projects/Product-Linux/Build/Linux/Util/dongle/dongle
F',

'/home/tkcook/Projects/Product-Linux/Build/Linux/Product/Calculation/product',

'/home/tkcook/Projects/Product-Linux/Build/Linux/Product/Calculation/product/rotor
F',

'/home/tkcook/Projects/Product-Linux/Build/Linux/Product/Calculation/ProductSim
F',

'/home/tkcook/Projects/Product-Linux/Build/Linux/Product/Calculation/product/wind
F',

'/home/tkcook/Projects/Product-Linux/Build/Linux/Product/Calculation/product/tower
F',

'/home/tkcook/Projects/Product-Linux/Build/Linux/Product/Calculation/product/turbine
F',

'/home/tkcook/Projects/Product-Linux/Source/Product/Calculation'],
  'FORTRANPPCOM': '$FORTRAN -o $TARGET -c $FORTRANFLAGS $CPPFLAGS
$_CPPDEFFLAGS $_FORTRANINCFLAGS $_FORTRANMODFLAG $SOURCES',
  'FORTRANSUFFIXES': [ '.f',
                       '.for',
                       '.ftn',
                       '.fpp',
                       '.FPP',
                       '.F',
                       '.FOR',
                       '.FTN',
                       '.f77',
                       '.F77',
                       '.f90',
                       '.F90',
                       '.f95',
                       '.F95',
                       '.f03',
                       '.F03'],
  'FRAMEWORKPATH': [],
  'FRAMEWORKS': [],
  'File': <SCons.Defaults.Variable_Method_Caller object at 0x7f9aa6f59950>,
  'GS': 'gs',
  'GSCOM': '$GS $GSFLAGS -sOutputFile=$TARGET $SOURCES',
  'GSFLAGS': ['-dNOPAUSE', '-dBATCH', '-sDEVICE=pdfwrite'],
  'HOST_ARCH': None,
  'HOST_OS': None,
  'IDLSUFFIXES': ['.idl', '.IDL'],
  'INCF03PREFIX': '-I',
  'INCF03SUFFIX': '',
  'INCF77PREFIX': '-I',
  'INCF77SUFFIX': '',
  'INCF90PREFIX': '-I',
  'INCF90SUFFIX': '',
  'INCF95PREFIX': '-I',
  'INCF95SUFFIX': '',
  'INCFORTRANPREFIX': '-I',
  'INCFORTRANSUFFIX': '',
  'INCPREFIX': '-I',
  'INCSUFFIX': '',
  'JAR': 'jar',
  'JARCOM': "${TEMPFILE('$_JARCOM')}",
  'JARFLAGS': ['cf'],
  'JARSUFFIX': '.jar',
  'JAVABOOTCLASSPATH': [],
  'JAVAC': 'javac',
  'JAVACCOM': "${TEMPFILE('$_JAVACCOM')}",
  'JAVACFLAGS': [],
  'JAVACLASSPATH': [],
  'JAVACLASSSUFFIX': '.class',
  'JAVAH': 'javah',
  'JAVAHCOM': '$JAVAH $JAVAHFLAGS $_JAVAHOUTFLAG $_JAVAHCLASSPATH
${SOURCES.attributes.java_classname}',
  'JAVAHFLAGS': [],
  'JAVASOURCEPATH': [],
  'JAVASUFFIX': '.java',
  'LDMODULE': '$SHLINK',
  'LDMODULECOM': '$LDMODULE -o $TARGET $LDMODULEFLAGS $__RPATH
$SOURCES $_LIBDIRFLAGS $_LIBFLAGS',
  'LDMODULEEMITTER': '$SHLIBEMITTER',
  'LDMODULEFLAGS': '$SHLINKFLAGS',
  'LDMODULEPREFIX': '$SHLIBPREFIX',
  'LDMODULESUFFIX': '$SHLIBSUFFIX',
  'LIBDIRPREFIX': '-L',
  'LIBDIRSUFFIX': '',
  'LIBLINKPREFIX': '-l',
  'LIBLINKSUFFIX': '',
  'LIBPREFIX': 'lib',
  'LIBPREFIXES': ['$LIBPREFIX'],
  'LIBSUFFIX': '.a',
  'LIBSUFFIXES': ['$LIBSUFFIX', '$SHLIBSUFFIX'],
  'LINK': 'gfortran',
  'LINKCOM': '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES
$_LIBDIRFLAGS $_LIBFLAGS',
  'LINKFLAGS': [],
  'M4': 'm4',
  'M4COM': 'cd ${SOURCE.rsrcdir} && $M4 $M4FLAGS < ${SOURCE.file} >
${TARGET.abspath}',
  'M4FLAGS': ['-E'],
  'MAXLINELENGTH': 128072,
  'OBJPREFIX': '',
  'OBJSUFFIX': '.o',
  'PDFCOM': ['$DVIPDFCOM'],
  'PDFPREFIX': '',
  'PDFSUFFIX': '.pdf',
  'PLATFORM': 'posix',
  'PROGPREFIX': '',
  'PROGSUFFIX': '',
  'PSPAWN': <function piped_env_spawn at 0x7f9aa53c6848>,
  'RANLIB': 'ranlib',
  'RANLIBCOM': '$RANLIB $RANLIBFLAGS $TARGET',
  'RANLIBFLAGS': [],
  'RDirs': <SCons.Defaults.Variable_Method_Caller object at 0x7f9aa6f59990>,
  'RMIC': 'rmic',
  'RMICCOM': '$RMIC $RMICFLAGS -d ${TARGET.attributes.java_lookupdir}
-classpath ${SOURCE.attributes.java_classdir}
${SOURCES.attributes.java_classname}',
  'RMICFLAGS': [],
  'RPATHPREFIX': '-Wl,-rpath=',
  'RPATHSUFFIX': '',
  'RPCGEN': 'rpcgen',
  'RPCGENCLIENTFLAGS': [],
  'RPCGENFLAGS': [],
  'RPCGENHEADERFLAGS': [],
  'RPCGENSERVICEFLAGS': [],
  'RPCGENXDRFLAGS': [],
  'SCANNERS': [],
  'SHCC': '$CC',
  'SHCCCOM': '$SHCC -o $TARGET -c $SHCFLAGS $SHCCFLAGS $_CCCOMCOM $SOURCES',
  'SHCCFLAGS': ['$CCFLAGS', '-fPIC'],
  'SHCFLAGS': ['$CFLAGS'],
  'SHCXX': '$CXX',
  'SHCXXCOM': '$SHCXX -o $TARGET -c $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM $SOURCES',
  'SHCXXFLAGS': ['$CXXFLAGS'],
  'SHELL': 'sh',
  'SHF03': '$F03',
  'SHF03COM': '$SHF03 -o $TARGET -c $SHF03FLAGS $_F03INCFLAGS
$_FORTRANMODFLAG $SOURCES',
  'SHF03FLAGS': ['$F03FLAGS', '-fPIC'],
  'SHF03PPCOM': '$SHF03 -o $TARGET -c $SHF03FLAGS $CPPFLAGS
$_CPPDEFFLAGS $_F03INCFLAGS $_FORTRANMODFLAG $SOURCES',
  'SHF77': '$F77',
  'SHF77COM': '$SHF77 -o $TARGET -c $SHF77FLAGS $_F77INCFLAGS $SOURCES',
  'SHF77FLAGS': ['$F77FLAGS', '-fPIC'],
  'SHF77PPCOM': '$SHF77 -o $TARGET -c $SHF77FLAGS $CPPFLAGS
$_CPPDEFFLAGS $_F77INCFLAGS $SOURCES',
  'SHF90': '$F90',
  'SHF90COM': '$SHF90 -o $TARGET -c $SHF90FLAGS $_F90INCFLAGS
$_FORTRANMODFLAG $SOURCES',
  'SHF90FLAGS': ['$F90FLAGS', '-fPIC'],
  'SHF90PPCOM': '$SHF90 -o $TARGET -c $SHF90FLAGS $CPPFLAGS
$_CPPDEFFLAGS $_F90INCFLAGS $_FORTRANMODFLAG $SOURCES',
  'SHF95': '$F95',
  'SHF95COM': '$SHF95 -o $TARGET -c $SHF95FLAGS $_F95INCFLAGS
$_FORTRANMODFLAG $SOURCES',
  'SHF95FLAGS': ['$F95FLAGS', '-fPIC'],
  'SHF95PPCOM': '$SHF95 -o $TARGET -c $SHF95FLAGS $CPPFLAGS
$_CPPDEFFLAGS $_F95INCFLAGS $_FORTRANMODFLAG $SOURCES',
  'SHFORTRAN': '$FORTRAN',
  'SHFORTRANCOM': '$SHFORTRAN -o $TARGET -c $SHFORTRANFLAGS
$_FORTRANINCFLAGS $_FORTRANMODFLAG $SOURCES',
  'SHFORTRANFLAGS': ['$FORTRANFLAGS', '-fPIC'],
  'SHFORTRANPPCOM': '$SHFORTRAN -o $TARGET -c $SHFORTRANFLAGS
$CPPFLAGS $_CPPDEFFLAGS $_FORTRANINCFLAGS $_FORTRANMODFLAG $SOURCES',
  'SHLIBEMITTER': [<function shlib_emitter at 0x7f9aa5314d70>],
  'SHLIBPREFIX': '$LIBPREFIX',
  'SHLIBSUFFIX': '.so',
  'SHLINK': '$LINK',
  'SHLINKCOM': '$SHLINK -o $TARGET $SHLINKFLAGS $__RPATH $SOURCES
$_LIBDIRFLAGS $_LIBFLAGS',
  'SHLINKFLAGS': ['$LINKFLAGS', '-shared'],
  'SHOBJPREFIX': '$OBJPREFIX',
  'SHOBJSUFFIX': '.os',
  'SMARTLINK': <function smart_link at 0x7f9aa5314cf8>,
  'SPAWN': <function spawnvpe_spawn at 0x7f9aa53c6578>,
  'STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME': 1,
  'TAR': 'tar',
  'TARCOM': '$TAR $TARFLAGS -f $TARGET $SOURCES',
  'TARFLAGS': ['-c'],
  'TARGET_ARCH': None,
  'TARGET_OS': None,
  'TARSUFFIX': '.tar',
  'TEMPFILE': <class 'SCons.Platform.TempFileMunge'>,
  'TEMPFILEPREFIX': '@',
  'TOOLS': [ 'default',
             'gnulink',
             'gcc',
             'g++',
             'gfortran',
             'gas',
             'ar',
             'filesystem',
             'm4',
             'rpcgen',
             'jar',
             'javac',
             'javah',
             'rmic',
             'dvipdf',
             'gs',
             'tar',
             'zip'],
  'WIXCANDLE': 'candle.exe',
  'WIXLIGHT': 'light.exe',
  'ZIP': 'zip',
  'ZIPCOM': <SCons.Action.FunctionAction object at 0x7f9aa52d0c10>,
  'ZIPCOMPRESSION': 8,
  'ZIPFLAGS': [],
  'ZIPSUFFIX': '.zip',
  '_CCCOMCOM': '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS',
  '_CPPDEFFLAGS': '${_defines(CPPDEFPREFIX, CPPDEFINES, CPPDEFSUFFIX,
__env__)}',
  '_CPPINCFLAGS': '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX,
__env__, RDirs, TARGET, SOURCE)} $)',
  '_F03INCFLAGS': '$( ${_concat(INCF03PREFIX, F03PATH, INCF03SUFFIX,
__env__, RDirs, TARGET, SOURCE)} $)',
  '_F77INCFLAGS': '$( ${_concat(INCF77PREFIX, F77PATH, INCF77SUFFIX,
__env__, RDirs, TARGET, SOURCE)} $)',
  '_F90INCFLAGS': '$( ${_concat(INCF90PREFIX, F90PATH, INCF90SUFFIX,
__env__, RDirs, TARGET, SOURCE)} $)',
  '_F95INCFLAGS': '$( ${_concat(INCF95PREFIX, F95PATH, INCF95SUFFIX,
__env__, RDirs, TARGET, SOURCE)} $)',
  '_FORTRANINCFLAGS': '$( ${_concat(INCFORTRANPREFIX, FORTRANPATH,
INCFORTRANSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)',
  '_FORTRANMODFLAG': '$( ${_concat(FORTRANMODDIRPREFIX, FORTRANMODDIR,
FORTRANMODDIRSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)',
  '_JARCOM': '$JAR $_JARFLAGS $TARGET $_JARMANIFEST $_JARSOURCES',
  '_JARFLAGS': <function jarFlags at 0x7f9aa533b140>,
  '_JARMANIFEST': <function jarManifest at 0x7f9aa533b0c8>,
  '_JARSOURCES': <function jarSources at 0x7f9aa533b050>,
  '_JAVABOOTCLASSPATH': '${_javapathopt("-bootclasspath",
"JAVABOOTCLASSPATH")} ',
  '_JAVACCOM': '$JAVAC $JAVACFLAGS $_JAVABOOTCLASSPATH $_JAVACLASSPATH
-d ${TARGET.attributes.java_classdir} $_JAVASOURCEPATH $SOURCES',
  '_JAVACLASSPATH': '${_javapathopt("-classpath", "JAVACLASSPATH")} ',
  '_JAVAHCLASSPATH': <function getJavaHClassPath at 0x7f9aa5344488>,
  '_JAVAHOUTFLAG': <function JavaHOutFlagGenerator at 0x7f9aa5344410>,
  '_JAVASOURCEPATH': '${_javapathopt("-sourcepath", "JAVASOURCEPATH",
"_JAVASOURCEPATHDEFAULT")} ',
  '_JAVASOURCEPATHDEFAULT': '${TARGET.attributes.java_sourcedir}',
  '_LIBDIRFLAGS': '$( ${_concat(LIBDIRPREFIX, LIBPATH, LIBDIRSUFFIX,
__env__, RDirs, TARGET, SOURCE)} $)',
  '_LIBFLAGS': '${_stripixes(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX,
LIBPREFIXES, LIBSUFFIXES, __env__)}',
  '_RPATH': '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}',
  '__RPATH': '$_RPATH',
  '_concat': <function _concat at 0x7f9aa6f5f2a8>,
  '_defines': <function _defines at 0x7f9aa6f5f488>,
  '_javapathopt': <class 'SCons.Tool.javac.pathopt'>,
  '_stripixes': <function _stripixes at 0x7f9aa6f5f398>}


More information about the Scons-users mailing list