diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..3954736 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly + day: monday + time: "10:00" + timezone: America/Los_Angeles + groups: + github-actions: + patterns: + - "*" + commit-message: + prefix: CI + open-pull-requests-limit: 5 diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 397454e..aa3f705 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -10,29 +10,37 @@ on: branches: - main # Runs on pull requests targeting the main branch +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + jobs: build-linux: if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main') runs-on: ubuntu-22.04 + timeout-minutes: 60 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 - name: setup run: | sudo apt update cd ../.. - git clone https://github.com/open-ephys/plugin-GUI.git --branch main + git clone --depth 1 https://github.com/open-ephys/plugin-GUI.git --branch main sudo ./plugin-GUI/Resources/Scripts/install_linux_dependencies.sh cd plugin-GUI/Build && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .. - name: build run: | cd Build cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .. - make + cmake --build . --parallel # - name: test # run: cd build && ctest - name: deploy @@ -49,6 +57,8 @@ jobs: mkdir shared cp -r $build_dir/*.so shared cp -r libs/linux/bin/* shared + mkdir -p licenses + cp -r libs/linux/share/fftw licenses/fftw zipfile=${package}_${new_plugin_ver}.zip - zip -r -X $zipfile shared - curl -H "X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN" -T $zipfile "https://openephys.jfrog.io/artifactory/OpenEphysFFTW-plugin/linux/$zipfile" \ No newline at end of file + zip -r -X $zipfile shared licenses + curl --fail --show-error --retry 3 -H "X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN" -T "$zipfile" "https://openephys.jfrog.io/artifactory/OpenEphysFFTW-plugin/linux/$zipfile" diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 56aeba8..0be05f3 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -10,21 +10,29 @@ on: branches: - main # Runs on pull requests targeting the main branch +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + jobs: build-mac: if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main') - runs-on: macos-latest + runs-on: macos-26 + timeout-minutes: 60 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 - name: setup run: | cd ../.. - git clone https://github.com/open-ephys/plugin-GUI.git --branch main + git clone --depth 1 https://github.com/open-ephys/plugin-GUI.git --branch main cd plugin-GUI/Build && cmake -G "Xcode" .. - name: build run: | @@ -54,9 +62,11 @@ jobs: mkdir shared cp -r $build_dir/*.dylib shared cp -r libs/macos/bin/* shared + mkdir -p licenses + cp -r libs/macos/share/fftw licenses/fftw # Turn our base64-encoded certificate back to a regular .p12 file - echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12 + printf '%s' "$MACOS_CERTIFICATE" | base64 --decode > certificate.p12 # We need to create a new keychain, otherwise using the certificate will prompt # with a UI dialog asking for the certificate password, which we can't @@ -67,10 +77,12 @@ jobs: security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_CI_KEYCHAIN_PWD build.keychain /usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" -v shared/libOpenEphysFFTW.dylib --deep --strict --timestamp --options=runtime - /usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" -v shared/libfftw3.3.6.9.dylib --deep --strict --timestamp --options=runtime + for dependency in shared/libfftw3*.dylib; do + /usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" -v "$dependency" --deep --strict --timestamp --options=runtime + done /usr/bin/codesign -dv --verbose=4 shared/libOpenEphysFFTW.dylib zipfile=${package}_${new_plugin_ver}.zip - zip -r -X $zipfile shared - curl -H "X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN" -T $zipfile "https://openephys.jfrog.io/artifactory/OpenEphysFFTW-plugin/mac/$zipfile" \ No newline at end of file + zip -r -X $zipfile shared licenses + curl --fail --show-error --retry 3 -H "X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN" -T "$zipfile" "https://openephys.jfrog.io/artifactory/OpenEphysFFTW-plugin/mac/$zipfile" diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 98fd2d1..6d9b311 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -10,25 +10,34 @@ on: branches: - main # Runs on pull requests targeting the main branch +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + jobs: build-windows: if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main') - runs-on: windows-latest + runs-on: windows-2022 + timeout-minutes: 60 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 - name: setup run: | cd ../.. - git clone https://github.com/open-ephys/plugin-GUI.git --branch main + git clone --depth 1 https://github.com/open-ephys/plugin-GUI.git --branch main cd plugin-GUI/Build cmake -G "Visual Studio 17 2022" -A x64 .. mkdir Release && cd Release - curl -L https://openephys.jfrog.io/artifactory/GUI-binaries/Libraries/open-ephys-lib-v1.0.0.zip --output open-ephys-lib.zip - unzip open-ephys-lib.zip + curl --fail --show-error --location --retry 3 https://openephys.jfrog.io/artifactory/GUI-binaries/Libraries/open-ephys-lib-v1.0.0.zip --output open-ephys-lib.zip + echo "ce7c33a77c6bdc864e360797d9d77446fd6aa7cfa24a90fd1001794ae1de278f open-ephys-lib.zip" | sha256sum --check + unzip -q open-ephys-lib.zip shell: bash - name: configure run: | @@ -36,7 +45,7 @@ jobs: cmake -G "Visual Studio 17 2022" -A x64 .. shell: bash - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v2 + uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3 - name: build run: | msbuild Build/INSTALL.vcxproj -p:Configuration=Release -p:Platform=x64 @@ -60,7 +69,9 @@ jobs: then cp -v libs/windows/bin/x64/*.dll shared fi + mkdir -p licenses + cp -r libs/windows/share/fftw licenses/fftw zipfile=${package}_${new_plugin_ver}.zip - powershell Compress-Archive -Path "shared" -DestinationPath ${zipfile} - curl -H "X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN" -T $zipfile "https://openephys.jfrog.io/artifactory/OpenEphysFFTW-plugin/windows/$zipfile" - shell: bash \ No newline at end of file + powershell Compress-Archive -Path "shared","licenses" -DestinationPath ${zipfile} + curl --fail --show-error --retry 3 -H "X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN" -T "$zipfile" "https://openephys.jfrog.io/artifactory/OpenEphysFFTW-plugin/windows/$zipfile" + shell: bash diff --git a/.gitignore b/.gitignore index d503c08..7ec1a1a 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,6 @@ !**/Build/CMakeLists.txt !**/Build/CMAKE_README.txt +# 3. Libraries +libs/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a1bb66..a4ecebb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,12 +61,42 @@ if (NOT CMAKE_LIBRARY_ARCHITECTURE) endif() endif() +set(FFTW_ROOT "" CACHE PATH "Existing staged FFTW dependency root") +if(FFTW_ROOT) + get_filename_component(FFTW_DEPENDENCY_ROOT "${FFTW_ROOT}" ABSOLUTE) +else() + if(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8) + set(FFTW_PLATFORM windows) + elseif(LINUX AND CMAKE_SIZEOF_VOID_P EQUAL 8) + set(FFTW_PLATFORM linux) + elseif(APPLE) + set(FFTW_PLATFORM macos) + else() + message(FATAL_ERROR + "No managed FFTW bundle supports this platform. Set FFTW_ROOT explicitly.") + endif() + + set(FFTW_DEPENDENCY_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/libs/${FFTW_PLATFORM}") + execute_process( + COMMAND "${CMAKE_COMMAND}" + -DPLATFORM=${FFTW_PLATFORM} + -DOUTPUT_DIR=${CMAKE_CURRENT_SOURCE_DIR}/libs + -P ${CMAKE_CURRENT_SOURCE_DIR}/tools/PrepareFFTWBundle.cmake + RESULT_VARIABLE FFTW_PREPARE_RESULT) + if(NOT FFTW_PREPARE_RESULT EQUAL 0) + message(FATAL_ERROR + "Could not stage FFTW. Connect to the network or configure with FFTW_ROOT.") + endif() +endif() + install(TARGETS ${COMMONLIB_NAME} LIBRARY DESTINATION ${GUI_COMMONLIB_DIR}/$/lib/${CMAKE_LIBRARY_ARCHITECTURE} # .so, .dylib files ARCHIVE DESTINATION ${GUI_COMMONLIB_DIR}/$/lib/${CMAKE_LIBRARY_ARCHITECTURE} # .lib files RUNTIME DESTINATION ${GUI_COMMONLIB_DIR}/$/bin/${CMAKE_LIBRARY_ARCHITECTURE} # .dll files ) install(FILES ${HEADER_FILES} DESTINATION ${GUI_COMMONLIB_DIR}/include) +install(DIRECTORY ${FFTW_DEPENDENCY_ROOT}/share/fftw + DESTINATION ${GUI_COMMONLIB_DIR}/share) #Libraries and compiler options if(MSVC) @@ -75,8 +105,6 @@ if(MSVC) install(TARGETS ${COMMONLIB_NAME} RUNTIME DESTINATION ${GUI_BIN_DIR}/shared) - list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/libs/windows) - elseif(LINUX) target_link_libraries(${COMMONLIB_NAME} GL X11 Xext Xinerama asound dl freetype pthread rt) set_property(TARGET ${COMMONLIB_NAME} APPEND_STRING PROPERTY LINK_FLAGS @@ -86,8 +114,6 @@ elseif(LINUX) install(TARGETS ${COMMONLIB_NAME} LIBRARY DESTINATION ${GUI_BIN_DIR}/shared) - list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/libs/linux) - elseif(APPLE) set_target_properties(${COMMONLIB_NAME} PROPERTIES BUNDLE FALSE) set_property(TARGET ${COMMONLIB_NAME} APPEND_STRING PROPERTY LINK_FLAGS @@ -97,7 +123,6 @@ elseif(APPLE) XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED NO) install(TARGETS ${COMMONLIB_NAME} DESTINATION $ENV{HOME}/Library/Application\ Support/open-ephys/shared-api10) - list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/libs/macos) endif() #create filters for vs and xcode @@ -111,27 +136,42 @@ endforeach() #additional libraries -find_library(FFTW_LIBRARY NAMES libfftw3-3 fftw3 fftw3-3) -find_path(FFTW_INCLUDE_DIRS fftw3.h) +find_library(FFTW_LIBRARY NAMES fftw3 + PATHS ${FFTW_DEPENDENCY_ROOT}/lib + ${FFTW_DEPENDENCY_ROOT}/lib/${CMAKE_LIBRARY_ARCHITECTURE} + NO_DEFAULT_PATH) +find_library(FFTW_F_LIBRARY NAMES fftw3f + PATHS ${FFTW_DEPENDENCY_ROOT}/lib + ${FFTW_DEPENDENCY_ROOT}/lib/${CMAKE_LIBRARY_ARCHITECTURE} + NO_DEFAULT_PATH) +find_path(FFTW_INCLUDE_DIRS fftw3.h + PATHS ${FFTW_DEPENDENCY_ROOT}/include + NO_DEFAULT_PATH) if (NOT FFTW_LIBRARY) - message(FATAL_ERROR "FFTW library not found") + message(FATAL_ERROR "FFTW double-precision library not found") else() message(STATUS "FFTW library: ${FFTW_LIBRARY}") endif() +if (NOT FFTW_F_LIBRARY) + message(FATAL_ERROR "FFTW single-precision library not found") +else() + message(STATUS "FFTW single-precision library: ${FFTW_F_LIBRARY}") +endif() + if (NOT FFTW_INCLUDE_DIRS) message(FATAL_ERROR "FFTW header not found") endif() if (MSVC) - install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/libs/windows/bin/${CMAKE_LIBRARY_ARCHITECTURE}/ DESTINATION ${GUI_BIN_DIR}/shared CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES}) + install(DIRECTORY ${FFTW_DEPENDENCY_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}/ DESTINATION ${GUI_BIN_DIR}/shared CONFIGURATIONS ${CMAKE_CONFIGURATION_TYPES}) elseif(LINUX) - install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/libs/linux/bin/ DESTINATION ${GUI_BIN_DIR}/shared) + install(DIRECTORY ${FFTW_DEPENDENCY_ROOT}/bin/ DESTINATION ${GUI_BIN_DIR}/shared) elseif(APPLE) - install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/libs/macos/bin/ DESTINATION $ENV{HOME}/Library/Application\ Support/open-ephys/shared-api10) + install(DIRECTORY ${FFTW_DEPENDENCY_ROOT}/bin/ DESTINATION $ENV{HOME}/Library/Application\ Support/open-ephys/shared-api10) endif() -target_link_libraries(${COMMONLIB_NAME} ${FFTW_LIBRARY}) +target_link_libraries(${COMMONLIB_NAME} ${FFTW_LIBRARY} ${FFTW_F_LIBRARY}) target_include_directories(${COMMONLIB_NAME} PRIVATE ${FFTW_INCLUDE_DIRS}) diff --git a/DependencyTests/CMakeLists.txt b/DependencyTests/CMakeLists.txt new file mode 100644 index 0000000..7df81c3 --- /dev/null +++ b/DependencyTests/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.22) +project(OpenEphysFFTWDependencySmokeTest LANGUAGES C) + +if(NOT DEFINED FFTW_ROOT) + message(FATAL_ERROR "Configure with -DFFTW_ROOT=") +endif() + +find_path(FFTW_INCLUDE_DIR fftw3.h PATHS "${FFTW_ROOT}/include" NO_DEFAULT_PATH) +find_library(FFTW_DOUBLE_LIBRARY NAMES fftw3 libfftw3-3 + PATHS "${FFTW_ROOT}/lib" NO_DEFAULT_PATH) +find_library(FFTW_FLOAT_LIBRARY NAMES fftw3f libfftw3f-3 + PATHS "${FFTW_ROOT}/lib" NO_DEFAULT_PATH) +if(NOT FFTW_INCLUDE_DIR OR NOT FFTW_DOUBLE_LIBRARY OR NOT FFTW_FLOAT_LIBRARY) + message(FATAL_ERROR "The FFTW bundle is incomplete") +endif() + +add_executable(fftw_dependency_smoke fftw_dependency_smoke.c) +target_include_directories(fftw_dependency_smoke PRIVATE "${FFTW_INCLUDE_DIR}") +target_link_libraries(fftw_dependency_smoke PRIVATE + "${FFTW_DOUBLE_LIBRARY}" "${FFTW_FLOAT_LIBRARY}") + +enable_testing() +add_test(NAME fftw_dependency_smoke COMMAND fftw_dependency_smoke) +set_tests_properties(fftw_dependency_smoke PROPERTIES + ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:${FFTW_ROOT}/bin;LD_LIBRARY_PATH=path_list_prepend:${FFTW_ROOT}/bin;DYLD_LIBRARY_PATH=path_list_prepend:${FFTW_ROOT}/bin") diff --git a/DependencyTests/fftw_dependency_smoke.c b/DependencyTests/fftw_dependency_smoke.c new file mode 100644 index 0000000..0f2cfd9 --- /dev/null +++ b/DependencyTests/fftw_dependency_smoke.c @@ -0,0 +1,35 @@ +#include + +#include +#include + +int main(void) +{ + double double_input[8] = { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + fftw_complex double_output[5]; + fftw_plan double_plan = fftw_plan_dft_r2c_1d(8, double_input, double_output, + FFTW_ESTIMATE); + if (double_plan == NULL) + return 1; + fftw_execute(double_plan); + fftw_destroy_plan(double_plan); + + float float_input[8] = { 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f }; + fftwf_complex float_output[5]; + fftwf_plan float_plan = fftwf_plan_dft_r2c_1d(8, float_input, float_output, + FFTW_ESTIMATE); + if (float_plan == NULL) + return 2; + fftwf_execute(float_plan); + fftwf_destroy_plan(float_plan); + + for (size_t index = 0; index < 5; ++index) + { + if (fabs(double_output[index][0] - 1.0) > 1.0e-12 + || fabs(double_output[index][1]) > 1.0e-12 + || fabsf(float_output[index][0] - 1.0f) > 1.0e-6f + || fabsf(float_output[index][1]) > 1.0e-6f) + return 3; + } + return 0; +} diff --git a/README.md b/README.md index 83a9f53..545c065 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,36 @@ It is currently used by the [Phase Calculator](https://github.com/tne-lab/phase- ## Dependency -On Windows, Linux, and Mac, the precompiled FFTW library is included in the `libs` folder - no need to install it manually. +OpenEphysFFTW uses complete non-threaded, shared double- and single-precision +FFTW 3.3.11 libraries. On the first configuration, CMake downloads exact, +hash-pinned conda-forge packages and stages the current platform under `libs/`. +Later configurations validate and reuse those ignored local files; conda itself +is not required. + +FFTW is redistributed under GPL-2.0-or-later. Conda-forge's recipe scripts are +redistributed under BSD-3-Clause; their notice and disclaimer remain alongside +the recipes. The bundles identify conda-forge only as their build provenance +and do not imply endorsement. + +For an offline build or a read-only source checkout, set `FFTW_ROOT` to a +previously staged platform directory: + +```bash +cmake -S . -B Build -DFFTW_ROOT=/path/to/libs/linux +``` + +Automatic staging requires CMake 3.19 or newer. Builds using `FFTW_ROOT` retain +the project's existing CMake 3.5 minimum. + +The bundles intentionally omit the separate long-double, MPI, OpenMP, and +threaded FFTW libraries. The `fftw3` and `fftw3f` libraries themselves are not +modified or symbol-stripped. + +The packaged library includes FFTW's license, source provenance, and the +conda-forge recipe used to build the binaries. ## Installation This library should be built outside of the main GUI file tree using CMake. In order to do so, it must be in a sibling directory (e.g. OEPlugins) to `plugin-GUI` and the GUI must have already been compiled. -See the wiki page [here](https://open-ephys.github.io/gui-docs/Developer-Guide/Compiling-plugins.html) for build instructions. \ No newline at end of file +See the wiki page [here](https://open-ephys.github.io/gui-docs/Developer-Guide/Compiling-plugins.html) for build instructions. diff --git a/libs/linux/bin/libfftw3.so.3 b/libs/linux/bin/libfftw3.so.3 deleted file mode 100644 index c850b14..0000000 Binary files a/libs/linux/bin/libfftw3.so.3 and /dev/null differ diff --git a/libs/linux/include/fftw3.h b/libs/linux/include/fftw3.h deleted file mode 100644 index 7bd4c6e..0000000 --- a/libs/linux/include/fftw3.h +++ /dev/null @@ -1,514 +0,0 @@ -/* - * Copyright (c) 2003, 2007-14 Matteo Frigo - * Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology - * - * The following statement of license applies *only* to this header file, - * and *not* to the other files distributed with FFTW or derived therefrom: - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/***************************** NOTE TO USERS ********************************* - * - * THIS IS A HEADER FILE, NOT A MANUAL - * - * If you want to know how to use FFTW, please read the manual, - * online at http://www.fftw.org/doc/ and also included with FFTW. - * For a quick start, see the manual's tutorial section. - * - * (Reading header files to learn how to use a library is a habit - * stemming from code lacking a proper manual. Arguably, it's a - * *bad* habit in most cases, because header files can contain - * interfaces that are not part of the public, stable API.) - * - ****************************************************************************/ - -#ifndef FFTW3_H -#define FFTW3_H - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* If is included, use the C99 complex type. Otherwise - define a type bit-compatible with C99 complex */ -#if !defined(FFTW_NO_Complex) && defined(_Complex_I) && defined(complex) && defined(I) -# define FFTW_DEFINE_COMPLEX(R, C) typedef R _Complex C -#else -# define FFTW_DEFINE_COMPLEX(R, C) typedef R C[2] -#endif - -#define FFTW_CONCAT(prefix, name) prefix ## name -#define FFTW_MANGLE_DOUBLE(name) FFTW_CONCAT(fftw_, name) -#define FFTW_MANGLE_FLOAT(name) FFTW_CONCAT(fftwf_, name) -#define FFTW_MANGLE_LONG_DOUBLE(name) FFTW_CONCAT(fftwl_, name) -#define FFTW_MANGLE_QUAD(name) FFTW_CONCAT(fftwq_, name) - -/* IMPORTANT: for Windows compilers, you should add a line - #define FFTW_DLL - here and in kernel/ifftw.h if you are compiling/using FFTW as a - DLL, in order to do the proper importing/exporting, or - alternatively compile with -DFFTW_DLL or the equivalent - command-line flag. This is not necessary under MinGW/Cygwin, where - libtool does the imports/exports automatically. */ -#if defined(FFTW_DLL) && (defined(_WIN32) || defined(__WIN32__)) - /* annoying Windows syntax for shared-library declarations */ -# if defined(COMPILING_FFTW) /* defined in api.h when compiling FFTW */ -# define FFTW_EXTERN extern __declspec(dllexport) -# else /* user is calling FFTW; import symbol */ -# define FFTW_EXTERN extern __declspec(dllimport) -# endif -#else -# define FFTW_EXTERN extern -#endif - -/* specify calling convention (Windows only) */ -#if defined(_WIN32) || defined(__WIN32__) -# define FFTW_CDECL __cdecl -#else -# define FFTW_CDECL -#endif - -enum fftw_r2r_kind_do_not_use_me { - FFTW_R2HC=0, FFTW_HC2R=1, FFTW_DHT=2, - FFTW_REDFT00=3, FFTW_REDFT01=4, FFTW_REDFT10=5, FFTW_REDFT11=6, - FFTW_RODFT00=7, FFTW_RODFT01=8, FFTW_RODFT10=9, FFTW_RODFT11=10 -}; - -struct fftw_iodim_do_not_use_me { - int n; /* dimension size */ - int is; /* input stride */ - int os; /* output stride */ -}; - -#include /* for ptrdiff_t */ -struct fftw_iodim64_do_not_use_me { - ptrdiff_t n; /* dimension size */ - ptrdiff_t is; /* input stride */ - ptrdiff_t os; /* output stride */ -}; - -typedef void (FFTW_CDECL *fftw_write_char_func_do_not_use_me)(char c, void *); -typedef int (FFTW_CDECL *fftw_read_char_func_do_not_use_me)(void *); - -/* - huge second-order macro that defines prototypes for all API - functions. We expand this macro for each supported precision - - X: name-mangling macro - R: real data type - C: complex data type -*/ - -#define FFTW_DEFINE_API(X, R, C) \ - \ -FFTW_DEFINE_COMPLEX(R, C); \ - \ -typedef struct X(plan_s) *X(plan); \ - \ -typedef struct fftw_iodim_do_not_use_me X(iodim); \ -typedef struct fftw_iodim64_do_not_use_me X(iodim64); \ - \ -typedef enum fftw_r2r_kind_do_not_use_me X(r2r_kind); \ - \ -typedef fftw_write_char_func_do_not_use_me X(write_char_func); \ -typedef fftw_read_char_func_do_not_use_me X(read_char_func); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(execute)(const X(plan) p); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft)(int rank, const int *n, \ - C *in, C *out, int sign, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_1d)(int n, C *in, C *out, int sign, \ - unsigned flags); \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_2d)(int n0, int n1, \ - C *in, C *out, int sign, unsigned flags); \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_3d)(int n0, int n1, int n2, \ - C *in, C *out, int sign, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_many_dft)(int rank, const int *n, \ - int howmany, \ - C *in, const int *inembed, \ - int istride, int idist, \ - C *out, const int *onembed, \ - int ostride, int odist, \ - int sign, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru_dft)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - C *in, C *out, \ - int sign, unsigned flags); \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru_split_dft)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - R *ri, R *ii, R *ro, R *io, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru64_dft)(int rank, \ - const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - C *in, C *out, \ - int sign, unsigned flags); \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru64_split_dft)(int rank, \ - const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - R *ri, R *ii, R *ro, R *io, \ - unsigned flags); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(execute_dft)(const X(plan) p, C *in, C *out); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(execute_split_dft)(const X(plan) p, R *ri, R *ii, \ - R *ro, R *io); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_many_dft_r2c)(int rank, const int *n, \ - int howmany, \ - R *in, const int *inembed, \ - int istride, int idist, \ - C *out, const int *onembed, \ - int ostride, int odist, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_r2c)(int rank, const int *n, \ - R *in, C *out, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_r2c_1d)(int n,R *in,C *out,unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_r2c_2d)(int n0, int n1, \ - R *in, C *out, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_r2c_3d)(int n0, int n1, \ - int n2, \ - R *in, C *out, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_many_dft_c2r)(int rank, const int *n, \ - int howmany, \ - C *in, const int *inembed, \ - int istride, int idist, \ - R *out, const int *onembed, \ - int ostride, int odist, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_c2r)(int rank, const int *n, \ - C *in, R *out, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_c2r_1d)(int n,C *in,R *out,unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_c2r_2d)(int n0, int n1, \ - C *in, R *out, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_c2r_3d)(int n0, int n1, \ - int n2, \ - C *in, R *out, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru_dft_r2c)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - R *in, C *out, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru_dft_c2r)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - C *in, R *out, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru_split_dft_r2c)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - R *in, R *ro, R *io, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru_split_dft_c2r)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - R *ri, R *ii, R *out, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru64_dft_r2c)(int rank, \ - const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - R *in, C *out, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru64_dft_c2r)(int rank, \ - const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - C *in, R *out, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru64_split_dft_r2c)(int rank, const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - R *in, R *ro, R *io, \ - unsigned flags); \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru64_split_dft_c2r)(int rank, const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - R *ri, R *ii, R *out, \ - unsigned flags); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(execute_dft_r2c)(const X(plan) p, R *in, C *out); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(execute_dft_c2r)(const X(plan) p, C *in, R *out); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(execute_split_dft_r2c)(const X(plan) p, \ - R *in, R *ro, R *io); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(execute_split_dft_c2r)(const X(plan) p, \ - R *ri, R *ii, R *out); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_many_r2r)(int rank, const int *n, \ - int howmany, \ - R *in, const int *inembed, \ - int istride, int idist, \ - R *out, const int *onembed, \ - int ostride, int odist, \ - const X(r2r_kind) *kind, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_r2r)(int rank, const int *n, R *in, R *out, \ - const X(r2r_kind) *kind, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_r2r_1d)(int n, R *in, R *out, \ - X(r2r_kind) kind, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_r2r_2d)(int n0, int n1, R *in, R *out, \ - X(r2r_kind) kind0, X(r2r_kind) kind1, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_r2r_3d)(int n0, int n1, int n2, \ - R *in, R *out, X(r2r_kind) kind0, \ - X(r2r_kind) kind1, X(r2r_kind) kind2, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru_r2r)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - R *in, R *out, \ - const X(r2r_kind) *kind, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru64_r2r)(int rank, const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - R *in, R *out, \ - const X(r2r_kind) *kind, unsigned flags); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(execute_r2r)(const X(plan) p, R *in, R *out); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(destroy_plan)(X(plan) p); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(forget_wisdom)(void); \ -FFTW_EXTERN void \ -FFTW_CDECL X(cleanup)(void); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(set_timelimit)(double t); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(plan_with_nthreads)(int nthreads); \ - \ -FFTW_EXTERN int \ -FFTW_CDECL X(init_threads)(void); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(cleanup_threads)(void); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(make_planner_thread_safe)(void); \ - \ -FFTW_EXTERN int \ -FFTW_CDECL X(export_wisdom_to_filename)(const char *filename); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(export_wisdom_to_file)(FILE *output_file); \ - \ -FFTW_EXTERN char * \ -FFTW_CDECL X(export_wisdom_to_string)(void); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(export_wisdom)(X(write_char_func) write_char, \ - void *data); \ -FFTW_EXTERN int \ -FFTW_CDECL X(import_system_wisdom)(void); \ - \ -FFTW_EXTERN int \ -FFTW_CDECL X(import_wisdom_from_filename)(const char *filename); \ - \ -FFTW_EXTERN int \ -FFTW_CDECL X(import_wisdom_from_file)(FILE *input_file); \ - \ -FFTW_EXTERN int \ -FFTW_CDECL X(import_wisdom_from_string)(const char *input_string); \ - \ -FFTW_EXTERN int \ -FFTW_CDECL X(import_wisdom)(X(read_char_func) read_char, void *data); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(fprint_plan)(const X(plan) p, FILE *output_file); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(print_plan)(const X(plan) p); \ - \ -FFTW_EXTERN char * \ -FFTW_CDECL X(sprint_plan)(const X(plan) p); \ - \ -FFTW_EXTERN void * \ -FFTW_CDECL X(malloc)(size_t n); \ - \ -FFTW_EXTERN R * \ -FFTW_CDECL X(alloc_real)(size_t n); \ -FFTW_EXTERN C * \ -FFTW_CDECL X(alloc_complex)(size_t n); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(free)(void *p); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(flops)(const X(plan) p, \ - double *add, double *mul, double *fmas); \ -FFTW_EXTERN double \ -FFTW_CDECL X(estimate_cost)(const X(plan) p); \ - \ -FFTW_EXTERN double \ -FFTW_CDECL X(cost)(const X(plan) p); \ - \ -FFTW_EXTERN int \ -FFTW_CDECL X(alignment_of)(R *p); \ - \ -FFTW_EXTERN const char X(version)[]; \ -FFTW_EXTERN const char X(cc)[]; \ -FFTW_EXTERN const char X(codelet_optim)[]; - - -/* end of FFTW_DEFINE_API macro */ - -FFTW_DEFINE_API(FFTW_MANGLE_DOUBLE, double, fftw_complex) -FFTW_DEFINE_API(FFTW_MANGLE_FLOAT, float, fftwf_complex) -FFTW_DEFINE_API(FFTW_MANGLE_LONG_DOUBLE, long double, fftwl_complex) - -/* __float128 (quad precision) is a gcc extension on i386, x86_64, and ia64 - for gcc >= 4.6 (compiled in FFTW with --enable-quad-precision) */ -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) \ - && !(defined(__ICC) || defined(__INTEL_COMPILER) || defined(__CUDACC__) || defined(__PGI)) \ - && (defined(__i386__) || defined(__x86_64__) || defined(__ia64__)) -# if !defined(FFTW_NO_Complex) && defined(_Complex_I) && defined(complex) && defined(I) -/* note: __float128 is a typedef, which is not supported with the _Complex - keyword in gcc, so instead we use this ugly __attribute__ version. - However, we can't simply pass the __attribute__ version to - FFTW_DEFINE_API because the __attribute__ confuses gcc in pointer - types. Hence redefining FFTW_DEFINE_COMPLEX. Ugh. */ -# undef FFTW_DEFINE_COMPLEX -# define FFTW_DEFINE_COMPLEX(R, C) typedef _Complex float __attribute__((mode(TC))) C -# endif -FFTW_DEFINE_API(FFTW_MANGLE_QUAD, __float128, fftwq_complex) -#endif - -#define FFTW_FORWARD (-1) -#define FFTW_BACKWARD (+1) - -#define FFTW_NO_TIMELIMIT (-1.0) - -/* documented flags */ -#define FFTW_MEASURE (0U) -#define FFTW_DESTROY_INPUT (1U << 0) -#define FFTW_UNALIGNED (1U << 1) -#define FFTW_CONSERVE_MEMORY (1U << 2) -#define FFTW_EXHAUSTIVE (1U << 3) /* NO_EXHAUSTIVE is default */ -#define FFTW_PRESERVE_INPUT (1U << 4) /* cancels FFTW_DESTROY_INPUT */ -#define FFTW_PATIENT (1U << 5) /* IMPATIENT is default */ -#define FFTW_ESTIMATE (1U << 6) -#define FFTW_WISDOM_ONLY (1U << 21) - -/* undocumented beyond-guru flags */ -#define FFTW_ESTIMATE_PATIENT (1U << 7) -#define FFTW_BELIEVE_PCOST (1U << 8) -#define FFTW_NO_DFT_R2HC (1U << 9) -#define FFTW_NO_NONTHREADED (1U << 10) -#define FFTW_NO_BUFFERING (1U << 11) -#define FFTW_NO_INDIRECT_OP (1U << 12) -#define FFTW_ALLOW_LARGE_GENERIC (1U << 13) /* NO_LARGE_GENERIC is default */ -#define FFTW_NO_RANK_SPLITS (1U << 14) -#define FFTW_NO_VRANK_SPLITS (1U << 15) -#define FFTW_NO_VRECURSE (1U << 16) -#define FFTW_NO_SIMD (1U << 17) -#define FFTW_NO_SLOW (1U << 18) -#define FFTW_NO_FIXED_RADIX_LARGE_N (1U << 19) -#define FFTW_ALLOW_PRUNING (1U << 20) - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif /* FFTW3_H */ diff --git a/libs/linux/lib/libfftw3.so b/libs/linux/lib/libfftw3.so deleted file mode 100644 index c850b14..0000000 Binary files a/libs/linux/lib/libfftw3.so and /dev/null differ diff --git a/libs/macos/bin/libfftw3.3.6.9.dylib b/libs/macos/bin/libfftw3.3.6.9.dylib deleted file mode 100755 index dbd5f2a..0000000 Binary files a/libs/macos/bin/libfftw3.3.6.9.dylib and /dev/null differ diff --git a/libs/macos/include/fftw3.h b/libs/macos/include/fftw3.h deleted file mode 100644 index 65f8b89..0000000 --- a/libs/macos/include/fftw3.h +++ /dev/null @@ -1,522 +0,0 @@ -/* - * Copyright (c) 2003, 2007-14 Matteo Frigo - * Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology - * - * The following statement of license applies *only* to this header file, - * and *not* to the other files distributed with FFTW or derived therefrom: - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/***************************** NOTE TO USERS ********************************* - * - * THIS IS A HEADER FILE, NOT A MANUAL - * - * If you want to know how to use FFTW, please read the manual, - * online at http://www.fftw.org/doc/ and also included with FFTW. - * For a quick start, see the manual's tutorial section. - * - * (Reading header files to learn how to use a library is a habit - * stemming from code lacking a proper manual. Arguably, it's a - * *bad* habit in most cases, because header files can contain - * interfaces that are not part of the public, stable API.) - * - ****************************************************************************/ - -#ifndef FFTW3_H -#define FFTW3_H - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* If is included, use the C99 complex type. Otherwise - define a type bit-compatible with C99 complex */ -#if !defined(FFTW_NO_Complex) && defined(_Complex_I) && defined(complex) && defined(I) -# define FFTW_DEFINE_COMPLEX(R, C) typedef R _Complex C -#else -# define FFTW_DEFINE_COMPLEX(R, C) typedef R C[2] -#endif - -#define FFTW_CONCAT(prefix, name) prefix ## name -#define FFTW_MANGLE_DOUBLE(name) FFTW_CONCAT(fftw_, name) -#define FFTW_MANGLE_FLOAT(name) FFTW_CONCAT(fftwf_, name) -#define FFTW_MANGLE_LONG_DOUBLE(name) FFTW_CONCAT(fftwl_, name) -#define FFTW_MANGLE_QUAD(name) FFTW_CONCAT(fftwq_, name) - -/* IMPORTANT: for Windows compilers, you should add a line - #define FFTW_DLL - here and in kernel/ifftw.h if you are compiling/using FFTW as a - DLL, in order to do the proper importing/exporting, or - alternatively compile with -DFFTW_DLL or the equivalent - command-line flag. This is not necessary under MinGW/Cygwin, where - libtool does the imports/exports automatically. */ -#if defined(FFTW_DLL) && (defined(_WIN32) || defined(__WIN32__)) - /* annoying Windows syntax for shared-library declarations */ -# if defined(COMPILING_FFTW) /* defined in api.h when compiling FFTW */ -# define FFTW_EXTERN extern __declspec(dllexport) -# else /* user is calling FFTW; import symbol */ -# define FFTW_EXTERN extern __declspec(dllimport) -# endif -#else -# define FFTW_EXTERN extern -#endif - -/* specify calling convention (Windows only) */ -#if defined(_WIN32) || defined(__WIN32__) -# define FFTW_CDECL __cdecl -#else -# define FFTW_CDECL -#endif - -enum fftw_r2r_kind_do_not_use_me { - FFTW_R2HC=0, FFTW_HC2R=1, FFTW_DHT=2, - FFTW_REDFT00=3, FFTW_REDFT01=4, FFTW_REDFT10=5, FFTW_REDFT11=6, - FFTW_RODFT00=7, FFTW_RODFT01=8, FFTW_RODFT10=9, FFTW_RODFT11=10 -}; - -struct fftw_iodim_do_not_use_me { - int n; /* dimension size */ - int is; /* input stride */ - int os; /* output stride */ -}; - -#include /* for ptrdiff_t */ -struct fftw_iodim64_do_not_use_me { - ptrdiff_t n; /* dimension size */ - ptrdiff_t is; /* input stride */ - ptrdiff_t os; /* output stride */ -}; - -typedef void (FFTW_CDECL *fftw_write_char_func_do_not_use_me)(char c, void *); -typedef int (FFTW_CDECL *fftw_read_char_func_do_not_use_me)(void *); - -/* - huge second-order macro that defines prototypes for all API - functions. We expand this macro for each supported precision - - X: name-mangling macro - R: real data type - C: complex data type -*/ - -#define FFTW_DEFINE_API(X, R, C) \ - \ -FFTW_DEFINE_COMPLEX(R, C); \ - \ -typedef struct X(plan_s) *X(plan); \ - \ -typedef struct fftw_iodim_do_not_use_me X(iodim); \ -typedef struct fftw_iodim64_do_not_use_me X(iodim64); \ - \ -typedef enum fftw_r2r_kind_do_not_use_me X(r2r_kind); \ - \ -typedef fftw_write_char_func_do_not_use_me X(write_char_func); \ -typedef fftw_read_char_func_do_not_use_me X(read_char_func); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(execute)(const X(plan) p); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft)(int rank, const int *n, \ - C *in, C *out, int sign, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_1d)(int n, C *in, C *out, int sign, \ - unsigned flags); \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_2d)(int n0, int n1, \ - C *in, C *out, int sign, unsigned flags); \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_3d)(int n0, int n1, int n2, \ - C *in, C *out, int sign, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_many_dft)(int rank, const int *n, \ - int howmany, \ - C *in, const int *inembed, \ - int istride, int idist, \ - C *out, const int *onembed, \ - int ostride, int odist, \ - int sign, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru_dft)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - C *in, C *out, \ - int sign, unsigned flags); \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru_split_dft)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - R *ri, R *ii, R *ro, R *io, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru64_dft)(int rank, \ - const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - C *in, C *out, \ - int sign, unsigned flags); \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru64_split_dft)(int rank, \ - const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - R *ri, R *ii, R *ro, R *io, \ - unsigned flags); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(execute_dft)(const X(plan) p, C *in, C *out); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(execute_split_dft)(const X(plan) p, R *ri, R *ii, \ - R *ro, R *io); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_many_dft_r2c)(int rank, const int *n, \ - int howmany, \ - R *in, const int *inembed, \ - int istride, int idist, \ - C *out, const int *onembed, \ - int ostride, int odist, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_r2c)(int rank, const int *n, \ - R *in, C *out, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_r2c_1d)(int n,R *in,C *out,unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_r2c_2d)(int n0, int n1, \ - R *in, C *out, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_r2c_3d)(int n0, int n1, \ - int n2, \ - R *in, C *out, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_many_dft_c2r)(int rank, const int *n, \ - int howmany, \ - C *in, const int *inembed, \ - int istride, int idist, \ - R *out, const int *onembed, \ - int ostride, int odist, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_c2r)(int rank, const int *n, \ - C *in, R *out, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_c2r_1d)(int n,C *in,R *out,unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_c2r_2d)(int n0, int n1, \ - C *in, R *out, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_dft_c2r_3d)(int n0, int n1, \ - int n2, \ - C *in, R *out, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru_dft_r2c)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - R *in, C *out, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru_dft_c2r)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - C *in, R *out, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru_split_dft_r2c)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - R *in, R *ro, R *io, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru_split_dft_c2r)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - R *ri, R *ii, R *out, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru64_dft_r2c)(int rank, \ - const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - R *in, C *out, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru64_dft_c2r)(int rank, \ - const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - C *in, R *out, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru64_split_dft_r2c)(int rank, const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - R *in, R *ro, R *io, \ - unsigned flags); \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru64_split_dft_c2r)(int rank, const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - R *ri, R *ii, R *out, \ - unsigned flags); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(execute_dft_r2c)(const X(plan) p, R *in, C *out); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(execute_dft_c2r)(const X(plan) p, C *in, R *out); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(execute_split_dft_r2c)(const X(plan) p, \ - R *in, R *ro, R *io); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(execute_split_dft_c2r)(const X(plan) p, \ - R *ri, R *ii, R *out); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_many_r2r)(int rank, const int *n, \ - int howmany, \ - R *in, const int *inembed, \ - int istride, int idist, \ - R *out, const int *onembed, \ - int ostride, int odist, \ - const X(r2r_kind) *kind, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_r2r)(int rank, const int *n, R *in, R *out, \ - const X(r2r_kind) *kind, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_r2r_1d)(int n, R *in, R *out, \ - X(r2r_kind) kind, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_r2r_2d)(int n0, int n1, R *in, R *out, \ - X(r2r_kind) kind0, X(r2r_kind) kind1, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_r2r_3d)(int n0, int n1, int n2, \ - R *in, R *out, X(r2r_kind) kind0, \ - X(r2r_kind) kind1, X(r2r_kind) kind2, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru_r2r)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - R *in, R *out, \ - const X(r2r_kind) *kind, unsigned flags); \ - \ -FFTW_EXTERN X(plan) \ -FFTW_CDECL X(plan_guru64_r2r)(int rank, const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - R *in, R *out, \ - const X(r2r_kind) *kind, unsigned flags); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(execute_r2r)(const X(plan) p, R *in, R *out); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(destroy_plan)(X(plan) p); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(forget_wisdom)(void); \ -FFTW_EXTERN void \ -FFTW_CDECL X(cleanup)(void); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(set_timelimit)(double t); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(plan_with_nthreads)(int nthreads); \ - \ -FFTW_EXTERN int \ -FFTW_CDECL X(planner_nthreads)(void); \ - \ -FFTW_EXTERN int \ -FFTW_CDECL X(init_threads)(void); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(cleanup_threads)(void); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(threads_set_callback)( \ - void (*parallel_loop)(void *(*work)(char *), \ - char *jobdata, size_t elsize, int njobs, void *data), void *data); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(make_planner_thread_safe)(void); \ - \ -FFTW_EXTERN int \ -FFTW_CDECL X(export_wisdom_to_filename)(const char *filename); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(export_wisdom_to_file)(FILE *output_file); \ - \ -FFTW_EXTERN char * \ -FFTW_CDECL X(export_wisdom_to_string)(void); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(export_wisdom)(X(write_char_func) write_char, \ - void *data); \ -FFTW_EXTERN int \ -FFTW_CDECL X(import_system_wisdom)(void); \ - \ -FFTW_EXTERN int \ -FFTW_CDECL X(import_wisdom_from_filename)(const char *filename); \ - \ -FFTW_EXTERN int \ -FFTW_CDECL X(import_wisdom_from_file)(FILE *input_file); \ - \ -FFTW_EXTERN int \ -FFTW_CDECL X(import_wisdom_from_string)(const char *input_string); \ - \ -FFTW_EXTERN int \ -FFTW_CDECL X(import_wisdom)(X(read_char_func) read_char, void *data); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(fprint_plan)(const X(plan) p, FILE *output_file); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(print_plan)(const X(plan) p); \ - \ -FFTW_EXTERN char * \ -FFTW_CDECL X(sprint_plan)(const X(plan) p); \ - \ -FFTW_EXTERN void * \ -FFTW_CDECL X(malloc)(size_t n); \ - \ -FFTW_EXTERN R * \ -FFTW_CDECL X(alloc_real)(size_t n); \ -FFTW_EXTERN C * \ -FFTW_CDECL X(alloc_complex)(size_t n); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(free)(void *p); \ - \ -FFTW_EXTERN void \ -FFTW_CDECL X(flops)(const X(plan) p, \ - double *add, double *mul, double *fmas); \ -FFTW_EXTERN double \ -FFTW_CDECL X(estimate_cost)(const X(plan) p); \ - \ -FFTW_EXTERN double \ -FFTW_CDECL X(cost)(const X(plan) p); \ - \ -FFTW_EXTERN int \ -FFTW_CDECL X(alignment_of)(R *p); \ - \ -FFTW_EXTERN const char X(version)[]; \ -FFTW_EXTERN const char X(cc)[]; \ -FFTW_EXTERN const char X(codelet_optim)[]; - - -/* end of FFTW_DEFINE_API macro */ - -FFTW_DEFINE_API(FFTW_MANGLE_DOUBLE, double, fftw_complex) -FFTW_DEFINE_API(FFTW_MANGLE_FLOAT, float, fftwf_complex) -FFTW_DEFINE_API(FFTW_MANGLE_LONG_DOUBLE, long double, fftwl_complex) - -/* __float128 (quad precision) is a gcc extension on i386, x86_64, and ia64 - for gcc >= 4.6 (compiled in FFTW with --enable-quad-precision) */ -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) \ - && !(defined(__ICC) || defined(__INTEL_COMPILER) || defined(__CUDACC__) || defined(__PGI)) \ - && (defined(__i386__) || defined(__x86_64__) || defined(__ia64__)) -# if !defined(FFTW_NO_Complex) && defined(_Complex_I) && defined(complex) && defined(I) -/* note: __float128 is a typedef, which is not supported with the _Complex - keyword in gcc, so instead we use this ugly __attribute__ version. - However, we can't simply pass the __attribute__ version to - FFTW_DEFINE_API because the __attribute__ confuses gcc in pointer - types. Hence redefining FFTW_DEFINE_COMPLEX. Ugh. */ -# undef FFTW_DEFINE_COMPLEX -# define FFTW_DEFINE_COMPLEX(R, C) typedef _Complex float __attribute__((mode(TC))) C -# endif -FFTW_DEFINE_API(FFTW_MANGLE_QUAD, __float128, fftwq_complex) -#endif - -#define FFTW_FORWARD (-1) -#define FFTW_BACKWARD (+1) - -#define FFTW_NO_TIMELIMIT (-1.0) - -/* documented flags */ -#define FFTW_MEASURE (0U) -#define FFTW_DESTROY_INPUT (1U << 0) -#define FFTW_UNALIGNED (1U << 1) -#define FFTW_CONSERVE_MEMORY (1U << 2) -#define FFTW_EXHAUSTIVE (1U << 3) /* NO_EXHAUSTIVE is default */ -#define FFTW_PRESERVE_INPUT (1U << 4) /* cancels FFTW_DESTROY_INPUT */ -#define FFTW_PATIENT (1U << 5) /* IMPATIENT is default */ -#define FFTW_ESTIMATE (1U << 6) -#define FFTW_WISDOM_ONLY (1U << 21) - -/* undocumented beyond-guru flags */ -#define FFTW_ESTIMATE_PATIENT (1U << 7) -#define FFTW_BELIEVE_PCOST (1U << 8) -#define FFTW_NO_DFT_R2HC (1U << 9) -#define FFTW_NO_NONTHREADED (1U << 10) -#define FFTW_NO_BUFFERING (1U << 11) -#define FFTW_NO_INDIRECT_OP (1U << 12) -#define FFTW_ALLOW_LARGE_GENERIC (1U << 13) /* NO_LARGE_GENERIC is default */ -#define FFTW_NO_RANK_SPLITS (1U << 14) -#define FFTW_NO_VRANK_SPLITS (1U << 15) -#define FFTW_NO_VRECURSE (1U << 16) -#define FFTW_NO_SIMD (1U << 17) -#define FFTW_NO_SLOW (1U << 18) -#define FFTW_NO_FIXED_RADIX_LARGE_N (1U << 19) -#define FFTW_ALLOW_PRUNING (1U << 20) - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif /* FFTW3_H */ diff --git a/libs/macos/lib/libfftw3.dylib b/libs/macos/lib/libfftw3.dylib deleted file mode 100755 index dbd5f2a..0000000 Binary files a/libs/macos/lib/libfftw3.dylib and /dev/null differ diff --git a/libs/windows/bin/x64/libfftw3-3.dll b/libs/windows/bin/x64/libfftw3-3.dll deleted file mode 100644 index 520dbf0..0000000 Binary files a/libs/windows/bin/x64/libfftw3-3.dll and /dev/null differ diff --git a/libs/windows/bin/x86/libfftw3-3.dll b/libs/windows/bin/x86/libfftw3-3.dll deleted file mode 100644 index e8a067f..0000000 Binary files a/libs/windows/bin/x86/libfftw3-3.dll and /dev/null differ diff --git a/libs/windows/include/fftw3.h b/libs/windows/include/fftw3.h deleted file mode 100644 index 4326eae..0000000 --- a/libs/windows/include/fftw3.h +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Copyright (c) 2003, 2007-14 Matteo Frigo - * Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology - * - * The following statement of license applies *only* to this header file, - * and *not* to the other files distributed with FFTW or derived therefrom: - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/***************************** NOTE TO USERS ********************************* - * - * THIS IS A HEADER FILE, NOT A MANUAL - * - * If you want to know how to use FFTW, please read the manual, - * online at http://www.fftw.org/doc/ and also included with FFTW. - * For a quick start, see the manual's tutorial section. - * - * (Reading header files to learn how to use a library is a habit - * stemming from code lacking a proper manual. Arguably, it's a - * *bad* habit in most cases, because header files can contain - * interfaces that are not part of the public, stable API.) - * - ****************************************************************************/ - -#ifndef FFTW3_H -#define FFTW3_H - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* If is included, use the C99 complex type. Otherwise - define a type bit-compatible with C99 complex */ -#if !defined(FFTW_NO_Complex) && defined(_Complex_I) && defined(complex) && defined(I) -# define FFTW_DEFINE_COMPLEX(R, C) typedef R _Complex C -#else -# define FFTW_DEFINE_COMPLEX(R, C) typedef R C[2] -#endif - -#define FFTW_CONCAT(prefix, name) prefix ## name -#define FFTW_MANGLE_DOUBLE(name) FFTW_CONCAT(fftw_, name) -#define FFTW_MANGLE_FLOAT(name) FFTW_CONCAT(fftwf_, name) -#define FFTW_MANGLE_LONG_DOUBLE(name) FFTW_CONCAT(fftwl_, name) -#define FFTW_MANGLE_QUAD(name) FFTW_CONCAT(fftwq_, name) - -/* IMPORTANT: for Windows compilers, you should add a line -*/ -#define FFTW_DLL -/* - here and in kernel/ifftw.h if you are compiling/using FFTW as a - DLL, in order to do the proper importing/exporting, or - alternatively compile with -DFFTW_DLL or the equivalent - command-line flag. This is not necessary under MinGW/Cygwin, where - libtool does the imports/exports automatically. */ -#if defined(FFTW_DLL) && (defined(_WIN32) || defined(__WIN32__)) - /* annoying Windows syntax for shared-library declarations */ -# if defined(COMPILING_FFTW) /* defined in api.h when compiling FFTW */ -# define FFTW_EXTERN extern __declspec(dllexport) -# else /* user is calling FFTW; import symbol */ -# define FFTW_EXTERN extern __declspec(dllimport) -# endif -#else -# define FFTW_EXTERN extern -#endif - -enum fftw_r2r_kind_do_not_use_me { - FFTW_R2HC=0, FFTW_HC2R=1, FFTW_DHT=2, - FFTW_REDFT00=3, FFTW_REDFT01=4, FFTW_REDFT10=5, FFTW_REDFT11=6, - FFTW_RODFT00=7, FFTW_RODFT01=8, FFTW_RODFT10=9, FFTW_RODFT11=10 -}; - -struct fftw_iodim_do_not_use_me { - int n; /* dimension size */ - int is; /* input stride */ - int os; /* output stride */ -}; - -#include /* for ptrdiff_t */ -struct fftw_iodim64_do_not_use_me { - ptrdiff_t n; /* dimension size */ - ptrdiff_t is; /* input stride */ - ptrdiff_t os; /* output stride */ -}; - -typedef void (*fftw_write_char_func_do_not_use_me)(char c, void *); -typedef int (*fftw_read_char_func_do_not_use_me)(void *); - -/* - huge second-order macro that defines prototypes for all API - functions. We expand this macro for each supported precision - - X: name-mangling macro - R: real data type - C: complex data type -*/ - -#define FFTW_DEFINE_API(X, R, C) \ - \ -FFTW_DEFINE_COMPLEX(R, C); \ - \ -typedef struct X(plan_s) *X(plan); \ - \ -typedef struct fftw_iodim_do_not_use_me X(iodim); \ -typedef struct fftw_iodim64_do_not_use_me X(iodim64); \ - \ -typedef enum fftw_r2r_kind_do_not_use_me X(r2r_kind); \ - \ -typedef fftw_write_char_func_do_not_use_me X(write_char_func); \ -typedef fftw_read_char_func_do_not_use_me X(read_char_func); \ - \ -FFTW_EXTERN void X(execute)(const X(plan) p); \ - \ -FFTW_EXTERN X(plan) X(plan_dft)(int rank, const int *n, \ - C *in, C *out, int sign, unsigned flags); \ - \ -FFTW_EXTERN X(plan) X(plan_dft_1d)(int n, C *in, C *out, int sign, \ - unsigned flags); \ -FFTW_EXTERN X(plan) X(plan_dft_2d)(int n0, int n1, \ - C *in, C *out, int sign, unsigned flags); \ -FFTW_EXTERN X(plan) X(plan_dft_3d)(int n0, int n1, int n2, \ - C *in, C *out, int sign, unsigned flags); \ - \ -FFTW_EXTERN X(plan) X(plan_many_dft)(int rank, const int *n, \ - int howmany, \ - C *in, const int *inembed, \ - int istride, int idist, \ - C *out, const int *onembed, \ - int ostride, int odist, \ - int sign, unsigned flags); \ - \ -FFTW_EXTERN X(plan) X(plan_guru_dft)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - C *in, C *out, \ - int sign, unsigned flags); \ -FFTW_EXTERN X(plan) X(plan_guru_split_dft)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - R *ri, R *ii, R *ro, R *io, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) X(plan_guru64_dft)(int rank, \ - const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - C *in, C *out, \ - int sign, unsigned flags); \ -FFTW_EXTERN X(plan) X(plan_guru64_split_dft)(int rank, \ - const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - R *ri, R *ii, R *ro, R *io, \ - unsigned flags); \ - \ -FFTW_EXTERN void X(execute_dft)(const X(plan) p, C *in, C *out); \ -FFTW_EXTERN void X(execute_split_dft)(const X(plan) p, R *ri, R *ii, \ - R *ro, R *io); \ - \ -FFTW_EXTERN X(plan) X(plan_many_dft_r2c)(int rank, const int *n, \ - int howmany, \ - R *in, const int *inembed, \ - int istride, int idist, \ - C *out, const int *onembed, \ - int ostride, int odist, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) X(plan_dft_r2c)(int rank, const int *n, \ - R *in, C *out, unsigned flags); \ - \ -FFTW_EXTERN X(plan) X(plan_dft_r2c_1d)(int n,R *in,C *out,unsigned flags); \ -FFTW_EXTERN X(plan) X(plan_dft_r2c_2d)(int n0, int n1, \ - R *in, C *out, unsigned flags); \ -FFTW_EXTERN X(plan) X(plan_dft_r2c_3d)(int n0, int n1, \ - int n2, \ - R *in, C *out, unsigned flags); \ - \ - \ -FFTW_EXTERN X(plan) X(plan_many_dft_c2r)(int rank, const int *n, \ - int howmany, \ - C *in, const int *inembed, \ - int istride, int idist, \ - R *out, const int *onembed, \ - int ostride, int odist, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) X(plan_dft_c2r)(int rank, const int *n, \ - C *in, R *out, unsigned flags); \ - \ -FFTW_EXTERN X(plan) X(plan_dft_c2r_1d)(int n,C *in,R *out,unsigned flags); \ -FFTW_EXTERN X(plan) X(plan_dft_c2r_2d)(int n0, int n1, \ - C *in, R *out, unsigned flags); \ -FFTW_EXTERN X(plan) X(plan_dft_c2r_3d)(int n0, int n1, \ - int n2, \ - C *in, R *out, unsigned flags); \ - \ -FFTW_EXTERN X(plan) X(plan_guru_dft_r2c)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - R *in, C *out, \ - unsigned flags); \ -FFTW_EXTERN X(plan) X(plan_guru_dft_c2r)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - C *in, R *out, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) X(plan_guru_split_dft_r2c)( \ - int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - R *in, R *ro, R *io, \ - unsigned flags); \ -FFTW_EXTERN X(plan) X(plan_guru_split_dft_c2r)( \ - int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - R *ri, R *ii, R *out, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) X(plan_guru64_dft_r2c)(int rank, \ - const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - R *in, C *out, \ - unsigned flags); \ -FFTW_EXTERN X(plan) X(plan_guru64_dft_c2r)(int rank, \ - const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - C *in, R *out, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) X(plan_guru64_split_dft_r2c)( \ - int rank, const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - R *in, R *ro, R *io, \ - unsigned flags); \ -FFTW_EXTERN X(plan) X(plan_guru64_split_dft_c2r)( \ - int rank, const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - R *ri, R *ii, R *out, \ - unsigned flags); \ - \ -FFTW_EXTERN void X(execute_dft_r2c)(const X(plan) p, R *in, C *out); \ -FFTW_EXTERN void X(execute_dft_c2r)(const X(plan) p, C *in, R *out); \ - \ -FFTW_EXTERN void X(execute_split_dft_r2c)(const X(plan) p, \ - R *in, R *ro, R *io); \ -FFTW_EXTERN void X(execute_split_dft_c2r)(const X(plan) p, \ - R *ri, R *ii, R *out); \ - \ -FFTW_EXTERN X(plan) X(plan_many_r2r)(int rank, const int *n, \ - int howmany, \ - R *in, const int *inembed, \ - int istride, int idist, \ - R *out, const int *onembed, \ - int ostride, int odist, \ - const X(r2r_kind) *kind, unsigned flags); \ - \ -FFTW_EXTERN X(plan) X(plan_r2r)(int rank, const int *n, R *in, R *out, \ - const X(r2r_kind) *kind, unsigned flags); \ - \ -FFTW_EXTERN X(plan) X(plan_r2r_1d)(int n, R *in, R *out, \ - X(r2r_kind) kind, unsigned flags); \ -FFTW_EXTERN X(plan) X(plan_r2r_2d)(int n0, int n1, R *in, R *out, \ - X(r2r_kind) kind0, X(r2r_kind) kind1, \ - unsigned flags); \ -FFTW_EXTERN X(plan) X(plan_r2r_3d)(int n0, int n1, int n2, \ - R *in, R *out, X(r2r_kind) kind0, \ - X(r2r_kind) kind1, X(r2r_kind) kind2, \ - unsigned flags); \ - \ -FFTW_EXTERN X(plan) X(plan_guru_r2r)(int rank, const X(iodim) *dims, \ - int howmany_rank, \ - const X(iodim) *howmany_dims, \ - R *in, R *out, \ - const X(r2r_kind) *kind, unsigned flags); \ - \ -FFTW_EXTERN X(plan) X(plan_guru64_r2r)(int rank, const X(iodim64) *dims, \ - int howmany_rank, \ - const X(iodim64) *howmany_dims, \ - R *in, R *out, \ - const X(r2r_kind) *kind, unsigned flags); \ - \ -FFTW_EXTERN void X(execute_r2r)(const X(plan) p, R *in, R *out); \ - \ -FFTW_EXTERN void X(destroy_plan)(X(plan) p); \ -FFTW_EXTERN void X(forget_wisdom)(void); \ -FFTW_EXTERN void X(cleanup)(void); \ - \ -FFTW_EXTERN void X(set_timelimit)(double t); \ - \ -FFTW_EXTERN void X(plan_with_nthreads)(int nthreads); \ -FFTW_EXTERN int X(init_threads)(void); \ -FFTW_EXTERN void X(cleanup_threads)(void); \ - \ -FFTW_EXTERN int X(export_wisdom_to_filename)(const char *filename); \ -FFTW_EXTERN void X(export_wisdom_to_file)(FILE *output_file); \ -FFTW_EXTERN char *X(export_wisdom_to_string)(void); \ -FFTW_EXTERN void X(export_wisdom)(X(write_char_func) write_char, \ - void *data); \ -FFTW_EXTERN int X(import_system_wisdom)(void); \ -FFTW_EXTERN int X(import_wisdom_from_filename)(const char *filename); \ -FFTW_EXTERN int X(import_wisdom_from_file)(FILE *input_file); \ -FFTW_EXTERN int X(import_wisdom_from_string)(const char *input_string); \ -FFTW_EXTERN int X(import_wisdom)(X(read_char_func) read_char, void *data); \ - \ -FFTW_EXTERN void X(fprint_plan)(const X(plan) p, FILE *output_file); \ -FFTW_EXTERN void X(print_plan)(const X(plan) p); \ -FFTW_EXTERN char *X(sprint_plan)(const X(plan) p); \ - \ -FFTW_EXTERN void *X(malloc)(size_t n); \ -FFTW_EXTERN R *X(alloc_real)(size_t n); \ -FFTW_EXTERN C *X(alloc_complex)(size_t n); \ -FFTW_EXTERN void X(free)(void *p); \ - \ -FFTW_EXTERN void X(flops)(const X(plan) p, \ - double *add, double *mul, double *fmas); \ -FFTW_EXTERN double X(estimate_cost)(const X(plan) p); \ -FFTW_EXTERN double X(cost)(const X(plan) p); \ - \ -FFTW_EXTERN int X(alignment_of)(R *p); \ -FFTW_EXTERN const char X(version)[]; \ -FFTW_EXTERN const char X(cc)[]; \ -FFTW_EXTERN const char X(codelet_optim)[]; - - -/* end of FFTW_DEFINE_API macro */ - -FFTW_DEFINE_API(FFTW_MANGLE_DOUBLE, double, fftw_complex) -FFTW_DEFINE_API(FFTW_MANGLE_FLOAT, float, fftwf_complex) -FFTW_DEFINE_API(FFTW_MANGLE_LONG_DOUBLE, long double, fftwl_complex) - -/* __float128 (quad precision) is a gcc extension on i386, x86_64, and ia64 - for gcc >= 4.6 (compiled in FFTW with --enable-quad-precision) */ -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) \ - && !(defined(__ICC) || defined(__INTEL_COMPILER)) \ - && (defined(__i386__) || defined(__x86_64__) || defined(__ia64__)) -# if !defined(FFTW_NO_Complex) && defined(_Complex_I) && defined(complex) && defined(I) -/* note: __float128 is a typedef, which is not supported with the _Complex - keyword in gcc, so instead we use this ugly __attribute__ version. - However, we can't simply pass the __attribute__ version to - FFTW_DEFINE_API because the __attribute__ confuses gcc in pointer - types. Hence redefining FFTW_DEFINE_COMPLEX. Ugh. */ -# undef FFTW_DEFINE_COMPLEX -# define FFTW_DEFINE_COMPLEX(R, C) typedef _Complex float __attribute__((mode(TC))) C -# endif -FFTW_DEFINE_API(FFTW_MANGLE_QUAD, __float128, fftwq_complex) -#endif - -#define FFTW_FORWARD (-1) -#define FFTW_BACKWARD (+1) - -#define FFTW_NO_TIMELIMIT (-1.0) - -/* documented flags */ -#define FFTW_MEASURE (0U) -#define FFTW_DESTROY_INPUT (1U << 0) -#define FFTW_UNALIGNED (1U << 1) -#define FFTW_CONSERVE_MEMORY (1U << 2) -#define FFTW_EXHAUSTIVE (1U << 3) /* NO_EXHAUSTIVE is default */ -#define FFTW_PRESERVE_INPUT (1U << 4) /* cancels FFTW_DESTROY_INPUT */ -#define FFTW_PATIENT (1U << 5) /* IMPATIENT is default */ -#define FFTW_ESTIMATE (1U << 6) -#define FFTW_WISDOM_ONLY (1U << 21) - -/* undocumented beyond-guru flags */ -#define FFTW_ESTIMATE_PATIENT (1U << 7) -#define FFTW_BELIEVE_PCOST (1U << 8) -#define FFTW_NO_DFT_R2HC (1U << 9) -#define FFTW_NO_NONTHREADED (1U << 10) -#define FFTW_NO_BUFFERING (1U << 11) -#define FFTW_NO_INDIRECT_OP (1U << 12) -#define FFTW_ALLOW_LARGE_GENERIC (1U << 13) /* NO_LARGE_GENERIC is default */ -#define FFTW_NO_RANK_SPLITS (1U << 14) -#define FFTW_NO_VRANK_SPLITS (1U << 15) -#define FFTW_NO_VRECURSE (1U << 16) -#define FFTW_NO_SIMD (1U << 17) -#define FFTW_NO_SLOW (1U << 18) -#define FFTW_NO_FIXED_RADIX_LARGE_N (1U << 19) -#define FFTW_ALLOW_PRUNING (1U << 20) - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif /* FFTW3_H */ diff --git a/libs/windows/lib/x64/libfftw3-3.lib b/libs/windows/lib/x64/libfftw3-3.lib deleted file mode 100644 index 481c93d..0000000 Binary files a/libs/windows/lib/x64/libfftw3-3.lib and /dev/null differ diff --git a/libs/windows/lib/x86/libfftw3-3.lib b/libs/windows/lib/x86/libfftw3-3.lib deleted file mode 100644 index 54c02c1..0000000 Binary files a/libs/windows/lib/x86/libfftw3-3.lib and /dev/null differ diff --git a/tools/PrepareFFTWBundle.cmake b/tools/PrepareFFTWBundle.cmake new file mode 100644 index 0000000..19c7c43 --- /dev/null +++ b/tools/PrepareFFTWBundle.cmake @@ -0,0 +1,206 @@ +cmake_minimum_required(VERSION 3.19) + +if(NOT DEFINED PLATFORM OR NOT PLATFORM MATCHES "^(linux|macos|windows)$") + message(FATAL_ERROR "Set PLATFORM to linux, macos, or windows") +endif() +if(NOT DEFINED OUTPUT_DIR) + message(FATAL_ERROR "Set OUTPUT_DIR to the libs directory the bundle should be staged into") +endif() + +set(FFTW_VERSION 3.3.11) +file(MAKE_DIRECTORY "${OUTPUT_DIR}") +file(LOCK "${OUTPUT_DIR}/.prepare-${PLATFORM}.lock" + GUARD PROCESS TIMEOUT 300 RESULT_VARIABLE lock_result) +if(lock_result) + message(FATAL_ERROR "Could not lock the local FFTW stage: ${lock_result}") +endif() + +set(WORK_DIR "${OUTPUT_DIR}/.fftw-package-work-${PLATFORM}") +set(FINAL_BUNDLE_DIR "${OUTPUT_DIR}/${PLATFORM}") +set(BUNDLE_DIR "${OUTPUT_DIR}/.${PLATFORM}-staging") +file(SHA256 "${CMAKE_CURRENT_LIST_FILE}" prepare_sha256) +string(CONCAT expected_stage_marker + "FFTW ${FFTW_VERSION}\n" + "Prepare script SHA-256: ${prepare_sha256}\n") + +# Only the x86_64/universal binaries are fetched, so Windows stages under an +# arch subfolder to match the existing libs/windows/{lib,bin}/x64 layout. +set(LIB_SUBDIR "lib") +set(BIN_SUBDIR "bin") +if(PLATFORM STREQUAL "windows") + set(LIB_SUBDIR "lib/x64") + set(BIN_SUBDIR "bin/x64") +endif() + +set(required_files + "include/fftw3.h" + "share/fftw/COPYING" + "share/fftw/PROVENANCE.txt") +if(PLATFORM STREQUAL "linux") + list(APPEND required_files + "lib/libfftw3.so" "lib/libfftw3f.so" + "bin/libfftw3.so.3" "bin/libfftw3f.so.3") +elseif(PLATFORM STREQUAL "windows") + list(APPEND required_files + "lib/x64/fftw3.lib" "lib/x64/fftw3f.lib" + "bin/x64/fftw3.dll" "bin/x64/fftw3f.dll") +elseif(PLATFORM STREQUAL "macos") + list(APPEND required_files + "lib/libfftw3.dylib" "lib/libfftw3f.dylib" + "bin/libfftw3.3.dylib" "bin/libfftw3f.3.dylib") +endif() + +set(bundle_complete TRUE) +foreach(required_file IN LISTS required_files) + if(NOT EXISTS "${FINAL_BUNDLE_DIR}/${required_file}") + set(bundle_complete FALSE) + endif() +endforeach() +set(stage_marker "${FINAL_BUNDLE_DIR}/share/fftw/STAGE.txt") +if(EXISTS "${stage_marker}") + file(READ "${stage_marker}" actual_stage_marker) +else() + set(actual_stage_marker "") +endif() +if(NOT actual_stage_marker STREQUAL expected_stage_marker) + set(bundle_complete FALSE) +endif() +if(bundle_complete) + message(STATUS "Using staged FFTW ${FFTW_VERSION}: ${FINAL_BUNDLE_DIR}") + return() +endif() + +file(REMOVE_RECURSE "${WORK_DIR}" "${BUNDLE_DIR}") +file(MAKE_DIRECTORY "${WORK_DIR}" "${BUNDLE_DIR}/include" + "${BUNDLE_DIR}/${LIB_SUBDIR}" "${BUNDLE_DIR}/${BIN_SUBDIR}" + "${BUNDLE_DIR}/share/fftw") + +function(download_conda_package LABEL SUBDIR FILENAME SHA256 OUT_ROOT) + set(package "${WORK_DIR}/${FILENAME}") + set(container "${WORK_DIR}/${LABEL}-container") + set(root "${WORK_DIR}/${LABEL}-root") + + file(DOWNLOAD + "https://conda.anaconda.org/conda-forge/${SUBDIR}/${FILENAME}" + "${package}" + EXPECTED_HASH "SHA256=${SHA256}" + TLS_VERIFY ON + SHOW_PROGRESS) + file(MAKE_DIRECTORY "${container}" "${root}") + file(ARCHIVE_EXTRACT INPUT "${package}" DESTINATION "${container}") + file(GLOB payload "${container}/pkg-*.tar.zst") + file(GLOB package_info "${container}/info-*.tar.zst") + list(LENGTH payload payload_count) + list(LENGTH package_info info_count) + if(NOT payload_count EQUAL 1 OR NOT info_count EQUAL 1) + message(FATAL_ERROR "Unexpected ${LABEL} .conda package structure") + endif() + file(ARCHIVE_EXTRACT INPUT "${payload}" DESTINATION "${root}") + file(ARCHIVE_EXTRACT INPUT "${package_info}" DESTINATION "${root}") + set(${OUT_ROOT} "${root}" PARENT_SCOPE) +endfunction() + +function(copy_file SOURCE DESTINATION) + if(NOT EXISTS "${SOURCE}") + message(FATAL_ERROR "Required package file is missing: ${SOURCE}") + endif() + get_filename_component(destination_dir "${DESTINATION}" DIRECTORY) + file(MAKE_DIRECTORY "${destination_dir}") + configure_file("${SOURCE}" "${DESTINATION}" COPYONLY) +endfunction() + +if(PLATFORM STREQUAL "linux") + download_conda_package( + linux linux-64 fftw-3.3.11-nompi_h3b011a4_100.conda + 6fd5d681fba20adaca771f138ac52dbf0a52e0dc2ac31b9ce7406068d102a9a7 + package_root) + copy_file("${package_root}/include/fftw3.h" "${BUNDLE_DIR}/include/fftw3.h") + foreach(precision IN ITEMS "" f) + copy_file("${package_root}/lib/libfftw3${precision}.so.3.7.11" + "${BUNDLE_DIR}/${LIB_SUBDIR}/libfftw3${precision}.so") + copy_file("${package_root}/lib/libfftw3${precision}.so.3.7.11" + "${BUNDLE_DIR}/${BIN_SUBDIR}/libfftw3${precision}.so.3") + endforeach() + set(license_root "${package_root}") + string(CONCAT binary_provenance + "linux-64/fftw-3.3.11-nompi_h3b011a4_100.conda\n" + "SHA-256: 6fd5d681fba20adaca771f138ac52dbf0a52e0dc2ac31b9ce7406068d102a9a7\n") +elseif(PLATFORM STREQUAL "windows") + download_conda_package( + windows win-64 fftw-3.3.11-nompi_h6877c38_100.conda + bee7a80261a6344597125ecf4af4405d841c81b46461e3327f7fe6a148652426 + package_root) + copy_file("${package_root}/Library/include/fftw3.h" "${BUNDLE_DIR}/include/fftw3.h") + foreach(precision IN ITEMS "" f) + copy_file("${package_root}/Library/lib/fftw3${precision}.lib" + "${BUNDLE_DIR}/${LIB_SUBDIR}/fftw3${precision}.lib") + copy_file("${package_root}/Library/bin/fftw3${precision}.dll" + "${BUNDLE_DIR}/${BIN_SUBDIR}/fftw3${precision}.dll") + endforeach() + set(license_root "${package_root}") + string(CONCAT binary_provenance + "win-64/fftw-3.3.11-nompi_h6877c38_100.conda\n" + "SHA-256: bee7a80261a6344597125ecf4af4405d841c81b46461e3327f7fe6a148652426\n") +elseif(PLATFORM STREQUAL "macos") + download_conda_package( + macos_arm osx-arm64 fftw-3.3.11-nompi_haf1500d_100.conda + fc6c507d7c68db156d6c8c5f6a79ca6b34c2a4c0c6222d8d4ecd0e4b97d3fd5e + arm_root) + download_conda_package( + macos_x64 osx-64 fftw-3.3.11-nompi_h54214ab_100.conda + c234b8f1be5b630236675a006172edd768ca2685fbf0713ec007f3d373f5ee27 + x64_root) + copy_file("${arm_root}/include/fftw3.h" "${BUNDLE_DIR}/include/fftw3.h") + foreach(precision IN ITEMS "" f) + set(runtime_name "libfftw3${precision}.3.dylib") + execute_process( + COMMAND lipo -create + "${arm_root}/lib/${runtime_name}" + "${x64_root}/lib/${runtime_name}" + -output "${BUNDLE_DIR}/${BIN_SUBDIR}/${runtime_name}" + COMMAND_ERROR_IS_FATAL ANY) + execute_process( + COMMAND install_name_tool -id "@rpath/${runtime_name}" + "${BUNDLE_DIR}/${BIN_SUBDIR}/${runtime_name}" + COMMAND_ERROR_IS_FATAL ANY) + copy_file("${BUNDLE_DIR}/${BIN_SUBDIR}/${runtime_name}" + "${BUNDLE_DIR}/${LIB_SUBDIR}/libfftw3${precision}.dylib") + endforeach() + set(license_root "${arm_root}") + string(CONCAT binary_provenance + "osx-arm64/fftw-3.3.11-nompi_haf1500d_100.conda\n" + "SHA-256: fc6c507d7c68db156d6c8c5f6a79ca6b34c2a4c0c6222d8d4ecd0e4b97d3fd5e\n" + "osx-64/fftw-3.3.11-nompi_h54214ab_100.conda\n" + "SHA-256: c234b8f1be5b630236675a006172edd768ca2685fbf0713ec007f3d373f5ee27\n" + "The two architecture slices were combined with Apple's lipo tool.\n") +endif() + +copy_file("${license_root}/info/licenses/COPYING" + "${BUNDLE_DIR}/share/fftw/COPYING") +if(PLATFORM STREQUAL "macos") + file(COPY "${arm_root}/info/recipe" DESTINATION "${BUNDLE_DIR}/share/fftw") + file(RENAME "${BUNDLE_DIR}/share/fftw/recipe" + "${BUNDLE_DIR}/share/fftw/conda-recipe-osx-arm64") + file(COPY "${x64_root}/info/recipe" DESTINATION "${BUNDLE_DIR}/share/fftw") + file(RENAME "${BUNDLE_DIR}/share/fftw/recipe" + "${BUNDLE_DIR}/share/fftw/conda-recipe-osx-64") +else() + file(COPY "${package_root}/info/recipe" DESTINATION "${BUNDLE_DIR}/share/fftw") + file(RENAME "${BUNDLE_DIR}/share/fftw/recipe" + "${BUNDLE_DIR}/share/fftw/conda-recipe") +endif() + +file(WRITE "${BUNDLE_DIR}/share/fftw/PROVENANCE.txt" + "FFTW ${FFTW_VERSION}\n" + "Source: https://www.fftw.org/fftw-${FFTW_VERSION}.tar.gz\n" + "Source SHA-256: 5630c24cdeb33b131612f7eb4b1a9934234754f9f388ff8617458d0be6f239a1\n" + "Binary source: https://conda.anaconda.org/conda-forge/\n" + "${binary_provenance}" + "The exact conda build recipe and its BSD-3-Clause license are included in this directory.\n" + "Neither conda-forge nor its contributors endorse this redistribution.\n") + +file(WRITE "${BUNDLE_DIR}/share/fftw/STAGE.txt" "${expected_stage_marker}") +file(REMOVE_RECURSE "${FINAL_BUNDLE_DIR}") +file(RENAME "${BUNDLE_DIR}" "${FINAL_BUNDLE_DIR}") +file(REMOVE_RECURSE "${WORK_DIR}") +message(STATUS "Staged FFTW ${FFTW_VERSION} (${PLATFORM}) into ${FINAL_BUNDLE_DIR}")