Skip to content
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
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
22 changes: 16 additions & 6 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,55 @@ 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
if: github.ref == 'refs/heads/main'
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
build_dir: "Build"
repo: ${{ github.event.repository.name }}
package: OpenEphysFFTW-linux
run: |
plugin_api=$(grep -rnw ../../plugin-GUI/Source -e '#define PLUGIN_API_VER' | grep -Eo "[0-9]*" | tail -1)
tag=$(git describe --tags $(git rev-list --tags --max-count=1))
tag="$GITHUB_REF_NAME"
new_plugin_ver=$tag-API$plugin_api
mkdir shared
cp -r $build_dir/*.so shared
cp -r libs/linux/bin/* shared
mkdir -p shared/notices/fftw
cp -v libs/linux/share/fftw/{COPYING,COPYRIGHT,CONDA-FORGE-LICENSE.txt,PROVENANCE.txt} shared/notices/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"
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"
28 changes: 20 additions & 8 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 All @@ -34,7 +42,7 @@ jobs:
# - name: test
# run: cd build && ctest
- name: deploy
if: github.ref == 'refs/heads/main'
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
MACOS_CERTIFICATE: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
Expand All @@ -48,15 +56,17 @@ jobs:
package: OpenEphysFFTW-mac
run: |
plugin_api=$(grep -rnw ../../plugin-GUI/Source -e '#define PLUGIN_API_VER' | grep -Eo "[0-9]*" | tail -1)
tag=$(git describe --tags $(git rev-list --tags --max-count=1))
tag="$GITHUB_REF_NAME"
new_plugin_ver=$tag-API$plugin_api

mkdir shared
cp -r $build_dir/*.dylib shared
cp -r libs/macos/bin/* shared
mkdir -p shared/notices/fftw
cp -v libs/macos/share/fftw/{COPYING,COPYRIGHT,CONDA-FORGE-LICENSE.txt,PROVENANCE.txt} shared/notices/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"
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"
31 changes: 21 additions & 10 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 @@ -45,22 +54,24 @@ jobs:
# - name: test
# run: cd build && ctest
- name: deploy
if: github.ref == 'refs/heads/main'
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
build_dir: "Build/Release"
package: OpenEphysFFTW-windows
run: |
plugin_api=$(grep -rnw ../../plugin-GUI/Source -e '#define PLUGIN_API_VER' | grep -Eo "[0-9]*" | tail -1)
tag=$(git describe --tags $(git rev-list --tags --max-count=1))
tag="$GITHUB_REF_NAME"
new_plugin_ver=$tag-API$plugin_api
mkdir shared
cp -v $build_dir/*.dll shared
if [ -d "libs" ]
then
cp -v libs/windows/bin/x64/*.dll shared
fi
mkdir -p shared/notices/fftw
cp -v libs/windows/share/fftw/{COPYING,COPYRIGHT,CONDA-FORGE-LICENSE.txt,PROVENANCE.txt} shared/notices/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
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/

76 changes: 64 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,54 @@ 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)
set(FFTW_NOTICE_FILES
"${FFTW_DEPENDENCY_ROOT}/share/fftw/COPYING"
"${FFTW_DEPENDENCY_ROOT}/share/fftw/COPYRIGHT"
"${FFTW_DEPENDENCY_ROOT}/share/fftw/CONDA-FORGE-LICENSE.txt"
"${FFTW_DEPENDENCY_ROOT}/share/fftw/PROVENANCE.txt")
install(FILES ${FFTW_NOTICE_FILES} DESTINATION ${GUI_COMMONLIB_DIR}/share/fftw)

#Libraries and compiler options
if(MSVC)
target_link_libraries(${COMMONLIB_NAME} ${GUI_BIN_DIR}/open-ephys.lib)
target_compile_options(${COMMONLIB_NAME} PRIVATE /sdl- /W0)

install(TARGETS ${COMMONLIB_NAME} RUNTIME DESTINATION ${GUI_BIN_DIR}/shared)

list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/libs/windows)
set(FFTW_RUNTIME_INSTALL_DIR "${GUI_BIN_DIR}/shared")

elseif(LINUX)
target_link_libraries(${COMMONLIB_NAME} GL X11 Xext Xinerama asound dl freetype pthread rt)
Expand All @@ -85,8 +118,7 @@ elseif(LINUX)
target_compile_options(${COMMONLIB_NAME} PRIVATE -O3) #enable optimization for linux debug

install(TARGETS ${COMMONLIB_NAME} LIBRARY DESTINATION ${GUI_BIN_DIR}/shared)

list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/libs/linux)
set(FFTW_RUNTIME_INSTALL_DIR "${GUI_BIN_DIR}/shared")

elseif(APPLE)
set_target_properties(${COMMONLIB_NAME} PROPERTIES BUNDLE FALSE)
Expand All @@ -97,7 +129,12 @@ 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)
set(FFTW_RUNTIME_INSTALL_DIR "$ENV{HOME}/Library/Application Support/open-ephys/shared-api10")
endif()

if(FFTW_RUNTIME_INSTALL_DIR)
install(FILES ${FFTW_NOTICE_FILES}
DESTINATION "${FFTW_RUNTIME_INSTALL_DIR}/notices/fftw")
endif()

#create filters for vs and xcode
Expand All @@ -111,27 +148,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})
Loading
Loading