mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-14 06:28:00 +08:00
[fftw3] fix openmp on macos (#30833)
Co-authored-by: Monica <v-liumonica@microsoft.com>
This commit is contained in:
parent
fb9be49cc9
commit
87a38a4fd5
13
ports/fftw3/fix-openmp.patch
Normal file
13
ports/fftw3/fix-openmp.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index ce438a3..43c74be 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -356,7 +356,7 @@ if (OPENMP_FOUND)
|
||||
target_link_libraries (${fftw3_lib}_omp ${fftw3_lib})
|
||||
target_link_libraries (${fftw3_lib}_omp ${CMAKE_THREAD_LIBS_INIT})
|
||||
list (APPEND subtargets ${fftw3_lib}_omp)
|
||||
- target_compile_options (${fftw3_lib}_omp PRIVATE ${OpenMP_C_FLAGS})
|
||||
+ target_link_libraries (${fftw3_lib}_omp OpenMP::OpenMP_C)
|
||||
endif ()
|
||||
|
||||
foreach(subtarget ${subtargets})
|
@ -6,13 +6,14 @@ vcpkg_download_distfile(ARCHIVE
|
||||
|
||||
vcpkg_extract_source_archive(
|
||||
SOURCE_PATH
|
||||
ARCHIVE ${ARCHIVE}
|
||||
ARCHIVE "${ARCHIVE}"
|
||||
PATCHES
|
||||
omp_test.patch
|
||||
patch_targets.patch
|
||||
fftw3_arch_fix.patch
|
||||
aligned_malloc.patch
|
||||
bigobj.patch
|
||||
fix-openmp.patch
|
||||
)
|
||||
|
||||
vcpkg_check_features(
|
||||
@ -29,28 +30,20 @@ vcpkg_check_features(
|
||||
|
||||
set(ENABLE_FLOAT_CMAKE fftw3f)
|
||||
set(ENABLE_LONG_DOUBLE_CMAKE fftw3l)
|
||||
set(ENABLE_DEFAULT_PRECISION_CMAKE fftw3)
|
||||
set(Z_DEFAULT_PRECISION_CMAKE fftw3)
|
||||
|
||||
foreach(PRECISION ENABLE_FLOAT ENABLE_LONG_DOUBLE ENABLE_DEFAULT_PRECISION)
|
||||
if(PRECISION STREQUAL "ENABLE_LONG_DOUBLE")
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-D${PRECISION}=ON
|
||||
-DENABLE_OPENMP=${ENABLE_OPENMP}
|
||||
-DENABLE_THREADS=${HAVE_THREADS}
|
||||
-DWITH_COMBINED_THREADS=${HAVE_THREADS}
|
||||
-DBUILD_TESTS=OFF
|
||||
)
|
||||
else()
|
||||
vcpkg_cmake_configure(
|
||||
foreach(PRECISION ENABLE_FLOAT ENABLE_LONG_DOUBLE Z_DEFAULT_PRECISION)
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-D${PRECISION}=ON
|
||||
${FEATURE_OPTIONS}
|
||||
-DBUILD_TESTS=OFF
|
||||
)
|
||||
endif()
|
||||
-DCMAKE_REQUIRE_FIND_PACKAGE_OpenMP=ON
|
||||
MAYBE_UNUSED_VARIABLES
|
||||
CMAKE_REQUIRE_FIND_PACKAGE_OpenMP
|
||||
Z_DEFAULT_PRECISION
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
@ -71,5 +64,5 @@ 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_fixup_pkgconfig()
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "fftw3",
|
||||
"version": "3.3.10",
|
||||
"port-version": 6,
|
||||
"port-version": 7,
|
||||
"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",
|
||||
|
@ -2490,7 +2490,7 @@
|
||||
},
|
||||
"fftw3": {
|
||||
"baseline": "3.3.10",
|
||||
"port-version": 6
|
||||
"port-version": 7
|
||||
},
|
||||
"fftwpp": {
|
||||
"baseline": "2019-12-19",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "5b1eac37609e9187b1ddf4666cc564ce6e07e891",
|
||||
"version": "3.3.10",
|
||||
"port-version": 7
|
||||
},
|
||||
{
|
||||
"git-tree": "a23ec27bf6a069ab7b60cc7c3b890a9224bf341c",
|
||||
"version": "3.3.10",
|
||||
|
Loading…
x
Reference in New Issue
Block a user