Open bogovicj opened 2 years ago
@avweigel said today that this may still be an issue.
Based on this output,
$ brew install c-blosc
$ brew list -v c-blosc
/opt/homebrew/Cellar/c-blosc/1.21.1/INSTALL_RECEIPT.json
/opt/homebrew/Cellar/c-blosc/1.21.1/.brew/c-blosc.rb
/opt/homebrew/Cellar/c-blosc/1.21.1/include/blosc-export.h
/opt/homebrew/Cellar/c-blosc/1.21.1/include/blosc.h
/opt/homebrew/Cellar/c-blosc/1.21.1/README.md
/opt/homebrew/Cellar/c-blosc/1.21.1/lib/libblosc.1.dylib
/opt/homebrew/Cellar/c-blosc/1.21.1/lib/pkgconfig/blosc.pc
/opt/homebrew/Cellar/c-blosc/1.21.1/lib/libblosc.dylib
/opt/homebrew/Cellar/c-blosc/1.21.1/lib/libblosc.1.21.1.dylib
/opt/homebrew/Cellar/c-blosc/1.21.1/lib/libblosc.a
We should add java -Djna.library.path="/opt/homebrew/Cellar/c-blosc/1.21.1/lib"
to the scripts.
Another issue here is that JNA needs to be updated to version 5 since JNA needs to load a JNI library.
See https://github.com/scijava/pom-scijava/issues/201 https://github.com/scijava/pom-scijava/issues/163
Adding <jna.version>5.11.0</jna.version>
to <properties>
helped.
% git diff
diff --git a/pom.xml b/pom.xml
index 00f38e4..f2dc8c6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -115,6 +115,7 @@
<jacoco-maven-plugin.version>0.8.6</jacoco-maven-plugin.version>
<cisd.jhdf5.version>19.04.0</cisd.jhdf5.version>
+ <jna.version>5.11.0</jna.version>
<n5.version>2.4.0</n5.version>
<n5-imglib2.version>3.5.1</n5-imglib2.version>
<n5-hdf5.version>1.4.2-SNAPSHOT</n5-hdf5.version>
Once we update jna.version
to 5.11.0
but without setting jna.library.path
we get the following error. Note the difference in the library it is trying to load. The error stack above is complaining about the inability to the find the JNI bindings for JNA. The error stack below is complaining about not being able to locate libblosc
.
% ./n5-view -i ~/Documents/t1.n5 -d data
Compression 'org.janelia.saalfeldlab.n5.blosc.BloscCompression' could not be registered because:
java.lang.UnsatisfiedLinkError: Unable to load library 'blosc':
dlopen(libblosc.dylib, 0x0009): tried: '/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/./libblosc.dylib' (no such file), 'libblosc.dylib' (no such file), '/usr/lib/libblosc.dylib' (no such file), '/Users/kittisopikulm/Documents/src/n5-utils/libblosc.dylib' (no such file)
dlopen(libblosc.dylib, 0x0009): tried: '/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/./libblosc.dylib' (no such file), 'libblosc.dylib' (no such file), '/usr/lib/libblosc.dylib' (no such file), '/Users/kittisopikulm/Documents/src/n5-utils/libblosc.dylib' (no such file)
dlopen(/Users/kittisopikulm/Library/Frameworks/blosc.framework/blosc, 0x0009): tried: '/Users/kittisopikulm/Library/Frameworks/blosc.framework/blosc' (no such file), '/System/Library/Frameworks/blosc.framework/blosc' (no such file)
dlopen(/Library/Frameworks/blosc.framework/blosc, 0x0009): tried: '/Library/Frameworks/blosc.framework/blosc' (no such file), '/System/Library/Frameworks/blosc.framework/blosc' (no such file)
dlopen(/System/Library/Frameworks/blosc.framework/blosc, 0x0009): tried: '/System/Library/Frameworks/blosc.framework/blosc' (no such file)
Upon doing so, the image opens properly.
% ./n5-view -i ~/Documents/t1.n5 -d data
N5FSReader[basePath=/Users/kittisopikulm/Documents/t1.n5] : data, [1.0, 1.0, 1.0], [0.0, 255.0], [0.0, 0.0, 0.0], Num axes: 3
axes permutation: [0, 1, 2] -> [0, 1, 2]
data 3d-affine: (1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)
./n5-view: line 11: -XX:+UseConcMarkSweepGC: command not found
There is an extra -XX:+UseConcMarkSweepGC
line at the end in this case. That is created when I try to install over an existing install.
@avweigel observed this issue was fixed after adding an appropriate jna.library.path to the run scripts
We may need to add this to the install script for new macos versions.
see also https://github.com/glencoesoftware/bioformats2raw/issues/101#issuecomment-879797175