You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm on macOS Catalina, and had some trouble getting the compiled C code loaded.
I first hit this issue:
% lein repl
spire.core=> (clojure.lang.RT/loadLibrary "spire")
Execution error (UnsatisfiedLinkError) at java.lang.ClassLoader/loadLibrary (ClassLoader.java:2670).
no spire in java.library.path: [./]
project.clj has :jvm-opts ["-Djava.library.path=./"], but that's not where the libspire.dylib is on my system. I have that file at ~/.spire/libs. I copied the file to the spire repo and then (clojure.lang.RT/loadLibrary "spire") and the rest of Spire worked without issue. Think there's anything Spire can do to remove that obstacle?
Another note, ~/.spire/libs/libspire.dylib is created when installing spire, but not when starting up the dev environment. That makes sense in hindsight, but should probably be explicitly mentioned in whatever docs describe this process.
The text was updated successfully, but these errors were encountered:
your libspire.dylib was created when spire ran for the first time. It was copied into that ~/.spire/libs location from an internal resource bundled inside the spire binary. And that bundled dylib file was built on the CircleCI servers.
You should be able to build the C code into a shared library by issuing make lib from the dev environment. It will make the shared library artefact inside the target/jni folder. That then needs to be on your java library path. Unfortunately you can't alter this path after JVM startup on some implementations of the JVM. It is considered read only. So if it's not in a location on the library path, and you want to alter your library path, you will need to adjust that on the jvm launch, such as in the leiningen project file.
I'm on macOS Catalina, and had some trouble getting the compiled C code loaded.
I first hit this issue:
project.clj has
:jvm-opts ["-Djava.library.path=./"]
, but that's not where the libspire.dylib is on my system. I have that file at ~/.spire/libs. I copied the file to the spire repo and then(clojure.lang.RT/loadLibrary "spire")
and the rest of Spire worked without issue. Think there's anything Spire can do to remove that obstacle?Another note, ~/.spire/libs/libspire.dylib is created when installing spire, but not when starting up the dev environment. That makes sense in hindsight, but should probably be explicitly mentioned in whatever docs describe this process.
The text was updated successfully, but these errors were encountered: