- changed status to open
- removed comment
FFTW3 fortran interface not working for system installation
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)
-
reporter -
reporter - changed status to resolved
- removed comment
merged in e10e237
-
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.
- Log in to 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:
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.