Opened 3 years ago

Last modified 3 years ago

#1847 reopened defect

FFTW3 fortran interface not working for system installation

Reported by: Frank Löffler Owned by:
Priority: optional Milestone:
Component: Cactus Version: development version
Keywords: Cc:


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?

Attachments (0)

Change History (3)

comment:1 Changed 3 years ago by Frank Löffler

Status: newreview

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

An example usage of this would be, in FFTW3's


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.

comment:2 Changed 3 years ago by Frank Löffler

Resolution: fixed
Status: reviewclosed

merged in e10e237

comment:3 Changed 3 years ago by Frank Löffler

Resolution: fixed
Status: closedreopened

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

Modify Ticket

Change Properties
Set your email in Preferences
as reopened The ticket will remain with no owner.
Next status will be 'review'.
as The resolution will be set.
to The owner will be changed from (none) to the specified user.
The owner will be changed from (none) to anonymous.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.