This is an experimental repo to help install OpenSlide Java.
The primary motivator here is to get OpenSlide working nicely with QuPath on new Mac computers with Apple silicon. However Homebrew also works on Intel Macs and on Linux - and so gives a way to get QuPath working with the most up-to-date OpenSlide.
In the future, more library dependencies relevant to QuPath might be added to this tap.
First, you'll need to install Homebrew.
Then open a command prompt (generally /Applications/Utilities/Terminal.app on a Mac) and type
brew install petebankhead/qupath/openslide-java
That's it!
It might take a little while, but Homebrew should take care of the rest.
In the future, more formulae might be added. The general pattern is that, to install something, you'd type
brew install petebankhead/qupath/<formula>
Alternatively, you can type
brew tap petebankhead/qupath
and thenbrew install <formula>
.
After installing openslide-java
, you can find where it is by typing
brew --prefix openslide-java
The path you see will depend upon the type of computer you've got, and whether you changed the default settings. Most likely, you'll see:
/opt/homebrew/opt/openslide-java
on a Mac with Apple silicon/usr/local/opt/openslide-java
on an Intel Mac/home/linuxbrew/.linuxbrew/opt/openslide-java
on Linux
On Mac, you'll need to find the file libopenslide-jni.jnilib
(a couple of subdirectories down) and copy it to your QuPath installation.
This can be done from the command prompt, using something like this (fixing paths/versions if necessary):
cp /opt/homebrew/opt/openslide-java/lib/openslide-java/libopenslide-jni.jnilib /Applications/QuPath-0.4.0.app/Contents/app
The process for Linux is much the same, just with a different file name.
If you aren't comfortable copying files via a command prompt and prefer the familiarity of poking around in Finder, then you can try this:
- Type
open $(brew --prefix openslide-java)
- this should open up Finder close to the file you need - Find
libopenslide-jni.jnilib
and copy it - Find QuPath.app, then right-click on it and choose Show package contents
- Browse down to QuPath.app/Contents/app and paste
libopenslide-jni.jnilib
there
If there is an existing file with the same name, you can remove that so that your new Homebrew-installed version is used.
brew help
, man brew
or check Homebrew's documentation.