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
The file FFTW3LibraryDepends.cmake is missing #130
Comments
|
@xantares You contributed this functionality, do you know what's wrong? |
|
This file should be created by cmake: If the lib was packaged using autotools it may be absent. |
|
However as the documentation says to use |
|
+1 to the number of people hit by this. |
|
still happening on many packages. |
|
After installing FFTW v3.3.8 with homebrew, the CMake instruction |
|
One solution would be to trust the user and provide a step by step docs on how to build Or even better, create a complete CMakeLists.txt including all the dependencies for generating the code. As most of |
|
+1 |
|
As I understand it, the issue here is that the If so, I see three solutions:
|
|
For reference, the # Generated by CMake
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
message(FATAL_ERROR "CMake >= 2.6.0 required")
endif()
cmake_policy(PUSH)
cmake_policy(VERSION 2.6)
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
set(_targetsDefined)
set(_targetsNotDefined)
set(_expectedTargets)
foreach(_expectedTarget FFTW3::fftw3)
list(APPEND _expectedTargets ${_expectedTarget})
if(NOT TARGET ${_expectedTarget})
list(APPEND _targetsNotDefined ${_expectedTarget})
endif()
if(TARGET ${_expectedTarget})
list(APPEND _targetsDefined ${_expectedTarget})
endif()
endforeach()
if("${_targetsDefined}" STREQUAL "${_expectedTargets}")
unset(_targetsDefined)
unset(_targetsNotDefined)
unset(_expectedTargets)
set(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)
return()
endif()
if(NOT "${_targetsDefined}" STREQUAL "")
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n")
endif()
unset(_targetsDefined)
unset(_targetsNotDefined)
unset(_expectedTargets)
# Create imported target FFTW3::fftw3
add_library(FFTW3::fftw3 SHARED IMPORTED)
set_target_properties(FFTW3::fftw3 PROPERTIES
INTERFACE_LINK_LIBRARIES "m"
)
# Import target "FFTW3::fftw3" for configuration "Release"
set_property(TARGET FFTW3::fftw3 APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(FFTW3::fftw3 PROPERTIES
IMPORTED_LOCATION_RELEASE "/Users/stevenj/Code/fftw3/build/libfftw3.3.dylib"
IMPORTED_SONAME_RELEASE "@rpath/libfftw3.3.5.7.dylib"
)
# This file does not depend on other imported targets which have
# been exported from the same project but in a separate export set.
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)Seems like we could easily generate this: just substitute the correct path into |
I see that the file contains: # Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)Is the format version documented somewhere, or does it need to be reverse engineered? The latter case might require some efforts to follow up on changes needed to accommodate operating systems, build types, etc. that we didn't account for in the first implementation. |
No, but it is hard-coded to 1 in
This would only be used for autoconf builds on Unix systems. But in any case if you look at the |
I suggest this. Maintaining build systems that CMake can generate automatically is counterproductive. |
|
I run into this too. This could be fixed by build with cmake and copy FFTW3LibraryDepends.cmake manually on my environment: mkdir build & cd build |
|
The autotools build also installs the files in That becomes relevant because it interferes with autodiscovery when using Granted, even on the CMake side it might be better to support multiple library builds in a single run, with different precision options. (As opposed to currently, where you have to build each in a separate build tree or the configs will trample all over each other setting up the one Set up that way, another project could use e.g. As a single package, the CMake configuration(s) could all live in the same directory, named for the package, and at least some of the common configuration would be shared between the components. But I agree the CMake configs as generated by the autotools build aren't useful today. It shouldn't even be trying to install them (broken, and in the wrong place), unless it's going to use CMake to ensure that they'll be proper, valid configs. Looking at the history of |
|
Hi! I package fftw for Arch Linux. The file FFTW3LibraryDepends.cmake is still missing when building/installing with autotools (building/installing with cmake seems not to be an option as it is still not providing all features that the autotools build provides), which means that the libraries can not be used using cmake. When looking at using cmake to generate the file, I realized that the file would also contain broken properties:
|
Fix and add missing FFTW3LibraryDepends.cmake: FFTW/fftw3#130 https://bugs.archlinux.org/task/67604 Simplify quoting in file. Simplify calls to make and cmake. Update maintainer info. git-svn-id: file:///srv/repos/svn-packages/svn@436219 eb2447ed-0c53-47e4-bac8-5bc4a241df78
Fix and add missing FFTW3LibraryDepends.cmake: FFTW/fftw3#130 https://bugs.archlinux.org/task/67604 Simplify quoting in file. Simplify calls to make and cmake. Update maintainer info. git-svn-id: file:///srv/repos/svn-packages/svn@436219 eb2447ed-0c53-47e4-bac8-5bc4a241df78
|
when i build fftw with cmake, expected: source: configure PACKAGE_VERSION='3.3.10'CMakeLists.txt set (FFTW_VERSION 3.3.9)ideally the version is single-sourced, for example from the file VERSION diff of cmake files: gnumake-build vs cmake-builddiff -r -u /nix/store/xggal21xgmk747gwhzbkrg8ddgyqwkcd-fftw-double-3.3.10-dev/lib/cmake/fftw3/FFTW3Config.cmake /nix/store/992cz8d5hh0s265h7swj0943b0xrkhls-fftw-double-3.3.10-dev/lib/cmake/fftw3/FFTW3Config.cmake
--- /nix/store/xggal21xgmk747gwhzbkrg8ddgyqwkcd-fftw-double-3.3.10-dev/lib/cmake/fftw3/FFTW3Config.cmake 1969-12-31 16:00:01.000000000 -0800
+++ /nix/store/992cz8d5hh0s265h7swj0943b0xrkhls-fftw-double-3.3.10-dev/lib/cmake/fftw3/FFTW3Config.cmake 1969-12-31 16:00:01.000000000 -0800
@@ -7,8 +7,8 @@
set (FFTW3_CONFIG_FILE "${CMAKE_CURRENT_LIST_FILE}")
set (FFTW3_LIBRARIES fftw3)
-set (FFTW3_LIBRARY_DIRS /nix/store/dyizjvy16q1j7q79z59xb2a1dx7vd317-fftw-double-3.3.10/lib)
-set (FFTW3_INCLUDE_DIRS /nix/store/xggal21xgmk747gwhzbkrg8ddgyqwkcd-fftw-double-3.3.10-dev/include)
+set (FFTW3_LIBRARY_DIRS /nix/store/vw2gnkz6ksbcpbn8j9z01wlc4f3qf35q-fftw-double-3.3.10/lib)
+set (FFTW3_INCLUDE_DIRS /nix/store/992cz8d5hh0s265h7swj0943b0xrkhls-fftw-double-3.3.10-dev/include)
include ("${CMAKE_CURRENT_LIST_DIR}/FFTW3LibraryDepends.cmake")
diff -r -u /nix/store/xggal21xgmk747gwhzbkrg8ddgyqwkcd-fftw-double-3.3.10-dev/lib/cmake/fftw3/FFTW3ConfigVersion.cmake /nix/store/992cz8d5hh0s265h7swj0943b0xrkhls-fftw-double-3.3.10-dev/lib/cmake/fftw3/FFTW3ConfigVersion.cmake
--- /nix/store/xggal21xgmk747gwhzbkrg8ddgyqwkcd-fftw-double-3.3.10-dev/lib/cmake/fftw3/FFTW3ConfigVersion.cmake 1969-12-31 16:00:01.000000000 -0800
+++ /nix/store/992cz8d5hh0s265h7swj0943b0xrkhls-fftw-double-3.3.10-dev/lib/cmake/fftw3/FFTW3ConfigVersion.cmake 1969-12-31 16:00:01.000000000 -0800
@@ -1,5 +1,5 @@
-set (PACKAGE_VERSION "3.3.10")
+set (PACKAGE_VERSION "3.3.9")
# Check whether the requested PACKAGE_FIND_VERSION is compatible
if ("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
Only in /nix/store/992cz8d5hh0s265h7swj0943b0xrkhls-fftw-double-3.3.10-dev/lib/cmake/fftw3: FFTW3LibraryDepends.cmake
Only in /nix/store/992cz8d5hh0s265h7swj0943b0xrkhls-fftw-double-3.3.10-dev/lib/cmake/fftw3: FFTW3LibraryDepends-release.cmake
diff -r -u /nix/store/xggal21xgmk747gwhzbkrg8ddgyqwkcd-fftw-double-3.3.10-dev/lib/pkgconfig/fftw3.pc /nix/store/992cz8d5hh0s265h7swj0943b0xrkhls-fftw-double-3.3.10-dev/lib/pkgconfig/fftw3.pc
--- /nix/store/xggal21xgmk747gwhzbkrg8ddgyqwkcd-fftw-double-3.3.10-dev/lib/pkgconfig/fftw3.pc 1969-12-31 16:00:01.000000000 -0800
+++ /nix/store/992cz8d5hh0s265h7swj0943b0xrkhls-fftw-double-3.3.10-dev/lib/pkgconfig/fftw3.pc 1969-12-31 16:00:01.000000000 -0800
@@ -1,11 +1,11 @@
-prefix=/nix/store/dyizjvy16q1j7q79z59xb2a1dx7vd317-fftw-double-3.3.10
-exec_prefix=${prefix}
-libdir=/nix/store/dyizjvy16q1j7q79z59xb2a1dx7vd317-fftw-double-3.3.10/lib
-includedir=/nix/store/xggal21xgmk747gwhzbkrg8ddgyqwkcd-fftw-double-3.3.10-dev/include
+prefix=/nix/store/vw2gnkz6ksbcpbn8j9z01wlc4f3qf35q-fftw-double-3.3.10
+exec_prefix=/nix/store/vw2gnkz6ksbcpbn8j9z01wlc4f3qf35q-fftw-double-3.3.10
+libdir=/nix/store/vw2gnkz6ksbcpbn8j9z01wlc4f3qf35q-fftw-double-3.3.10/lib
+includedir=/nix/store/992cz8d5hh0s265h7swj0943b0xrkhls-fftw-double-3.3.10-dev/include
Name: FFTW
Description: fast Fourier transform library
-Version: 3.3.10
+Version: 3.3.9
Libs: -L${libdir} -lfftw3
Libs.private: -lm
Cflags: -I${includedir} |
|
example: migrate autotools-build to cmake-build diff: fftw in nixpkgshttps://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/fftw/default.nix diff --git a/pkgs/development/libraries/fftw/default.nix b/pkgs/development/libraries/fftw/default.nix
index e57cbc34fa2..a56a9b9eaf1 100644
--- a/pkgs/development/libraries/fftw/default.nix
+++ b/pkgs/development/libraries/fftw/default.nix
@@ -1,6 +1,7 @@
{ fetchurl
, stdenv
, lib
+, cmake
, gfortran
, perl
, llvmPackages
@@ -11,7 +12,7 @@
, enableFma ? stdenv.hostPlatform.fmaSupport
, enableMpi ? false
, mpi
-, withDoc ? stdenv.cc.isGNU
+, enableFortran ? stdenv.cc.isGNU # generate Fortran wrapper with hardcoded gcc
}:
with lib;
@@ -30,33 +31,52 @@ stdenv.mkDerivation rec {
sha256 = "sha256-VskyVJhSzdz6/as4ILAgDHdCZ1vpIXnlnmIVs0DiZGc=";
};
- outputs = [ "out" "dev" "man" ]
- ++ optional withDoc "info"; # it's dev-doc only
- outputBin = "dev"; # fftw-wisdom
+ # fix package version in cmake files
+ # https://github.com/FFTW/fftw3/issues/130#issuecomment-1409884653
+ postPatch = ''
+ substituteInPlace CMakeLists.txt \
+ --replace "set (FFTW_VERSION 3.3.9)" "set (FFTW_VERSION 3.3.10)"
+ '';
- nativeBuildInputs = [ gfortran ];
+ outputs = [ "out" "dev" ];
+ #outputBin = "dev"; # fftw-wisdom # not in cmake
+
+ nativeBuildInputs = [
+ gfortran
+ cmake
+ ];
buildInputs = optionals stdenv.cc.isClang [
# TODO: This may mismatch the LLVM version sin the stdenv, see #79818.
llvmPackages.openmp
] ++ optional enableMpi mpi;
- configureFlags =
- [ "--enable-shared"
- "--enable-threads"
+ cmakeFlags =
+ let
+ # all x86_64 have sse2
+ # however, not all float sizes fit
+ enableSse2 = (stdenv.isx86_64 && (precision == "single" || precision == "double"));
+ enableSse = enableSse2;
+ in
+ [
+ "-DBUILD_SHARED_LIBS=ON"
+ #"-DBUILD_TESTS=ON" # default ON
+ "-DENABLE_OPENMP=ON" # Use OpenMP for multithreading
+ "-DENABLE_THREADS=ON" # Use pthread for multithreading
]
- ++ optional (precision != "double") "--enable-${precision}"
- # all x86_64 have sse2
- # however, not all float sizes fit
- ++ optional (stdenv.isx86_64 && (precision == "single" || precision == "double") ) "--enable-sse2"
- ++ optional enableAvx "--enable-avx"
- ++ optional enableAvx2 "--enable-avx2"
- ++ optional enableAvx512 "--enable-avx512"
- ++ optional enableFma "--enable-fma"
- ++ [ "--enable-openmp" ]
- ++ optional enableMpi "--enable-mpi"
- # doc generation causes Fortran wrapper generation which hard-codes gcc
- ++ optional (!withDoc) "--disable-doc";
+ # default precision is double
+ ++ optional (precision == "single") "-DENABLE_FLOAT=ON"
+ ++ optional (precision == "long-double") "-DENABLE_LONG_DOUBLE=ON"
+ ++ optional (precision == "quad-precision") "-DENABLE_QUAD_PRECISION=ON"
+ ++ optional enableSse "-DENABLE_SSE=ON"
+ ++ optional enableSse2 "-DENABLE_SSE2=ON"
+ ++ optional enableAvx "-DENABLE_AVX=ON"
+ ++ optional enableAvx2 "-DENABLE_AVX2=ON"
+ #++ optional enableAvx512 "-DENABLE_AVX512=ON" # missing in cmake
+ #++ optional enableFma "-DENABLE_FMA=ON" # missing in cmake
+ #++ optional enableMpi "-DENABLE_MPI=ON" # missing in cmake
+ ++ optional (!enableFortran) "-DDISABLE_FORTRAN=ON"
+ ;
enableParallelBuilding = true;
not in cmake-build:
|
Could I ask about that, where did you download the file FFTW3LibraryDepends.cmake? |
The file
FFTW3Config.cmaketries to include the fileFFTW3LibraryDepends.cmake, which is apparently missing in release 3.3.7.The text was updated successfully, but these errors were encountered: