clij / clij2-fft

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build issue on MacOS

haesleinhuepf opened this issue · comments

Hey Brian @bnorthan ,

I'm just trying to build it on MacOS and it somehow doesn't build the dylib file correctly. I hope you have an idea what goes wrong. After building, I copied over the two .so files and the .dylib from target/classes/net/...../macosx-x86-x64 to Fiji/lib/macosx. It obviously finds the files while executing the deconvolution, Fiji crashes with this error message:

dyld: lazy symbol binding failed: Symbol not found: _deconv3d_32f_lp
  Referenced from: /Applications/Fiji.app/lib/macosx/libjniclij2fftWrapper.dylib
  Expected in: flat namespace

dyld: Symbol not found: _deconv3d_32f_lp
  Referenced from: /Applications/Fiji.app/lib/macosx/libjniclij2fftWrapper.dylib
  Expected in: flat namespace

But I don't see why it is looking for a method called "_deconv3d_32f_lp" ... the method is in fact called "deconv3d_32f_lp".

Do you have an idea what goes wrong in my build?

Thanks!

Cheers,
Robert

P.S.: here comes the mvn package output:

/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/bin/java -Dmaven.multiModuleProjectDirectory=/Users/haase/code/clij2-fft "-Dmaven.home=/Applications/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3" "-Dclassworlds.conf=/Applications/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3/bin/m2.conf" "-Dmaven.ext.class.path=/Applications/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven-event-listener.jar" "-javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=50127:/Applications/IntelliJ IDEA CE.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3/boot/plexus-classworlds-2.6.0.jar" org.codehaus.classworlds.Launcher -Didea.version2019.3 package
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------< net.haesleinhuepf:clij2-fft_ >--------------------
[INFO] Building clij2-fft 2.1.3.0-BETA
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-rules) @ clij2-fft_ ---
[INFO] Skipping Rule Enforcement.
[INFO] 
[INFO] --- build-helper-maven-plugin:3.0.0:regex-property (sanitize-version) @ clij2-fft_ ---
[INFO] 
[INFO] --- build-helper-maven-plugin:3.0.0:regex-property (guess-package) @ clij2-fft_ ---
[INFO] 
[INFO] --- buildnumber-maven-plugin:1.4:create (default) @ clij2-fft_ ---
[INFO] Executing: /bin/sh -c cd '/Users/haase/code/clij2-fft' && 'git' 'rev-parse' '--verify' 'HEAD'
[INFO] Working directory: /Users/haase/code/clij2-fft
[INFO] Storing buildNumber: acbaa34bb18ff332a510dd618e8707bf4f0b6729 at timestamp: 1600016111625
[INFO] Storing buildScmBranch: master
[INFO] 
[INFO] --- scijava-maven-plugin:1.1.0:set-rootdir (set-rootdir) @ clij2-fft_ ---
[INFO] Setting rootdir: /Users/haase/code/clij2-fft
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.4:prepare-agent (jacoco-initialize) @ clij2-fft_ ---
[INFO] argLine set to -javaagent:/Users/haase/.m2/repository/org/jacoco/org.jacoco.agent/0.8.4/org.jacoco.agent-0.8.4-runtime.jar=destfile=/Users/haase/code/clij2-fft/target/jacoco.exec
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ clij2-fft_ ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] Copying 0 resource
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ clij2-fft_ ---
[INFO] Compiling 6 source files to /Users/haase/code/clij2-fft/target/classes
[INFO] /Users/haase/code/clij2-fft/src/main/java/net/haesleinhuepf/clijx/plugins/ImageUtility.java: Some input files use unchecked or unsafe operations.
[INFO] /Users/haase/code/clij2-fft/src/main/java/net/haesleinhuepf/clijx/plugins/ImageUtility.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- javacpp:1.3:build (process-classes) @ clij2-fft_ ---
[INFO] Detected platform "macosx-x86_64"
[INFO] Building for platform "macosx-x86_64"
[INFO] Generating /Users/haase/code/clij2-fft/target/classes/net/haesleinhuepf/clijx/plugins/jniclij2fftWrapper.cpp
[INFO] Compiling /Users/haase/code/clij2-fft/target/classes/net/haesleinhuepf/clijx/plugins/macosx-x86_64/libjniclij2fftWrapper.dylib
[INFO] clang++ -I/Users/haase/code/clij2-fft/src/main/java -I/Users/haase/code/clij2-fft/native/clij2fft/ -I/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/include/darwin /Users/haase/code/clij2-fft/target/classes/net/haesleinhuepf/clijx/plugins/jniclij2fftWrapper.cpp -march=x86-64 -m64 -O3 -Wl,-rpath,@loader_path/. -Wall -fPIC -dynamiclib -undefined dynamic_lookup -o libjniclij2fftWrapper.dylib -L/Users/haase/code/clij2-fft/lib/win64/ -Wl,-rpath,/Users/haase/code/clij2-fft/lib/win64/ -L/Users/haase/code/clij2-fft/lib/linux64/ -Wl,-rpath,/Users/haase/code/clij2-fft/lib/linux64/ -L/Users/haase/code/clij2-fft/lib/macosx/ -Wl,-rpath,/Users/haase/code/clij2-fft/lib/macosx/ -lclFFT -lclij2fft -framework JavaVM 
ld: warning: ignoring file /Users/haase/code/clij2-fft/lib/macosx//libclFFT.so, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 )
ld: warning: ignoring file /Users/haase/code/clij2-fft/lib/linux64//libclij2fft.so, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 )
[INFO] Deleting /Users/haase/code/clij2-fft/target/classes/net/haesleinhuepf/clijx/plugins/jniclij2fftWrapper.cpp
[INFO] Copying /Users/haase/code/clij2-fft/lib/linux64/libclij2fft.so
[INFO] Copying /Users/haase/code/clij2-fft/lib/macosx/libclFFT.so
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ clij2-fft_ ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/haase/code/clij2-fft/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ clij2-fft_ ---
[INFO] Compiling 2 source files to /Users/haase/code/clij2-fft/target/test-classes
[INFO] /Users/haase/code/clij2-fft/src/test/java/net/haesleinhuepf/clijx/tests/InteractiveDeconvolve.java: Some input files use unchecked or unsafe operations.
[INFO] /Users/haase/code/clij2-fft/src/test/java/net/haesleinhuepf/clijx/tests/InteractiveDeconvolve.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- maven-surefire-plugin:2.4.1:test (default-test) @ clij2-fft_ ---
[INFO] Surefire report directory: /Users/haase/code/clij2-fft/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-jar-plugin:3.1.2:jar (default-jar) @ clij2-fft_ ---
[INFO] Building jar: /Users/haase/code/clij2-fft/target/clij2-fft_-2.1.3.0-BETA.jar
[INFO] 
[INFO] >>> maven-source-plugin:3.1.0:jar (attach-sources-jar) > generate-sources @ clij2-fft_ >>>
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-rules) @ clij2-fft_ ---
[INFO] Skipping Rule Enforcement.
[INFO] 
[INFO] --- build-helper-maven-plugin:3.0.0:regex-property (sanitize-version) @ clij2-fft_ ---
[INFO] 
[INFO] --- build-helper-maven-plugin:3.0.0:regex-property (guess-package) @ clij2-fft_ ---
[INFO] 
[INFO] --- buildnumber-maven-plugin:1.4:create (default) @ clij2-fft_ ---
[INFO] 
[INFO] --- scijava-maven-plugin:1.1.0:set-rootdir (set-rootdir) @ clij2-fft_ ---
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.4:prepare-agent (jacoco-initialize) @ clij2-fft_ ---
[INFO] argLine set to -javaagent:/Users/haase/.m2/repository/org/jacoco/org.jacoco.agent/0.8.4/org.jacoco.agent-0.8.4-runtime.jar=destfile=/Users/haase/code/clij2-fft/target/jacoco.exec
[INFO] 
[INFO] <<< maven-source-plugin:3.1.0:jar (attach-sources-jar) < generate-sources @ clij2-fft_ <<<
[INFO] 
[INFO] 
[INFO] --- maven-source-plugin:3.1.0:jar (attach-sources-jar) @ clij2-fft_ ---
[INFO] Building jar: /Users/haase/code/clij2-fft/target/clij2-fft_-2.1.3.0-BETA-sources.jar
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.4:report (jacoco-site) @ clij2-fft_ ---
[INFO] Skipping JaCoCo execution due to missing execution data file.
[INFO] 
[INFO] --- maven-jar-plugin:3.1.2:test-jar (default) @ clij2-fft_ ---
[INFO] Building jar: /Users/haase/code/clij2-fft/target/clij2-fft_-2.1.3.0-BETA-tests.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  17.594 s
[INFO] Finished at: 2020-09-13T18:55:22+02:00
[INFO] ------------------------------------------------------------------------

Did you run this script

And if so what was the output??

The build is annoyingly complicated because there is a pure native part, a native wrapper part, and the pure java part.

It's.a pitty that I didn't take notes last time I compiled this thing here. So when I run the script you mentioned, it outputs:

haase@pcs-MacBook native % ./cppbuild.sh 
Detected platform "macosx-x86_64"
Building for platform "macosx-x86_64"
Installing "clij2fft"
~/code/clij2-fft/native/clij2fft/cppbuild ~/code/clij2-fft/native
TODO
~/code/clij2-fft/native

and it produces no files...

I guess I'll dig into the cmake files for a moment....

We need to fill in the MacOSX part of this script

It should call cmake with appropriate paths to generate build files, then call make and make install.

Then call this one again.

Let me know if this works. It should be just a matter of call cmake with the right paths.

I'm almost through, I just need to fix this:

haase@pcs-MacBook cppbuild % make
[ 50%] Linking CXX shared library libclij2fft.dylib
ld: warning: ignoring file /Users/haase/code/clij2-fft/lib/macosx/libclFFT.so, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 )

That does mean I have to build clfft myself, right?

Wondering how this worked earlier...

Solved it...

Thanks again Brian!