You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucy.apache.org by Marvin Humphrey <ma...@rectangular.com> on 2013/12/05 02:13:36 UTC

[lucy-dev] @INC complexities now that Clownfish runtime is separate

Greets,

I was talking last night with Kurt about running the indexing benchmarker, and
he pointed out that the documentation is out of date.  The problem is, now
that the Clownfish runtime is built separately from Lucy, there's no directory
from which you can run the script and have it find all the right modules --
even with `perl -Mblib`.  To make things work you need to hack some blib dirs
into @INC, possibly using PERL5LIB.

A nasty little workaround is put some `use lib` directives at the top of
devel/benchmarks/indexers/lucy_indexer.plx which allow it to be run from
within `$REPOS_ROOT/perl/`.  I think that's our only realistic option, right?

Ultimately, this gets solved by having the Clownfish runtime be a prerequisite
you're expected to install.

Marvin Humphrey

Re: [lucy-dev] @INC complexities now that Clownfish runtime is separate

Posted by Nick Wellnhofer <we...@aevum.de>.
On 05/12/2013 02:13, Marvin Humphrey wrote:
> A nasty little workaround is put some `use lib` directives at the top of
> devel/benchmarks/indexers/lucy_indexer.plx which allow it to be run from
> within `$REPOS_ROOT/perl/`.  I think that's our only realistic option, right?

+1

BTW, I also had some trouble with the location of the Reuters corpus 
when running the benchmark. The corpus extraction script must be run in 
'devel/benchmarks' so the corpus will be created there. Then the 
benchmark script is run in 'perl' where it doesn't find the corpus.

Nick


Re: [lucy-dev] @INC complexities now that Clownfish runtime is separate

Posted by Marvin Humphrey <ma...@rectangular.com>.
On Mon, Dec 9, 2013 at 2:39 PM, Kurt Starsinic <ks...@gmail.com> wrote:
> Thanks, that *almost* did it. I just sent a pull request for the last
> little bit.

Thanks!  I've integrated your contribution and merged our branch to master.

Marvin Humphrey

Re: [lucy-dev] @INC complexities now that Clownfish runtime is separate

Posted by Kurt Starsinic <ks...@gmail.com>.
Thanks, that *almost* did it. I just sent a pull request for the last
little bit.

- Kurt


On Thu, Dec 5, 2013 at 11:54 PM, Marvin Humphrey <ma...@rectangular.com>wrote:

> On Thu, Dec 5, 2013 at 9:17 AM, Peter Karman <pe...@peknet.com> wrote:
>
> > I don't know how nasty it is. I usually do something like:
> >
> > use FindBin;
> > use lib "$FindBin::Bin/../lib";
> >
> > in many of my cli scripts, to solve this very problem. Of course, the
> number
> > of ../lib levels depends on the file struct.
>
> Thanks, y'all.  I've implemented Peter's solution and made the Reuters
> extraction script less fussy per Nick's note.
>
> Kurt, if you want to try branch LUCY-261-benchmark-includes, it should work
> for you now.
>
> Marvin Humphrey
>

Re: [lucy-dev] @INC complexities now that Clownfish runtime is separate

Posted by Marvin Humphrey <ma...@rectangular.com>.
On Thu, Dec 5, 2013 at 9:17 AM, Peter Karman <pe...@peknet.com> wrote:

> I don't know how nasty it is. I usually do something like:
>
> use FindBin;
> use lib "$FindBin::Bin/../lib";
>
> in many of my cli scripts, to solve this very problem. Of course, the number
> of ../lib levels depends on the file struct.

Thanks, y'all.  I've implemented Peter's solution and made the Reuters
extraction script less fussy per Nick's note.

Kurt, if you want to try branch LUCY-261-benchmark-includes, it should work
for you now.

Marvin Humphrey

Re: [lucy-dev] @INC complexities now that Clownfish runtime is separate

Posted by Nathan Kurz <na...@verse.com>.
It's not directly applicable to Perl libraries, but since we'll
probably be dealing with the issue in the future for other languages,
I thought I should mention RPATH $ORIGIN in case you are not familiar:
http://www.technovelty.org/linux/exploring-origin.html

It's a slick way of handling dependencies between compiled plugins.  I
recently used it in combination with 'patchelf'
(http://nixos.org/patchelf.html) to solve a dependency issue.  I'd
vaguely known it existed, but hadn't realized that it can be set for
libraries as well as for executables.

--nate

On Thu, Dec 5, 2013 at 9:17 AM, Peter Karman <pe...@peknet.com> wrote:
> On 12/4/13 7:13 PM, Marvin Humphrey wrote:
>
>> A nasty little workaround is put some `use lib` directives at the top of
>> devel/benchmarks/indexers/lucy_indexer.plx which allow it to be run from
>> within `$REPOS_ROOT/perl/`.  I think that's our only realistic option,
>> right?
>
>
> I don't know how nasty it is. I usually do something like:
>
> use FindBin;
> use lib "$FindBin::Bin/../lib";
>
> in many of my cli scripts, to solve this very problem. Of course, the number
> of ../lib levels depends on the file struct.
>
>
> --
> Peter Karman  .  http://peknet.com/  .  peter@peknet.com

Re: [lucy-dev] @INC complexities now that Clownfish runtime is separate

Posted by Peter Karman <pe...@peknet.com>.
On 12/4/13 7:13 PM, Marvin Humphrey wrote:

> A nasty little workaround is put some `use lib` directives at the top of
> devel/benchmarks/indexers/lucy_indexer.plx which allow it to be run from
> within `$REPOS_ROOT/perl/`.  I think that's our only realistic option, right?

I don't know how nasty it is. I usually do something like:

use FindBin;
use lib "$FindBin::Bin/../lib";

in many of my cli scripts, to solve this very problem. Of course, the 
number of ../lib levels depends on the file struct.


-- 
Peter Karman  .  http://peknet.com/  .  peter@peknet.com