FFTW3 fortran interface not working for system installation

Create issue
Issue #1847 open
Frank Löffler created an issue

The FFTW3 thorn is able to detect system installations, but does not add (for example) /usr/include as include path since it is a standard system include path (for C), and could collide with other libraries. This is correct.

However, some system fftw3 libraries install the fftw3.f Fortran file also in /usr/include, and expect this to be in the include path for the Fortran compiler. This, however, is not the case for all compilers (since /usr/include is meant for C headers, not Fortran), i.e., for gfortran. This could be seen as bug in the fftw3 installation, but we should provide a workaround. Right now, the FFTW3 thorn does not always provide a working interface for Fortran.

Other libraries have similar problems, so I wonder if we could provide a common workaround. We have to add these directories as -I flag to the Fortran compiler, but we must not add it to the C or C++ compilers. I don't see a good way to currently do this within Cactus. Am I right? If so: would it make sense to have Cactus look for a variable, i.e., FFTW3_FINC_DIRS, and to only add those for Fortran compilations?

Keyword:

Comments (3)

  1. Frank Löffler reporter
    • changed status to open
    • removed comment

    A pull request for the flesh to allow for a Fortran-specific include directory list has been created:

    https://bitbucket.org/cactuscode/cactus/pull-requests/21/cactus-add-include_line_f/diff

    An example usage of this would be, in FFTW3's detect.sh:

    echo 'INCLUDE_DIRECTORY         $(FFTW3_INC_DIRS)'
    echo 'INCLUDE_DIRECTORY_FORTRAN $(FFTW3_INC_DIRS) /usr/include'
    

    Note that above example is only good for demonstrating how this would work. /usr/include shouldn't be added unconditionally here, of course.

    With this patch, INCLUDE_DIRECTORY_FORTRAN is always used for Fortran processing, and is populated with INCLUDE_DIRECTORY if INCLUDE_DIRECTORY_FORTRAN is not specified.

  2. Frank Löffler reporter
    • changed status to open
    • removed comment

    actually - I'll wait with the change in fftw until the first jenkins build of the flesh change.

  3. Log in to comment