Skip to content
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

Add openmp to fftw3 #4351

Merged
merged 1 commit into from
Feb 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ports/fftw3/CONTROL
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions ports/fftw3/omp_test.patch
Original file line number Diff line number Diff line change
@@ -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 ()

13 changes: 13 additions & 0 deletions ports/fftw3/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down