FS#67604 - [fftw] CMake FFTW3 config: FFTW3LibraryDepends.cmake not found

Attached to Project: Arch Linux
Opened by Rishvic Pushpakaran (CodingPotato) - Sunday, 16 August 2020, 14:03 GMT
Last edited by David Runge (dvzrv) - Saturday, 19 February 2022, 20:02 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Ronald van Haren (pressh)
David Runge (dvzrv)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
In the included files in the fftw Arch Linux package, there is no
`/usr/lib64/cmake/fftw3/FFTW3LibraryDepends.cmake` file present, which is
required if one tries to use `find_package(FFTW3)` in CMake. The same file is
built when FFTW library is built using CMake. It seems the file is not created
when using Autotools to build FFTW library, but the file is necessary when one
tries to use the `FFTW3Config.cmake` to find FFTW via CMake for one's own
project.

Additional info:
* library version: fftw-3.3.8-3-x86_64
* error thrown when trying to use `find_package(FFTW)` in `CMakeLists.txt`:
```
-- The C compiler identification is GNU 10.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at /usr/lib64/cmake/fftw3/FFTW3Config.cmake:13 (include):
include could not find load file:

/usr/lib64/cmake/fftw3/FFTW3LibraryDepends.cmake
Call Stack (most recent call first):
CMakeLists.txt:<line-no> (find_package)


-- Configuring incomplete, errors occurred!
See also "<path-to-cmake-build>/CMakeFiles/CMakeOutput.log".
```

Steps to reproduce:
* Create `CMakeLists.txt`
* Add the following line to `CMakeLists.txt`:
```
find_package(FFTW)
```
* Run `cmake .`

Note: Attached a sample `FFTW3LibraryDepends.cmake`, created by me by building
fftw using CMake (OpenMP, pthread are enabled; single, long-double, quadruple
disabled; CPU instruction set optimizations disabled)
This task depends upon

Closed by  David Runge (dvzrv)
Saturday, 19 February 2022, 20:02 GMT
Reason for closing:  No response
Comment by David Runge (dvzrv) - Thursday, 10 September 2020, 07:34 GMT
@CodingPotato: Thanks for the report!

Please note that /usr/lib64/ is not in use by Arch Linux (the correct location would be /usr/lib).
Additionally: Arch usually does *not* include additional resources if they are not provided by upstream (vanilla approach). E.g. if you think that fftw should include cmake integration out-of-the-box please get in touch with upstream [1] and convince them of your idea.

We currently build fftw using autotools but upstream also provides a CMake integrated build system. I assume that it would pull in some form of integration (but I have not tested that yet). At any rate preserving the pkgconfig integration would be preferred over a cmake only integration. Ideally both build systems would provide both pkgconfig *and* cmake integration.

I can look into switching to cmake if time permits.

Closing I would like to add, that fftw provides pkgconfig integration for fftw3, fftw3f, fftw3l and fftw3q. Cmake is able to make use of that [2].

[1] https://github.com/FFTW/fftw3
[2] https://cmake.org/cmake/help/latest/module/FindPkgConfig.html
Comment by David Runge (dvzrv) - Sunday, 10 January 2021, 19:04 GMT
@CodingPotato: While using cmake might be desirable in a future release of fftw it is not possible currently as the autotools and cmake setups are not in feature parity. Overall it looks as if the cmake setup has mainly been added for windows support.

MPI support needs to be added and a patch for problems with libquadmath need to be resolved before any additional attempt can be made.

Closing, as this is for upstream to fix. If you are up for helping upstream to improve their cmake setup, you can use the PKGBUILD for the package to derive a version that is built with cmake (it's commented) while making sure that the outcome is equal to that when building with autotools.
Comment by Martin Sandsmark (sandsmark) - Thursday, 14 October 2021, 21:58 GMT
  • Field changed: Percent Complete (100% → 0%)
The reason for not using pkgconfig is cross-platform compatibility, that's why a lot of projects rather use just the cmake module (the alternative would be completely separate cmake code for separate platforms).

It can be solved by just creating a separate build dir and run cmake in it, and then install the cmake files manually in the PKGBUILD (it is not necessary to actually build with cmake to get the files).


FWIW, the upstream issue is here https://github.com/FFTW/fftw3/issues/130
Comment by David Runge (dvzrv) - Friday, 04 February 2022, 22:34 GMT
I have fixed the broken file and added it manually. Please check whether 3.3.10-2 does what you expect it to do.

Loading...