ruby/swig/svn load error

B

Belorion

I just finished installing the SVN binding for ruby using SWIG 1.3.24
(swig 1.3.25 wouldn't compile -- syntax errors).

I reconfigured an reinstalled Subversion (1.2.1) afterwards so that it
knew about the bindings (as per the instructions[1]). I did a `make
swig-rb` with no problems, a `make check-swig-rb` in which unit tests
are run, no problem. I did a make install-swig-rb.

However, when I do a `ruby -e 'require "svn/core"' I get this error:

/usr/local/lib/ruby/site_ruby/1.8/i686-linux/svn/ext/core.so:
libsvn_swig_ruby-1.so.0: cannot open shared object file: No such file
or directory - /usr/local/lib/ruby/site_ruby/1.8/i686-linux/svn/ext/core.so
(LoadError)
from /usr/local/lib/ruby/site_ruby/1.8/svn/error.rb:1
from /usr/local/lib/ruby/site_ruby/1.8/svn/core.rb:3:in `require'
from /usr/local/lib/ruby/site_ruby/1.8/svn/core.rb:3
from -e:1:in `require'
from -e:1


Now, I can see libsvn_swig_ruby-1.so.0 in /usr/local/lib. Why can't it fin=
d it?

I don't know if this is relevant, but during the `make
install-swig-rb` I get a lot of these "warnings":

libtool: link: warning:
`/usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../..//libdb-4.2.la' seems
to be moved
libtool: link: warning:
`/usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../..//libexpat.la' seems
to be moved


Anyway, I can run all the unit tests just fine (which obviously use
the libraries) if I execute from
/usr/local/src/subversion-1.2.1/subversion/bindings/swig/ruby (as
root, due to permission issues), but from anywhere else I get the
above load error.

Anyone have any suggestions? I am using Ruby 1.8.2 (december build),
SWIG 1.3.24, and Subversion 1.2.1 on this Suse 9.2 box, and followed
the insructions from [1].

Thanks.

Matt

[1] http://svn.collab.net/repos/svn/trunk/subversion/bindings/swig/INSTALL
 
K

Kouhei Sutou

Hi,

In <[email protected]>
"ruby/swig/svn load error" on Mon, 1 Aug 2005 08:30:53 +0900,
Belorion said:
I just finished installing the SVN binding for ruby using SWIG 1.3.24
(swig 1.3.25 wouldn't compile -- syntax errors).

You can compile with SWIG 1.3.25 by applying the attached
patch. This change is included in trunk.
However, when I do a `ruby -e 'require "svn/core"' I get this error:

/usr/local/lib/ruby/site_ruby/1.8/i686-linux/svn/ext/core.so:
libsvn_swig_ruby-1.so.0: cannot open shared object file: No such file
or directory - /usr/local/lib/ruby/site_ruby/1.8/i686-linux/svn/ext/core.so
(LoadError) snip
Now, I can see libsvn_swig_ruby-1.so.0 in /usr/local/lib. Why can't it find it?

Could you show me the result of the following commands?

(1) % ldd /usr/local/lib/ruby/site_ruby/1.8/i686-linux/svn/ext/core.so

(2) % env LD_LIBRARY_PATH=/usr/local/lib ldd /usr/local/lib/ruby/site_ruby/1.8/i686-linux/svn/ext/core.so

(3) % env LD_LIBRARY_PATH=/usr/local/lib ruby -e 'require "svn/core"'


If (2) and (3) don't occur any errors, could you
re-configure with --prefix=/usr option?


Thanks,
 
B

Belorion

You can compile with SWIG 1.3.25 by applying the attached
patch. This change is included in trunk.

I think you forgot to attach the patch :). Where would I find it
online? I am browsing the CVS repository on sourceforge, but can't
seem to find the file I need.
Could you show me the result of the following commands?
=20
(1) % ldd /usr/local/lib/ruby/site_ruby/1.8/i686-linux/svn/ext/core.so

linux-gate.so.1 =3D> (0xffffe000)
libsvn_swig_ruby-1.so.0 =3D> not found
libsvn_delta-1.so.0 =3D> /usr/local/lib/libsvn_delta-1.so.0 (0x40026000)
libsvn_diff-1.so.0 =3D> /usr/local/lib/libsvn_diff-1.so.0 (0x4002f000)
libsvn_subr-1.so.0 =3D> /usr/local/lib/libsvn_subr-1.so.0 (0x40035000)
libapr-0.so.0 =3D> /usr/local/apr/lib/libapr-0.so.0 (0x40057000)
librt.so.1 =3D> /lib/tls/librt.so.1 (0x40077000)
libm.so.6 =3D> /lib/tls/libm.so.6 (0x4007f000)
libcrypt.so.1 =3D> /lib/libcrypt.so.1 (0x400a1000)
libnsl.so.1 =3D> /lib/libnsl.so.1 (0x400d3000)
libpthread.so.0 =3D> /lib/tls/libpthread.so.0 (0x400e8000)
libdl.so.2 =3D> /lib/libdl.so.2 (0x400f8000)
libc.so.6 =3D> /lib/tls/libc.so.6 (0x400fb000)
libaprutil-0.so.0 =3D> /usr/local/apr/lib/libaprutil-0.so.0 (0x40210000)
libdb-4.2.so =3D> /usr/lib/tls/libdb-4.2.so (0x40225000)
libexpat.so.0 =3D> /usr/lib/libexpat.so.0 (0x402fb000)
/lib/ld-linux.so.2 =3D> /lib/ld-linux.so.2 (0x80000000)

=20
(2) % env LD_LIBRARY_PATH=3D/usr/local/lib ldd /usr/local/lib/ruby/site= _ruby/1.8/i686-linux/svn/ext/core.so
=20
(3) % env LD_LIBRARY_PATH=3D/usr/local/lib ruby -e 'require "svn/core"'

If (2) and (3) don't occur any errors, could you
re-configure with --prefix=3D/usr option?

After doing those two things, the errors went away. (still using 1.3.24)

Thanks a lot for the speedy reply. Once I can find the patch for
1.3.25, I'll see how that one works.

Matt
 
K

Kouhei Sutou

----Next_Part(Mon_Aug__1_11_22_23_2005_451)--
Content-Type: Multipart/Mixed;
boundary="--Next_Part(Mon_Aug__1_11_22_23_2005_451)--"

----Next_Part(Mon_Aug__1_11_22_23_2005_451)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

In <[email protected]>
"Re: ruby/swig/svn load error" on Mon, 1 Aug 2005 10:38:14 +0900,
Belorion said:
I think you forgot to attach the patch :). Where would I find it
online? I am browsing the CVS repository on sourceforge, but can't
seem to find the file I need.

I'm so sorry...
I really attached the patch this time!

Thanks,
--
kou

----Next_Part(Mon_Aug__1_11_22_23_2005_451)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="svn-ruby-swig-1.3.25.diff"

Index: subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
===================================================================
--- subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c (revision 15525)
+++ subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c (working copy)
@@ -1,10 +1,18 @@
#include "swigutil_rb.h"
#include <st.h>

+#if SVN_SWIG_VERSION >= 103025
+# include <swiglabels.swg>
+#endif
+#include <ruby/rubyhead.swg>
#include <swigrun.swg>
-#include <ruby/rubyhead.swg>
-#include <common.swg>
+#if SVN_SWIG_VERSION < 103025
+# include <common.swg>
+#endif
#include <ruby/rubydef.swg>
+#if SVN_SWIG_VERSION >= 103025
+# include <runtime.swg>
+#endif

static VALUE mSvn = Qnil;
static VALUE mSvnCore = Qnil;

----Next_Part(Mon_Aug__1_11_22_23_2005_451)----
----Next_Part(Mon_Aug__1_11_22_23_2005_451)----
 
B

Belorion

Thanks Kou, the patch fixed the compilation issues with 1.3.25. Any
suggestions as to how to fix the library linking issue permanently, so
I don't have to do this ...

(1) % ldd /usr/local/lib/ruby/site_ruby/1.8/i686-linux/svn/ext/core.so

(2) % env LD_LIBRARY_PATH=3D/usr/local/lib ldd
/usr/local/lib/ruby/site_ruby/1.8/i686-linux/svn/ext/core.so

(3) % env LD_LIBRARY_PATH=3D/usr/local/lib ruby -e 'require "svn/core"'

Everytime? Thanks again.

Matt
 
K

Kouhei Sutou

Hi,

In <[email protected]>
"Re: ruby/swig/svn load error" on Mon, 1 Aug 2005 11:44:38 +0900,
Belorion said:
(2) % env LD_LIBRARY_PATH=/usr/local/lib ldd
/usr/local/lib/ruby/site_ruby/1.8/i686-linux/svn/ext/core.so

(3) % env LD_LIBRARY_PATH=/usr/local/lib ruby -e 'require "svn/core"'

Everytime? Thanks again.

Or add

/usr/local/lib

to /etc/ld.so.conf.


Or add

setenv LD_LIBRARY_PATH=/usr/local/lib

to your ~/.login. (if you use csh/tcsh)


Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,743
Latest member
WoodrowMea

Latest Threads

Top