mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 02:48:59 +08:00
[fftw3] Fix build, cleanup (#32999)
* [fftw3] Cleanup * [fftw3] Revise openmp requirement * [fftw] Revise and fix build of variants * [fftw3] Use pristine config installation * [fftw3] Export all targets * [fftw3] Drop pointless bench linking patch
This commit is contained in:
parent
1a529a1789
commit
28de7389db
18
ports/fftw3/install-subtargets.patch
Normal file
18
ports/fftw3/install-subtargets.patch
Normal file
@ -0,0 +1,18 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index d1e4dff..ea5d579 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -361,12 +361,8 @@ endif ()
|
||||
|
||||
foreach(subtarget ${subtargets})
|
||||
set_target_properties (${subtarget} PROPERTIES SOVERSION 3.6.9 VERSION 3)
|
||||
- install (TARGETS ${subtarget}
|
||||
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endforeach ()
|
||||
-install(TARGETS ${fftw3_lib}
|
||||
+install(TARGETS ${subtargets}
|
||||
EXPORT FFTW3LibraryDepends
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
@ -1,17 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index f3cfc20..9826bff 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -385,6 +385,12 @@ if (BUILD_TESTS)
|
||||
target_link_libraries (bench ${fftw3_lib})
|
||||
endif ()
|
||||
|
||||
+ if (ENABLE_OPENMP)
|
||||
+ target_link_libraries (bench ${fftw3_lib}_omp)
|
||||
+ else ()
|
||||
+ target_link_libraries (bench ${fftw3_lib})
|
||||
+ endif ()
|
||||
+
|
||||
|
||||
enable_testing ()
|
||||
|
@ -1,41 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 335808a..90772b4 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -358,7 +358,7 @@ foreach(subtarget ${subtargets})
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endforeach ()
|
||||
install(TARGETS ${fftw3_lib}
|
||||
- EXPORT FFTW3LibraryDepends
|
||||
+ EXPORT FFTW3${PREC_SUFFIX}LibraryDepends
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
@@ -419,11 +419,11 @@ configure_file (FFTW3ConfigVersion.cmake.in FFTW3${PREC_SUFFIX}ConfigVersion.cma
|
||||
install (FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/FFTW3${PREC_SUFFIX}Config.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/FFTW3${PREC_SUFFIX}ConfigVersion.cmake
|
||||
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fftw3${PREC_SUFFIX}
|
||||
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake
|
||||
COMPONENT Development)
|
||||
|
||||
-export (TARGETS ${fftw3_lib} NAMESPACE FFTW3:: FILE ${PROJECT_BINARY_DIR}/FFTW3LibraryDepends.cmake)
|
||||
-install(EXPORT FFTW3LibraryDepends
|
||||
+export (TARGETS ${fftw3_lib} NAMESPACE FFTW3:: FILE ${PROJECT_BINARY_DIR}/FFTW3${PREC_SUFFIX}LibraryDepends.cmake)
|
||||
+install(EXPORT FFTW3${PREC_SUFFIX}LibraryDepends
|
||||
NAMESPACE FFTW3::
|
||||
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fftw3${PREC_SUFFIX}
|
||||
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake
|
||||
COMPONENT Development)
|
||||
--- a/FFTW3Config.cmake.in
|
||||
+++ b/FFTW3Config.cmake.in
|
||||
@@ -10,7 +10,7 @@ set (FFTW3@PREC_SUFFIX@_LIBRARIES fftw3@PREC_SUFFIX@)
|
||||
set (FFTW3@PREC_SUFFIX@_LIBRARY_DIRS @CMAKE_INSTALL_FULL_LIBDIR@)
|
||||
set (FFTW3@PREC_SUFFIX@_INCLUDE_DIRS @CMAKE_INSTALL_FULL_INCLUDEDIR@)
|
||||
|
||||
-include ("${CMAKE_CURRENT_LIST_DIR}/FFTW3LibraryDepends.cmake")
|
||||
+include ("${CMAKE_CURRENT_LIST_DIR}/FFTW3@PREC_SUFFIX@LibraryDepends.cmake")
|
||||
|
||||
if (CMAKE_VERSION VERSION_LESS 2.8.3)
|
||||
set (CMAKE_CURRENT_LIST_DIR)
|
||||
|
@ -8,49 +8,52 @@ vcpkg_extract_source_archive(
|
||||
SOURCE_PATH
|
||||
ARCHIVE "${ARCHIVE}"
|
||||
PATCHES
|
||||
omp_test.patch
|
||||
patch_targets.patch
|
||||
fftw3_arch_fix.patch
|
||||
aligned_malloc.patch
|
||||
bigobj.patch
|
||||
fix-openmp.patch
|
||||
install-subtargets.patch
|
||||
)
|
||||
|
||||
vcpkg_check_features(
|
||||
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
openmp ENABLE_OPENMP
|
||||
openmp ENABLE_OPENMP
|
||||
openmp CMAKE_REQUIRE_FIND_PACKAGE_OpenMP
|
||||
threads ENABLE_THREADS
|
||||
threads WITH_COMBINED_THREADS
|
||||
avx2 ENABLE_AVX2
|
||||
avx ENABLE_AVX
|
||||
sse2 ENABLE_SSE2
|
||||
sse ENABLE_SSE
|
||||
avx2 ENABLE_AVX2
|
||||
avx ENABLE_AVX
|
||||
sse2 ENABLE_SSE2
|
||||
sse ENABLE_SSE
|
||||
)
|
||||
|
||||
set(ENABLE_FLOAT_CMAKE fftw3f)
|
||||
set(ENABLE_LONG_DOUBLE_CMAKE fftw3l)
|
||||
set(Z_DEFAULT_PRECISION_CMAKE fftw3)
|
||||
set(package_names fftw3 fftw3f fftw3l)
|
||||
set(fftw3_options "")
|
||||
set(fftw3f_options -DENABLE_FLOAT=ON)
|
||||
set(fftw3l_options -DENABLE_LONG_DOUBLE=ON -DENABLE_AVX2=OFF -DENABLE_AVX=OFF -DENABLE_SSE2=OFF)
|
||||
|
||||
foreach(PRECISION ENABLE_FLOAT ENABLE_LONG_DOUBLE Z_DEFAULT_PRECISION)
|
||||
foreach(package_name IN LISTS package_names)
|
||||
message(STATUS "${package_name}...")
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
LOGFILE_BASE "config-${package_name}-${TARGET_TRIPLET}"
|
||||
OPTIONS
|
||||
-D${PRECISION}=ON
|
||||
${FEATURE_OPTIONS}
|
||||
${${package_name}_options} # may override FEATURE_OPTIONS
|
||||
-DBUILD_TESTS=OFF
|
||||
-DCMAKE_REQUIRE_FIND_PACKAGE_OpenMP=ON
|
||||
MAYBE_UNUSED_VARIABLES
|
||||
CMAKE_REQUIRE_FIND_PACKAGE_OpenMP
|
||||
Z_DEFAULT_PRECISION
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_cmake_build(
|
||||
LOGFILE_BASE "install-${package_name}"
|
||||
TARGET install
|
||||
)
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME ${${PRECISION}_CMAKE} CONFIG_PATH lib/cmake)
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME "${package_name}" CONFIG_PATH "lib/cmake/${package_name}")
|
||||
endforeach()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
file(READ "${SOURCE_PATH}/api/fftw3.h" _contents)
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
@ -63,6 +66,4 @@ file(WRITE "${SOURCE_PATH}/include/fftw3.h" "${_contents}")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "fftw3",
|
||||
"version": "3.3.10",
|
||||
"port-version": 7,
|
||||
"port-version": 8,
|
||||
"description": "FFTW is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data (as well as of even/odd data, i.e. the discrete cosine/sine transforms or DCT/DST).",
|
||||
"homepage": "https://www.fftw.org/",
|
||||
"license": "GPL-2.0-or-later",
|
||||
|
@ -2526,7 +2526,7 @@
|
||||
},
|
||||
"fftw3": {
|
||||
"baseline": "3.3.10",
|
||||
"port-version": 7
|
||||
"port-version": 8
|
||||
},
|
||||
"fftwpp": {
|
||||
"baseline": "2019-12-19",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "824a4cda47df1a63c0b13f2a603e7d0fb0dac900",
|
||||
"version": "3.3.10",
|
||||
"port-version": 8
|
||||
},
|
||||
{
|
||||
"git-tree": "5b1eac37609e9187b1ddf4666cc564ce6e07e891",
|
||||
"version": "3.3.10",
|
||||
|
Loading…
Reference in New Issue
Block a user