Pat Johnson
2005-Sep-12 19:10 UTC
[Xapian-discuss] Compiling xapian-bindings-0.9.2 on OpenBSD 3.7
Hello, Compiling xapian-core-0.9.2 worked fine, and make check reported that the tests ran without problems (although it skipped some near the end). Now I'm trying to compile xapian-bindings-0.9.2 on OpenBSD 3.7 but have run into a problem. After hours of searching the net I haven't found a solution. For reference gcc -v gives the following output: Configured with: Thread model: single gcc version 3.3.5 (propolice) And I'm using Python 2.3.5. This works fine: ./configure XAPIAN_CONFIG=/usr/local/src/xapian-core-0.9.2/xapian-config But when I run make I get the following (some parts removed because it's quite a long list of similar errors): make all-recursive Making all in python make all-recursive Making all in docs Making all in examples if /bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/include/python2.3 -Wall -Wno-unused -Wno-uninitialized -g -O2 -I/usr/local/src/xapian-core-0.9.2/include -I/usr/local/src/xapian-core-0.9.2/extra -MT xapian_wrap.lo -MD -MP -MF ".deps/xapian_wrap.Tpo" -c -o xapian_wrap.lo `test -f 'modern/xapian_wrap.cc' || echo './'`modern/xapian_wrap.cc; then mv -f ".deps/xapian_wrap.Tpo" ".deps/xapian_wrap.Plo"; else rm -f ".deps/xapian_wrap.Tpo"; exit 1; fi mkdir .libs g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/include/python2.3 -Wall -Wno-unused -Wno-uninitialized -g -O2 -I/usr/local/src/xapian-core-0.9.2/include -I/usr/local/src/xapian-core-0.9.2/extra -MT xapian_wrap.lo -MD -MP -MF .deps/xapian_wrap.Tpo -c modern/xapian_wrap.cc -fPIC -DPIC -o .libs/xapian_wrap.o /bin/sh ../libtool --tag=CXX --mode=link g++ -Wall -Wno-unused -Wno-uninitialized -g -O2 -I/usr/local/src/xapian-core-0.9.2/include -I/usr/local/src/xapian-core-0.9.2/extra -o _xapian.la -rpath /usr/local/lib/python2.3/site-packages -avoid-version -module -no-undefined xapian_wrap.lo /usr/local/src/xapian-core-0.9.2/libxapian.la g++ -shared -fPIC -DPIC .libs/xapian_wrap.o -L/usr/local/src/xapian-core-0.9.2/.libs -lxapian -o .libs/_xapian.so creating _xapian.la (cd .libs && rm -f _xapian.la && ln -s ../_xapian.la _xapian.la) cp `test -f modern/xapian.py || echo './'`modern/xapian.py xapian.py PYTHONPATH=".:.libs" /usr/local/bin/python -c "import xapian" /usr/local/bin/python:/usr/local/lib/libxapian.so.8.0: undefined symbol '_ZTISi' /usr/local/bin/python: /usr/local/lib/libxapian.so.8.0: can't resolve reference '_ZTISi' /usr/local/bin/python:/usr/local/lib/libxapian.so.8.0: undefined symbol '_ZTISi' /usr/local/bin/python: /usr/local/lib/libxapian.so.8.0: can't resolve reference '_ZTISi' (this list of undefined symbols goes on for awhile then:) /usr/local/bin/python:/usr/local/lib/libxapian.so.8.0: undefined symbol '_ZNSsC1EPKcjRKSaIcE' lazy binding failed! Segmentation fault (core dumped) *** Error code 139 Stop in /usr/local/src/xapian-bindings-0.9.2/python (line 752 of Makefile). *** Error code 1 Stop in /usr/local/src/xapian-bindings-0.9.2/python (line 410 of Makefile). *** Error code 1 Stop in /usr/local/src/xapian-bindings-0.9.2/python (line 253 of Makefile). *** Error code 1 Stop in /usr/local/src/xapian-bindings-0.9.2 (line 303 of Makefile). *** Error code 1 Stop in /usr/local/src/xapian-bindings-0.9.2 (line 208 of Makefile). Does anyone know why this occurs and what I can do about it? Thanks, -Pat
Olly Betts
2005-Sep-12 22:10 UTC
[Xapian-discuss] Compiling xapian-bindings-0.9.2 on OpenBSD 3.7
On Mon, Sep 12, 2005 at 11:04:57AM -0700, Pat Johnson wrote:> /usr/local/bin/python: /usr/local/lib/libxapian.so.8.0: can't resolve reference '_ZTISi'That's 'typeinfo for std::basic_istream<char, std::char_traits<char> >'.> /usr/local/bin/python:/usr/local/lib/libxapian.so.8.0: undefined symbol '_ZNSsC1EPKcjRKSaIcE'And that's 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, unsigned int, std::allocator<char> const&)' - i.e. the constructor for std::string (you can decode these by piping text containing them through 'c++filt'). Usually this sort of error results from mismatching C++ library versions, so I'd suggest rebuilding xapian-core and then xapian-bindings from scratch to make sure that's not the problem. The only other thing I can think of off the top of my head is that Python is either partly written in C++ (which I don't think is the case) or is automatically loading another C++ extension and that this is pulling in a different version of libstdc++ or something like that. Cheers, Olly
Olly Betts
2005-Sep-15 15:32 UTC
[Xapian-discuss] Compiling xapian-bindings-0.9.2 on OpenBSD 3.7
On Mon, Sep 12, 2005 at 11:04:57AM -0700, Pat Johnson wrote:> This works fine: > ./configure XAPIAN_CONFIG=/usr/local/src/xapian-core-0.9.2/xapian-config > > But when I run make I get the following (some parts removed because > it's quite a long list of similar errors):Thanks to Pat allowing me use of his machine, I've tracked down the problem. When linking the _xapian.so library, g++ doesn't add a dependency on libstdc++ and Python is written in C so doesn't link against libstdc++ itself. There's an easy workaround though. Configure xapian-bindings as usual, but run make like this: make LDFLAGS=-lstdc++ I suspect the same issue will effect the other bindings, and perhaps netbsd and freebsd too. I wonder if we should always set LDFLAGS=-lstdc++ when using GCC - it should be harmless on platforms (like Linux) where it is added anyway. Cheers, Olly