James Aylett | 13 Sep 2010 10:11

Fwd: errors with rpm instructions

Ben Williams wrote:

> The instructions for RHEL5 at http://xapian.org/download have a problem. The xapian repo file points to
non-existent directories.

Looks to me like the repo files aren't being generated correctly; it has $basearch instead of (currently)
i386. (RHEL4 is affected also.)

J

--

-- 
 James Aylett
 talktorex.co.uk - xapian.org - devfort.com
Olly Betts | 21 Sep 2010 14:52
Favicon
Gravatar

Re: Fwd: errors with rpm instructions

On Mon, Sep 13, 2010 at 09:11:27AM +0100, James Aylett wrote:
> Ben Williams wrote:
> 
> > The instructions for RHEL5 at http://xapian.org/download have a problem.
> > The xapian repo file points to non-existent directories.
> 
> Looks to me like the repo files aren't being generated correctly; it has
> $basearch instead of (currently) i386. (RHEL4 is affected also.)

I'm no expert, but I think $basearch there is correct (or else you couldn't
put RPMs built for different archs in the same repo).

I suspect Ben's problem is that he isn't running i386 and those are the
only RPMs there currently.  So his machine expands $basearch to x86_64
(or whatever) which isn't there.

You should be able to build from the SRPMs (or even just the source tarballs)
using rpmbuild.

Cheers,
    Olly
Olly Betts | 21 Sep 2010 15:07
Favicon
Gravatar

Re: Sort ordering

On Mon, Aug 23, 2010 at 09:42:41PM +1000, Simon Litchfield wrote:
> Using MultiValueSorter, I can sort by key1, key2, relevance; or relevance,
> key1, key2.
> 
> But AFAIK, I can't sort by key1, relevance, key2. Unless I spool out the
> entire result set or write some C++.

Indeed you can't.

Incidentally, note that sorting by keys after relevance is rarely useful with
BM25Weight (the default) as documents don't often get exactly the same score.
It can be useful with custom weighting schemes (which can only be implemented
in C++) or perhaps with carefully chosen BM25 parameters.

> I wonder if we need a new 'sort by' function that accepts any combination of
> keys and relevance in any order? The function would make it's own
> optimisations (ie is relevance first or last, etc)

Perhaps this would be best done by adding a couple of methods to allow a
pre-relevance sorter and a post-relevance sorter to be set.  Not sorting
by relevance at all would be done by:

    enquire.set_weighting_scheme(Xapian::BoolWeight());

The current set_sort_by_* methods could then be implemented in terms of
this new API.

Cheers,
    Olly
(Continue reading)

Jean-Francois Dockes | 25 Sep 2010 11:06

xapian-config --libs should list -luuid -lz ?


On Linux (tested on Fedora, Xapian 1.2.3), "xapian-config --libs" just
lists -lxapian. On FreeBSD it also lists -lz and -luuid. Shouldn't the
latter be part of the output on Linux too ?

jf
Olly Betts | 25 Sep 2010 13:37
Favicon
Gravatar

Re: xapian-config --libs should list -luuid -lz ?

On Sat, Sep 25, 2010 at 11:06:56AM +0200, Jean-Francois Dockes wrote:
> On Linux (tested on Fedora, Xapian 1.2.3), "xapian-config --libs" just
> lists -lxapian. On FreeBSD it also lists -lz and -luuid. Shouldn't the
> latter be part of the output on Linux too ?

No.

On Linux, if a shared library depends on other shared libraries, then
these are recorded in the dynamic section, and automatically pulled in
by the dynamic loader.  You can check these like so:

readelf -d /usr/lib/libxapian.so|grep NEEDED

So there's no need to specify these libraries again when linking the
application (unless the application independently uses them, in which
case you ought to).

And in fact it's a bad explicitly link the application with these
libraries, as it means that an ABI bump for one of them would require
the application to be rebuilt, rather than just libxapian.so.  If you
maintain a Linux distro with binary packages then that would greatly
increase the work which a library ABI bump causes.

It is possible FreeBSD also pulls in dependent libraries automatically
(and/or maybe some other platforms do too), but I'm not familiar enough
with them to know, so currently this is only done on Linux.

If anyone knows of other platforms which don't need to link dependent
libraries explicitly, then do let me know.  The simplest way to check is
to only link with -lxapian (not -lz or -luuid) and see if you can create
(Continue reading)

Jean-Francois Dockes | 25 Sep 2010 14:00

Re: xapian-config --libs should list -luuid -lz ?

Olly Betts writes:
 > On Sat, Sep 25, 2010 at 11:06:56AM +0200, Jean-Francois Dockes wrote:
 > > On Linux (tested on Fedora, Xapian 1.2.3), "xapian-config --libs" just
 > > lists -lxapian. On FreeBSD it also lists -lz and -luuid. Shouldn't the
 > > latter be part of the output on Linux too ?
 > 
 > No.
 > 
 > On Linux, if a shared library depends on other shared libraries, then
 > these are recorded in the dynamic section, and automatically pulled in
 > by the dynamic loader.  You can check these like so:
 > 
 > readelf -d /usr/lib/libxapian.so|grep NEEDED
 > 
 > So there's no need to specify these libraries again when linking the
 > application (unless the application independently uses them, in which
 > case you ought to).
 > 
 > [skip]

Ok, but this doesn't work with static links. We'd need something like
"xapian-config --static-libs" or some other kind of (possibly already
existing) workaround then ?

Cheers,

jf
Olly Betts | 25 Sep 2010 14:11
Favicon
Gravatar

Re: xapian-config --libs should list -luuid -lz ?

On Sat, Sep 25, 2010 at 02:00:03PM +0200, Jean-Francois Dockes wrote:
> Ok, but this doesn't work with static links. We'd need something like
> "xapian-config --static-libs" or some other kind of (possibly already
> existing) workaround then ?

The convention is an additional "--static" argument for this case, but
xapian-config doesn't currently support this.

Cheers,
    Olly
Olly Betts | 26 Sep 2010 13:43
Favicon
Gravatar

Re: xapian-config --libs should list -luuid -lz ?

On Sat, Sep 25, 2010 at 01:11:43PM +0100, Olly Betts wrote:
> On Sat, Sep 25, 2010 at 02:00:03PM +0200, Jean-Francois Dockes wrote:
> > Ok, but this doesn't work with static links. We'd need something like
> > "xapian-config --static-libs" or some other kind of (possibly already
> > existing) workaround then ?
> 
> The convention is an additional "--static" argument for this case, but
> xapian-config doesn't currently support this.

OK, I've added support for --static (trunk r15002).

Cheers,
    Olly
Jean-Francois Dockes | 26 Sep 2010 16:06

Re: xapian-config --libs should list -luuid -lz ?

Olly Betts writes:
 > On Sat, Sep 25, 2010 at 01:11:43PM +0100, Olly Betts wrote:
 > > On Sat, Sep 25, 2010 at 02:00:03PM +0200, Jean-Francois Dockes wrote:
 > > > Ok, but this doesn't work with static links. We'd need something like
 > > > "xapian-config --static-libs" or some other kind of (possibly already
 > > > existing) workaround then ?
 > > 
 > > The convention is an additional "--static" argument for this case, but
 > > xapian-config doesn't currently support this.
 > 
 > OK, I've added support for --static (trunk r15002).

Thanks a lot, I'll fix the recoll static build to use this.

Cheers,

jf

Gmane