Denis, Alexis
2014-Feb-20 12:45 UTC
[Xapian-discuss] Fail compiling Ruby bindings Windows MinGW RubyInstaller 1.9.3
Hello, I am trying to compile xapian, omega and xapian Ruby bindings 1.2.17 on Windows using the MinGW environment and Ruby 1.9.3 (installed using the Ruby installer). The Win32 files are not an option because Ruby is compiled with MinGW as of 1.9 version. Xapian compiles out of the box. Omega is giving me some grief about unixperm.cxx. The ruby bindings simply don't link the so file. I tried to link it with libmsvcrt-ruby191-static.a and it linked but it failed to load with a memory error (during require 'xapian'). Link errors: libtool: link: g++ -shared -nostdlib ..../lib/dllcrt2.o ..../lib/gcc/mingw32/4.5.2/crtbegin.o .libs/xapian_wrap.o /usr/local/lib/libxapian.dll.a -lz -lws2_32 -lrpcrt4 -lstdc++ -L..../lib/gcc/mingw32/4.5.2 -L..../lib/gcc -L..../mingw32/lib -L..../lib -lstdc++ -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt ..../lib/gcc/mingw32/4.5.2/crtend.o -O2 -Wl,--enable-runtime-pseudo-reloc -o .libs/_xapian.so -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/_xapian.dll.a .libs/xapian_wrap.o: In function `SWIG_Ruby_ErrorType': ....\xapian\xapian-bindings-1.2.17\ruby/xapian_wrap.cc:1098: undefined reference to `rb_eRuntimeError' ....\xapian\xapian-bindings-1.2.17\ruby/xapian_wrap.cc:1065: undefined reference to `rb_eIndexError' ..... Alexis
Olly Betts
2014-Feb-22 00:07 UTC
[Xapian-discuss] Fail compiling Ruby bindings Windows MinGW RubyInstaller 1.9.3
On Thu, Feb 20, 2014 at 12:45:43PM +0000, Denis, Alexis wrote:> I am trying to compile xapian, omega and xapian Ruby bindings 1.2.17 > on Windows using the MinGW environment and Ruby 1.9.3 (installed using > the Ruby installer). The Win32 files are not an option because Ruby is > compiled with MinGW as of 1.9 version. Xapian compiles out of the box. > Omega is giving me some grief about unixperm.cxx. The ruby bindings > simply don't link the so file. I tried to link it with > libmsvcrt-ruby191-static.a and it linked but it failed to load with a > memory error (during require 'xapian').It'll need to be linked to the shared version of libmsvcrt-ruby191 - if you link with the static version, you'll end up with two copies of Ruby in the process when the ruby interpreter dynamically loads the xapian extension. The simple workaround is to build with: make RUBY_LIBS=-lmsvcrt-ruby191 A fix to make it build out of the box should be in 1.2.18 and 1.3.2. Ticket is: http://trac.xapian.org/ticket/634 Cheers, Olly