From 8b28c10fa3bb7aedc7742007f1fcb4efa5bf4cd2 Mon Sep 17 00:00:00 2001 From: John Travers Date: Tue, 25 Sep 2018 13:54:36 +0100 Subject: [PATCH] Add openmp to fftw3 --- ports/fftw3/CONTROL | 3 +++ ports/fftw3/omp_test.patch | 17 +++++++++++++++++ ports/fftw3/portfile.cmake | 13 +++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 ports/fftw3/omp_test.patch diff --git a/ports/fftw3/CONTROL b/ports/fftw3/CONTROL index fd9e597660a34c..19007525c2935e 100644 --- a/ports/fftw3/CONTROL +++ b/ports/fftw3/CONTROL @@ -1,3 +1,6 @@ Source: fftw3 Version: 3.3.7-2 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). + +Feature: openmp +Description: Builds openmp enabled lib \ No newline at end of file diff --git a/ports/fftw3/omp_test.patch b/ports/fftw3/omp_test.patch new file mode 100644 index 00000000000000..6123798a21cf95 --- /dev/null +++ b/ports/fftw3/omp_test.patch @@ -0,0 +1,17 @@ +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 () + diff --git a/ports/fftw3/portfile.cmake b/ports/fftw3/portfile.cmake index 2cf78f44cab88a..5d2344835c3803 100644 --- a/ports/fftw3/portfile.cmake +++ b/ports/fftw3/portfile.cmake @@ -17,12 +17,25 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/omp_test.patch +) + +if ("openmp" IN_LIST FEATURES) + set(ENABLE_OPENMP ON) +else() + set(ENABLE_OPENMP OFF) +endif() + foreach(PRECISION ENABLE_DEFAULT_PRECISION ENABLE_FLOAT ENABLE_LONG_DOUBLE) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS -D${PRECISION}=ON + -DENABLE_OPENMP=${ENABLE_OPENMP} ) vcpkg_install_cmake()