Re: Can't build xapian-bindings in a virtual enc
Eric Abrahamsen <[email protected]>
| Newsgroups | gmane.comp.search.xapian.general |
|---|---|
| Message-ID | <[email protected]> |
On 10/03/18 23:25 PM, Olly Betts wrote: > On Tue, Oct 02, 2018 at 04:13:14PM -0700, Eric Abrahamsen wrote: >> ./configure --prefix=$venv --with-python3 >> >> The configure process looks fine: xapian-config is found correctly, as >> is my virtualenv python installation. Then I export LD_LIBRARY_PATH as >> $venv/lib. > > You shouldn't need to set LD_LIBRARY_PATH - libtool should set rpath > when linking against a library outside the standard search path. > > In general it's probably harmless to set it though, and it shouldn't > result in the compiler getting killed. I set it anyway -- belt and suspenders :) >> Then "make" fails with: > [...] >> libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. >> -I/usr/include/python3.6m -fno-strict-aliasing -Wall -Wno-unused >> -Wno-uninitialized -fvisibility=hidden >> -I/home/<me>/.local/share/virtualenvs/<venv>/include -g -O2 -MT >> xapian_wrap.lo -MD -MP -MF .deps/xapian_wrap.Tpo -c xapian_wrap.cc >> -fPIC -DPIC -o .libs/xapian_wrap.o >> g++: internal compiler error: Killed (program cc1plus) > > This seems to indicate the compiler received SIGKILL, which smells to me > like the kernel's OOM (Out Of Memory) killer kicked in. > > The bindings are quite resource intensive to compile, so on a low-memory > system you may need to turn down or disable optimisation to get them to > build. Also check that the amount memory a process can use isn't > limited by ulimit. > > The INSTALL file shows how to disable optimisation: > > https://trac.xapian.org/browser/git/xapian-bindings/INSTALL#L14 > > The change way back in 0.9.3 mentioned there was that we factored out > the exception mapping into a helper function. Thanks for this -- the server is resource-constrained, and that was indeed the problem. I assumed that the optimization would produce smaller binaries, so rather than disabling that I instead temporarily shut off some other non-critical services, and freed up enough memory to do the build. All seems to have worked out fine! Thanks very much for the pointer. Eric