Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.3.9: Autotools lacks FFTW3LibraryDepends.cmake #235

Open
ax3l opened this issue Mar 6, 2021 · 1 comment
Open

3.3.9: Autotools lacks FFTW3LibraryDepends.cmake #235

ax3l opened this issue Mar 6, 2021 · 1 comment

Comments

@ax3l
Copy link

ax3l commented Mar 6, 2021

Hi,

I encounter a problem when searching for an Autotools-build FFTW3 with CMake.

The installed file FFTW3(f)Config.cmake includes inline 13 the file FFTW3LibraryDepends.cmake. But with autotools installs, it looks like this file is not installed, leading to an find_package(FFTW3 CONFIG) error of the form:

CMake Error at lib/cmake/fftw3/FFTW3Config.cmake:13 (include):
  include could not find load file:

    lib/cmake/fftw3/FFTW3LibraryDepends.cmake

https://github.com/FFTW/fftw3/blob/fftw-3.3.9/FFTW3Config.cmake.in#L13

I think the file FFTW3LibraryDepends.cmake is forgotten in the Autotools install logic:
https://github.com/FFTW/fftw3/blob/fftw-3.3.9/Makefile.am#L157

cc @junghans

@ax3l
Copy link
Author

ax3l commented Mar 8, 2021

Argh, I just added a closer description of #130. Duplicate.

WeiqunZhang pushed a commit to AMReX-Codes/amrex that referenced this issue Jan 8, 2025
## Summary

This improves the FFTW CMake find logic based on the scripts that I
developed for HiPACE++/WarpX/ImpactX to find FFTW on various platforms.

It helps to find FFTW on Windows, where it is installed by default with
CMake, and it uses more details from PkgConfig files on Linux/macOS,
such as forwarding defines, using OpenMP acceleration if available.

It also chooses sensible defaults to work around known FFTW build system
bugs, linked inline. There are also options added to control the
defaults, e.g., in package managers that use a different default (e.g.,
CMake FFTW install on Linux/macOS).

## Additional background

See build issues in
BLAST-ImpactX/impactx#760 (comment)

On Windows, try searching for `FFTW3(f)Config.cmake` files first,
because:
- Installed `.pc` files wrongly and unconditionally add `-lm`
- FFTW/fftw3#236

On Linux & macOS, the Autotools install tries to emulate a CMake config
file, but has a bug:
- FFTW/fftw3#235
- Thus, by default rely on `.pc` files because we cannot know which
install was choosen (otherwise, there is an option for it named
`AMReX_FFTW_SEARCH`).

## Checklist

The proposed changes:
- [ ] fix a bug or incorrect behavior in AMReX
- [x] add new capabilities to AMReX
- [ ] changes answers in the test suite to more than roundoff level
- [ ] are likely to significantly affect the results of downstream AMReX
users
- [ ] include documentation in the code and/or rst files, if appropriate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant