Native dependencies don't load with Java 7 on Linux #86

Open
technomancy opened this Issue Apr 11, 2012 · 38 comments

Projects

None yet

6 participants

@technomancy

Getting this with Leiningen 1 and 2, but this particular issue doesn't occur with OpenJDK 6:

~/src/overtone $ lein1 version
Leiningen 1.7.1 on Java 1.7.0-release OpenJDK 64-Bit Server VM
~/src/overtone $ lein1 repl
REPL started; server listening on localhost port 52908
user=> (use 'overtone.live)
java.lang.UnsatisfiedLinkError: Unable to load library 'scsynth_jna': libjack.so.0: cannot open shared object file: No such file or directory
    at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:164)
    at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:237)
    at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:200)
    at com.sun.jna.Native.register(Native.java:1013)
    at supercollider.internal.ScSynthLibrary.<clinit>(ScSynthLibrary.java:100)
    at supercollider.ScSynth.run(ScSynth.java:110)
    at overtone.sc.machinery.server.connection$internal_booter.invoke(connection.clj:160)
    at clojure.lang.AFn.run(AFn.java:24)
    at java.lang.Thread.run(Thread.java:722)
Exception in thread "Thread-5" java.lang.UnsatisfiedLinkError: supercollider.internal.ScSynthLibrary.scsynth_jna_init()I
    at supercollider.internal.ScSynthLibrary.scsynth_jna_init(Native Method)
    at supercollider.ScSynth.run(ScSynth.java:110)
    at overtone.sc.machinery.server.connection$internal_booter.invoke(connection.clj:160)
    at clojure.lang.AFn.run(AFn.java:24)
    at java.lang.Thread.run(Thread.java:722)
Exception The following deps took too long to be satisfied: :server-ready  overtone.libs.deps/wait-until-deps-satisfied (deps.clj:148)
@technomancy

This happens both on 0.6.0 and 0.7.0-SNAPSHOT.

@samaaron
Member

Thanks for this. We'll take a look at Java 7 post the 0.7 release

@samaaron
Member
samaaron commented Jul 1, 2012

Hi Phil,

could you give this a try again with the latest Overtone from Github? We have a new native internal server which should work on JVM 7 on Linux...

@technomancy

Hmm; I get this when running (use 'overtone.live) in lein repl with both lein1 and lein2.

UnsatisfiedLinkError Unable to load library 'scsynth': /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /home/phil/src/overtone/native/linux/x86_64/libscsynth.so)  com.sun.jna.NativeLibrary.loadLibrary (NativeLibrary.java:169)

Looks like a different issue though, since I get it even with JDK 6.

@samaaron
Member
samaaron commented Jul 2, 2012

Hey Phil,

thanks for trying this out. It seems that it's an improvement as at least we're getting consistent errors across JVMs ;-)

Could let me know the result of running the following:

(use 'overtone.core)
(System/getProperty "jna.library.path")

Also, could you ls that directory?

@technomancy

Sure; here's the output:

user=> (use 'overtone.live)
(use 'overtone.live)
--> Loading Overtone...
UnsatisfiedLinkError Unable to load library 'scsynth': /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /home/phil/src/overtone/native/linux/x86_64/libscsynth.so)  com.sun.jna.NativeLibrary.loadLibrary (NativeLibrary.java:169)

user=> (System/getProperty "jna.library.path")
"/home/phil/src/overtone/native/linux/x86_64"
user=> �
Bye for now!


~/src/overtone $ ls native/linux/x86_64/
BinaryOpUGens.so  FilterUGens.so    MouseUGens.so             ReverbUGens.so
ChaosUGens.so     GendynUGens.so    MulAddUGens.so            TestUGens.so
DelayUGens.so     GrainUGens.so     NoiseUGens.so             TriggerUGens.so
DemandUGens.so    IOUGens.so        OscUGens.so               UnaryOpUGens.so
DiskIO_UGens.so   KeyboardUGens.so  PV_ThirdParty.so          UnpackFFTUGens.so
DynNoiseUGens.so  LFUGens.so        PanUGens.so               libscsynth.so
FFT_UGens.so      ML_UGens.so       PhysicalModelingUGens.so  
@samaaron
Member
samaaron commented Jul 2, 2012

Cool thanks.

Looks like you're missing a dependency library: glib version 2.14. I've got no idea of that specific version is required or not. I would be surprised if a version of glib didn't already exist on your system.

I'm unsure what the best thing to do here is. This problem only seems to exist on Linux where this is quite a heterogeneous install base and good package managers. We could try and package all the library dependencies together, or we could get people to use their respective package to install the dependencies manually.

Do you have any suggestions?

@technomancy

It looks like I have version 2.32.3 of glib. I don't know much about C builds, but maybe it's either looking for something too specific, or not statically linking enough in at build time? I don't think I even have access to such an old version of glib, so if that version is specifically needed it should probably be bundled.

@samaaron
Member
samaaron commented Jul 2, 2012

Looks like it's 20mb - seems quite hefty to be putting into a jar for all users of Overtone?

@samaaron
Member
samaaron commented Jul 2, 2012

Just to put it in context - all the SuperCollider binaries (including ugens) for all the architectures and OSs combined is only 5mb...

@technomancy

Oof; that's rough. Is it possible to fetch it on demand?

@samaaron
Member
samaaron commented Jul 2, 2012

I'm not sure how you'd achieve this. Is it possible to specify per-linux-distribution dependencies with lein?

Perhaps the solution is to tell people to install SuperCollider manually when they see this error. Then their package manager will pick up the pieces?

@technomancy

I was thinking the load failure could trigger an attempt to fetch the needed library specifically, but I have no idea if that's feasible. I know you're doing your own dependency management for native bits, but I guess you might have to include pomegranate at runtime for that?

An error message pointing people to use their native package manager would be better than nothing. I've got a supercollider package available in apt-get that claims to work with the latest glibc.

@samaaron
Member
samaaron commented Jul 2, 2012

The only dependency management for native bits we're doing is chucking stuff into a Clojar and using lein to pull things down and set the JVM native path automatically. The Clojar in question is overtone/scsynth.

We'd be happy to accept patches for load-failure error messages - or even pulling down extra stuff from Clojars using pomegranate :-)

Also, if you have compiled versions of Supercollider version 3.5.3 that use a newer version of glibc, I'd be happy to replace the binaries in overtone/scsynth with them.

@vemv
vemv commented Jul 14, 2012

hey Sam,

I'm getting the same error as Phil error when trying Mini Beast, but not when running standalone Overtone:

UnsatisfiedLinkError Unable to load library 'scsynth': /lib/libc.so.6: version 'GLIBC_2.14' not found

Perhaps Mini Beast includes a 'bleeding edge' version of Overtone that would have introduced the issue?

@ckuttruff

Any updates regarding this issue? Have installed jackd/supercollider(v 3.6.2), started jack via qjackctl... but still get this UnsatisfiedLinkError for scsynth (running 64 bit linux, jdk 1.7.0_21, clojure 1.5.1 and overtone 0.8.1)

Thanks, please let me know if I can provide more info; would love to be able to start playing with overtone

@samaaron
Member

Hey @ckuttruff

there haven't been any specific updates with this error due to a lack of Overtone contributors running linux. If you're interested in helping out, then that would be awesome.

However, it shouldn't stop you getting started with Overtone. This is just for the internal server. You can still use an external server (i.e. running in a separate process) with ease. Simply install SuperCollider manually (i.e. apt-get install supercollider) and then in your Clojure REPL do (use 'overtone.core) and then do (boot-external-server). For more info see: https://github.com/overtone/overtone/wiki/Connecting-scsynth

@ckuttruff

@samaaron Thanks for the reply. Def got that impression ( *shakes fist at Apple :D )
Will try out the external server, and send a PR your way if I can manage to get the internal server working.

Thanks for your work on this project; looks really impressive from the videos I've seen... look forward to trying things out

@samaaron
Member

No, thank-you for spending your time getting things running. Overtone isn't software, it's a community and one that welcomes you with open arms :-)

@thomas-morgan

I get the same error but while running (use 'overtone.core). This happens with Overtone 0.8.0 and 0.8.1; 0.7.1 is fine. I'm using Debian wheezy with glibc version 2.13 and I've installed SuperCollider 3.6alpha1.

@samaaron
Member

@thomas-morgan Which error are you seeing when you (use 'overtone.core)?

@thomas-morgan
user=> (use 'overtone.core)
--> Loading Overtone...
UnsatisfiedLinkError Unable to load library 'scsynth': /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /usr/src/sounds/target/native/linux/x86_64/libscsynth.so)  com.sun.jna.NativeLibrary.loadLibrary (NativeLibrary.java:169)
@samaaron
Member

OK, could you give 0.9.0-SNAPSHOT a try. I just pushed a commit which hopefully bypasses this issue...

@thomas-morgan

I'm getting the same error with 0.9.0-SNAPSHOT...

@paomian
paomian commented Aug 15, 2013

UnsatisfiedLinkError Unable to load library 'scsynth': libjack.so.0: cannot open shared object file: No such file or directory com.sun.jna.NativeLibrary.loadLibrary (NativeLibrary.java:169)
I got this,it is look like something which is above

@samaaron
Member

@thomas-morgan Does it look exactly the same? Could you paste a copy of all the text you see after you run (use 'overtone.core)

@samaaron
Member

@paomian Do you get this with the latest 0.9.0-SNAPSHOT? Do you have jack installed? Have you read this: https://github.com/overtone/overtone/wiki/Installing-and-starting-jack

@thomas-morgan

Yes, it looks the same:

user=> (use 'overtone.core)
--> Loading Overtone...
UnsatisfiedLinkError Unable to load library 'scsynth': /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /usr/src/sounds/target/native/linux/x86_64/libscsynth.so)  com.sun.jna.NativeLibrary.loadLibrary (NativeLibrary.java:169)

user=> 
@samaaron
Member

@thomas-morgan strange. Could you verify it does the same from within a freshly checked out clone of the Overtone repo, rather than specifying Overtone as a dependency to your project:

git clone https://github.com/overtone/overtone.git
cd overtone
lein repl
(use 'overtone.core)
@samaaron
Member

@thomas-morgan Also, could you verify you're using Lein 2.x?

@thomas-morgan

This works! Though I haven't managed to get sound from it, but maybe that's another issue...

$ git clone https://github.com/overtone/overtone.git
Cloning into 'overtone'...
...
Resolving deltas: 100% (10434/10434), done.
$ cd overtone
$ lein repl
Could not find artifact org.fife.ui:rsyntaxtextarea:jar:2.0.4.1 in central (http://repo1.maven.org/maven2)
Could not find artifact seesaw:seesaw:jar:1.4.3 in central (http://repo1.maven.org/maven2)
Retrieving seesaw/seesaw/1.4.3/seesaw-1.4.3.jar (123k)
    from https://clojars.org/repo/
Retrieving org/fife/ui/rsyntaxtextarea/2.0.4.1/rsyntaxtextarea-2.0.4.1.jar (776k)
    from https://clojars.org/repo/
nREPL server started on port 37539
REPL-y 0.1.0-beta10
Clojure 1.3.0
...
user=> (use 'overtone.core)
--> Loading Overtone...
java.lang.UnsatisfiedLinkError: Unable to load library 'scsynth': /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /home/tlm/in-algol/overtone/native/linux/x86_64/libscsynth.so)
    at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:169)
...
    at java.lang.Thread.run(Thread.java:679)
Aug 16, 2013 9:15:04 AM sun.reflect.NativeMethodAccessorImpl invoke0
WARNING: 
Aug 16, 2013 9:15:04 AM sun.reflect.NativeMethodAccessorImpl invoke0
SEVERE: Unable to load native libs c and scsynth. Please try an external server with (use 'overtone.core)
--> Please boot a server to start making noise:
    * (boot-server)             ; boot default server (honours config)
    * (boot-internal-server)    ; boot an internal server
    * (boot-external-server)    ; boot an external server
    * (connect-external-server) ; connect to an existing external server

nil
user=> Bye for now!
$ lein --version
Leiningen 2.0.0-preview10 on Java 1.6.0_27 OpenJDK 64-Bit Server VM
@samaaron
Member

@thomas-morgan OK, that's progress. You'll need to use an external server, which means installing SuperCollider separately (apt-get install supercollider) and then booting it with (boot-external-server). You might also have to do some Jack twiddling: https://github.com/overtone/overtone/wiki/Installing-and-starting-jack

@thomas-morgan

It's making sound! (I'm not sure what changed, though; I tried (boot-external-server) yesterday too.)

@samaaron
Member

@thomas-morgan Awesome! Glad to hear it.

@thomas-morgan

This log demonstrates the problem I'm having with using Overtone as a dependency.

$ lein new insane-noises
Generating a project called insane-noises based on the 'default' template.
To see other templates (app, lein plugin, etc), try `lein help new`.
$ cd insane-noises
$ cat << EOF > project.clj
> (defproject insane-noises "0.1.0-SNAPSHOT"
>   :description "FIXME: write description"
>   :url "http://example.com/FIXME"
>   :license {:name "Eclipse Public License"
>             :url "http://www.eclipse.org/legal/epl-v10.html"}
>   :dependencies [[org.clojure/clojure "1.5.1"]
>                  [overtone "0.9.0-SNAPSHOT"]])
> EOF
$ lein repl
Retrieving org/clojure/clojure/1.5.1/clojure-1.5.1.pom (6k)
    from http://repo1.maven.org/maven2/
Could not find metadata overtone:overtone:0.9.0-SNAPSHOT/maven-metadata.xml in central (http://repo1.maven.org/maven2)
Retrieving overtone/overtone/0.9.0-SNAPSHOT/maven-metadata.xml (1k)
    from https://clojars.org/repo/
Retrieving org/clojure/clojure/1.5.1/clojure-1.5.1.jar (3501k)
    from http://repo1.maven.org/maven2/
Could not find artifact org.fife.ui:rsyntaxtextarea:jar:2.0.4.1 in central (http://repo1.maven.org/maven2)
Could not find artifact seesaw:seesaw:jar:1.4.3 in central (http://repo1.maven.org/maven2)
Retrieving org/fife/ui/rsyntaxtextarea/2.0.4.1/rsyntaxtextarea-2.0.4.1.jar (776k)
    from https://clojars.org/repo/
Retrieving seesaw/seesaw/1.4.3/seesaw-1.4.3.jar (123k)
    from https://clojars.org/repo/
nREPL server started on port 54558
REPL-y 0.1.0-beta10
Clojure 1.5.1
...
user=> (use 'overtone.core)
--> Loading Overtone...
UnsatisfiedLinkError Unable to load library 'scsynth': /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /home/tlm/in-algol/insane-noises/target/native/linux/x86_64/libscsynth.so)  com.sun.jna.NativeLibrary.loadLibrary (NativeLibrary.java:169)
@samaaron
Member

Hi there, could you try again with the latest snapshot (you might have to force an update)

@thomas-morgan

I repeated the above (starting with lein new insane-noises) with the same result. It seems to have retrieved the new snapshot (0.9.0-20130820.175535-9).

@thomas-morgan

I'm using 0.9.1 now and (use 'overtone.core) (boot-external-server) works fine, so this problem seems to be resolved. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment