Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/clij/clij2-fft
Browse files Browse the repository at this point in the history
  • Loading branch information
bnorthan committed Feb 16, 2024
2 parents 01c695a + f3be702 commit be13d33
Show file tree
Hide file tree
Showing 17 changed files with 348 additions and 438 deletions.
22 changes: 16 additions & 6 deletions docs/buildlibs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,32 @@ The c++ library 'clij2fft' implements several FFT based algorithms built on top
#### Linux/MacOSX Build Instructions

2. From a bash terminal run [native/cppbuild.sh](https://github.com/clij/clij2-fft/blob/master/native/cppbuild.sh)
3. If step 1 fails check [native/clij2fft/cppbuild.sh](https://github.com/clij/clij2-fft/blob/master/native/clij2fft/cppbuild.sh#L26) and verify that OpenCL and clFFT are installed in the correct locations.
3. If step 1 fails check [native/clij2fft/cppbuild.sh](https://github.com/clij/clij2-fft/blob/master/native/clij2fft/cppbuild.sh#L28) and verify that OpenCL and clFFT are installed in the correct locations.
4. The updated library (clij2fft.so) and dependencies should now be in the ```clij2-fft/lib/linux64/``` directory.

### MacOSX and Mac Silicon Native M1

Some users have successfully built the code in a Mac environment.
You will need to install `clFFT` from [here](https://formulae.brew.sh/formula/clfft) using [homebrew](https://brew.sh/).
Note that the `macosx-universal2` binaries were generated using `lipo` (e.g. `lipo -create -output lib/macosx-universal2/libclFFT.dylib lib/macosx/libclFFT.dylib lib/macosx-arm64/libclFFT.dylib`).
Currently we recommend searching the [ImageSC Forum](https://forum.image.sc/search?q=apple%20M1%20clij%20deconvolution) for more information. Please ask questions on the forum if previous discussions are unclear.
You will need to install `clFFT` from [here](https://formulae.brew.sh/formula/clfft) using [homebrew](https://brew.sh/).

We have also found that on macosx the native library libclij2fft needs to be modified with ```install_name_tool``` in order for it to be found by libclij2fft.dylib in it’s current directory (ie when both are in /mambaforge/envs/current_environment/lib)
To build on macosx or mac m1/m2 (arm64) perform the following

2. From a bash terminal run [native/cppbuild.sh](https://github.com/clij/clij2-fft/blob/master/native/cppbuild.sh)
3. If step 1 fails check [native/clij2fft/cppbuild.sh](https://github.com/clij/clij2-fft/blob/master/native/clij2fft/cppbuild.sh#L56) and verify that OpenCL and clFFT are installed in the correct locations.

The macosx the native library libclij2fft needs to be modified with ```install_name_tool``` in order for it to be found by libclij2fft.dylib in it’s current directory (ie when both are in /mambaforge/envs/current_environment/lib)

```
install_name_tool -change libclFFT.2.dylib @rpath/libclFFT.2.dylib ../../../lib/macosx-arm64/libclij2fft.dylib
```

If targeting both macosx and macosx-arm64 we need to build a universal binary using 'lipo'

```
lipo -create -output lib/macosx-universal2/libclFFT.dylib lib/macosx/libclFFT.dylib lib/macosx-arm64/libclFFT.dylib`
```

We recommend searching the [ImageSC Forum](https://forum.image.sc/search?q=apple%20M1%20clij%20deconvolution) for more information. Please ask questions on the forum if previous discussions are unclear.

## Build Java Wrapper and Plugin

1. A 64 bit c++ compiler is needed to create the wrapper. In windows from Start menu run ‘x64 Native Tools Command Prompt for VS 2019'. In Linux/MacOsx make sure a 64 bit c++ compiler (ie gcc) is installed.
Expand Down
155 changes: 0 additions & 155 deletions python/Test_Installation.ipynb

This file was deleted.

36 changes: 0 additions & 36 deletions python/Test_Installation.py

This file was deleted.

3 changes: 2 additions & 1 deletion python/clij2fft/pad.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def pad(img, paddedsize, mode, constant_values=0):
mode ([type]): one of the np.pad modes
Returns:
[nd array]: padded image
padded [nd array]: padded image
padding [tuple]: tuple containing the padding used
"""
padding = tuple(map(lambda i,j: ( math.ceil((i-j)/2), math.floor((i-j)/2) ),paddedsize,img.shape))

Expand Down
49 changes: 0 additions & 49 deletions python/clij2fft/test_richardson_lucy.py

This file was deleted.

107 changes: 0 additions & 107 deletions python/clij2fft/test_richardson_lucy_nc.py

This file was deleted.

53 changes: 0 additions & 53 deletions python/clij2fft/test_sphere.py

This file was deleted.

5 changes: 3 additions & 2 deletions python/copylibsconda.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
# installs in editable mode, copying the native libraries to the location they are needed
# NOTE this script needs to be customized for your system and environment name
# this script is used when installing in editable mode, it copies the native libraries to the
# location they are needed NOTE this script needs to be customized for your system and environment
# name

KERNEL=(`uname -s | tr [A-Z] [a-z]`)
ARCH=(`uname -m | tr [A-Z] [a-z]`)
Expand Down
Loading

0 comments on commit be13d33

Please sign in to comment.