The C++ library clij2fft implements several FFT-based algorithms built on top of clFFT. This library is independent of Java.
Note: For Java, native libraries are now included in the JAR, so there is no need to manually copy them to an update site or Fiji installation.
- No local native builds are required or recommended.
- If you modify the native code, push your changes to GitHub with the commit message containing
[build natives]. - GitHub Actions will build the native libraries for all platforms and commit the updated libraries back to the repo.
- Pull the latest changes to get the updated native libraries.
If you modified the native, code, build the new natives following the new workflow. Then run the following Maven command to build the jar:
mvn clean package "-Dgpg.skip=true" "-Djavacpp.skip=true"Once the Java plugin is built, copy the JAR (./target/clij2-fft-{version}.jar) to your Fiji installation (Fiji.app/plugins/).
To create a release:
- Ensure all native libraries are up-to-date (built via GitHub Actions).
- Use the
release-version.shscript from scijava-scripts with the following arguments to skip native builds and GPG signing:./release-version.sh -Darguments="-Dgpg.skip=true -Djavacpp.skip=true"
- Search the Image.sc Forum for more information.
- Ask questions on the forum if previous discussions are unclear.
Building Native Libraries Locally - Legacy (Click to expand)
## Building Native Libraries - LegacyIf you still need to build natives locally (e.g., for testing or development), follow the instructions below.
- Visual Studio Community C++ Compiler
- Git for Windows with Bash Terminal
- Open CL-Headers and Library
(copy the
CLdirectory to c:/OpenCL/include) - Open CL Libary (OpenCL.lib)
Option 1: If Cuda installed copy from
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vxx.x\lib\x64Option 2: build from source
- From the Start menu, run 'x64 Native Tools Command Prompt for VS'.
- From the Command Prompt, start a bash shell:
"C:\Program Files\Git\bin\sh.exe". - Run
./native/cppbuild.sh. - If step 3 fails, check
./native/clij2fft/cppbuild.shand verify that OpenCL and clFFT are installed in the correct locations. - The updated library (
clij2fft.dll) and dependencies will be in the./lib/windows-x86_64/directory.
- From a bash terminal, run
./native/cppbuild.sh. - If step 1 fails, check
./native/clij2fft/cppbuild.shand verify that OpenCL and clFFT are installed in the correct locations. - The updated library (
clij2fft.so) and dependencies will be in the./lib/linux-x86_64/directory.
clFFTneeds to be built from sourcebrew install cmake || true git clone https://github.com/clMathLibraries/clFFT.git cd clFFT/src sed -i.bak 's/cmake_minimum_required( VERSION 3.1 )/cmake_minimum_required( VERSION 3.6 )/' CMakeLists.txt mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=${{ matrix.lib_prefix }} make -j$(sysctl -n hw.ncpu) && sudo make install
- From a bash terminal, run
./native/cppbuild.sh. - If step 1 fails, check
./native/clij2fft/cppbuild.shand verify that OpenCL and clFFT are installed in the correct locations. - For macOS, the native library
libclij2fftneeds to be modified withinstall_name_toolto findclFFTin its current directory:install_name_tool -change libclFFT.2.dylib @rpath/libclFFT.2.dylib ../../../lib/macosx-arm64/libclij2fft.dylib
- If targeting both Intel and Apple Silicon, you can build a universal binary using
lipo:lipo -create -output lib/macosx-universal2/libclFFT.dylib lib/macosx-x86_64/libclFFT.dylib lib/macosx-arm64/libclFFT.dylib
- The updated library (
clij2fft.dylib) and dependencies will be in the./lib/macosx-x86_64/or./lib/macosx-arm64/directory.