Skip to content
Open
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
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 15 additions & 5 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
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"
26 changes: 19 additions & 7 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand All @@ -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"
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"
29 changes: 20 additions & 9 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,42 @@ 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: |
cd Build
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
Expand All @@ -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
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@
!**/Build/CMakeLists.txt
!**/Build/CMAKE_README.txt

# 3. Libraries
libs/

64 changes: 52 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}/$<CONFIG>/lib/${CMAKE_LIBRARY_ARCHITECTURE} # .so, .dylib files
ARCHIVE DESTINATION ${GUI_COMMONLIB_DIR}/$<CONFIG>/lib/${CMAKE_LIBRARY_ARCHITECTURE} # .lib files
RUNTIME DESTINATION ${GUI_COMMONLIB_DIR}/$<CONFIG>/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)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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})
26 changes: 26 additions & 0 deletions DependencyTests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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=<extracted dependency bundle>")
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")
35 changes: 35 additions & 0 deletions DependencyTests/fftw_dependency_smoke.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <fftw3.h>

#include <math.h>
#include <stddef.h>

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;
}
Loading