Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blosc support on macOS? #101

Closed
perlman opened this issue Apr 27, 2021 · 5 comments
Closed

Blosc support on macOS? #101

perlman opened this issue Apr 27, 2021 · 5 comments

Comments

@perlman
Copy link
Contributor

perlman commented Apr 27, 2021

Hi,

I am unable to get the 0.3rc3 release to work with Blosc on my Mac.

I have c-blosc installed via homebrew (brew install c-blosc).

I had edited the final line in bioformats2raw-0.3.0-rc3/bin/bioformats2raw to add various forms of -Djna.library.path= without success, e.g. exec "$JAVACMD" -Djna.library.path=/usr/local/Cellar/c-blosc/1.21.0/lib/libblosc.dylib "$@".

Am I missing something obvious on how this should be run?

I always get the error java.lang.NoClassDefFoundError: Could not initialize class org.blosc.IBloscDll.

Thanks,
Eric

@tdmorello
Copy link

I am having the same problem with 0.3.0-rc4.

c-blosc: version 1.21.0
macos (big sur) 11.3.1

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.esotericsoftware.reflectasm.AccessClassLoader (file:/Users/tim/Desktop/bioformats2raw-0.3.0-rc4/lib/kryo-2.24.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.esotericsoftware.reflectasm.AccessClassLoader
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2021-05-12 18:58:53,104 [pool-1-thread-4] ERROR c.g.bioformats2raw.Converter - Failure processing tile; resolution=0 plane=0 xx=1024 yy=0 width=1024 height=1024
java.lang.NoClassDefFoundError: Could not initialize class org.blosc.IBloscDll
	at org.blosc.JBlosc.compressCtx(JBlosc.java:213) ~[jblosc-1.0.1.jar:na]
	at com.bc.zarr.CompressorFactory$BloscCompressor.compress(CompressorFactory.java:327) ~[jzarr-0.3.3-gs-SNAPSHOT.jar:na]
	at com.bc.zarr.chunk.ChunkReaderWriterImpl_Short.write(ChunkReaderWriterImpl_Short.java:83) ~[jzarr-0.3.3-gs-SNAPSHOT.jar:na]
	at com.bc.zarr.ZarrArray.write(ZarrArray.java:278) ~[jzarr-0.3.3-gs-SNAPSHOT.jar:na]
	at com.glencoesoftware.bioformats2raw.Converter.writeBytes(Converter.java:771) ~[bioformats2raw-0.3.0-rc4.jar:0.3.0-rc4]
	at com.glencoesoftware.bioformats2raw.Converter.processTile(Converter.java:975) ~[bioformats2raw-0.3.0-rc4.jar:0.3.0-rc4]
	at com.glencoesoftware.bioformats2raw.Converter.lambda$saveResolutions$4(Converter.java:1109) ~[bioformats2raw-0.3.0-rc4.jar:0.3.0-rc4]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[na:na]
	at java.base/java.lang.Thread.run(Thread.java:832) ~[na:na]

@tdmorello
Copy link

Does anyone have advice for fixing this?

@tdmorello
Copy link

I ended up installing this with Anaconda.

https://anaconda.org/ome/bioformats2raw

conda install -c ome bioformats2raw

@muhanadz
Copy link
Member

I managed to solve this issue, with the help of @erindiel and @chris-allan:
On MacOS, after brew install c-blosc, run export JAVA_OPTS='-Djna.library.path=/usr/local/Cellar/c-blosc/1.21.0/lib'.

For windows:set JAVA_OPTS="-Djna.library.path=C:\path\to\blosc\folder" which can be downloaded here. Just make sure to rename the file to .dll

@perlman used the path to libblosc.dylib and not the folder containing libblosc.dylib. One thing to note here is to make sure to add the path to the folder containing libblosc and not path to libblosc itself. I also added export JAVA_OPTS='-Djna.library.path=/usr/local/Cellar/c-blosc/1.21.0/lib' to my .zshrc

@chris-allan
Copy link
Member

@muhanadz: Can you take a stab at opening a PR against master updating the README?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants