Skip to content

ParseConfig does not populate paths for Fortran #4835

Description

@kprussing

After running env.ParseConfig, the environment variable "CPPPATH" is populated, but the Fortran equivalents "F90PATH" and friends are not. A nice to have would be for env.ParseConfig to populate these Fotran variables so libraries that install Fortran stubs in /usr/include like FFTW3 could be found auto-magically.

Required information

  • Link to SCons Users thread discussing your issue: Discord thread
  • Version of SCons: 4.10.1
  • Version of Python: 3.14.3
  • Which python distribution if applicable: conda-forge
  • How you installed SCons: pip install scons
  • What Platform are you on? RHEL8 (tested on, original author of thread mentioned macOS)
  • How to reproduce your issue? See below

Additional context

SConstruct

env = Environment()

env.ParseConfig("pkg-config fftw3 --cflags --libs")

# If FFTW3 was installed in /usr/include, we need additional flags
if env.get("CPPPATH") is None:
    env.ParseConfig("pkg-config fftw3 --cflags --libs --keep-system-cflags")

print("CPPPATH: ", env["CPPPATH"])
for key in ["F77PATH",
            "F90PATH",
            "F95PATH",
            "F03PATH",
            "F08PATH",
            ]:
    # Force copy of CPPPATH to the appropriate Fortran dialect path
    env[key] = env["CPPPATH"]

env.Program("mwe.f90")

mwe.f90

program mwe
    use iso_c_binding
    include 'fftw3.f03'
end program mwe

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions