Skip to main content.
home | support | download

Back to List Archive

Re: [swish-e] error: can't load API.so -> libswish-e.so.2 not found

From: Peter Karman <peter(at)not-real.peknet.com>
Date: Thu Mar 26 2009 - 00:52:31 GMT
Andrew Smith wrote on 3/25/09 4:46 PM:
> Thanks, but unfortunately that didn't work for me either. I did 'setenv
> LD_RUN_PATH /my/path/...' before doing 'perl Makefile.PL', 'make' but
> 'make test' still fails with the same error. Should I be doing this some
> other way? And anyway 'swish-config --libs' is returning exactly the
> directory needed:
> 
> -L/my/path/... -lswish-e -lz -lm
> 
> but I am getting the error anyway. Any other suggestions? Thanks.
> 
> On Wed, Mar 25, 2009 at 5:00 PM, Peter Karman <peter@peknet.com
> <mailto:peter@peknet.com>> wrote:
> 
>     Andrew Smith wrote on 03/25/2009 03:45 PM:
>     > I'm having this same problem:
>     >
>     > http://swish-e.org/archive/2007-05/11491.html
>     >
>     > but I don't have root access to modify ldconfig (/etc/ld.so.conf).
>     I also
>     > just built Swish-e in my local directory. How would I modify
>     ldconfig if I
>     > don't have root access? Isn't there any way to solve this problem when
>     > you're building SWISH::API, e.g. pass the library path when you do
>     'perl
>     > Makefile.PL'? Of course I could just set LD_LIBRARY_PATH in my
>     .cshrc file
>     > but that wouldn't work when I want to use SWISH::API from a Perl
>     CGI script
>     > running as another user on the web server. One solution is to just
>     wrap the
>     > CGI script in a shell script that first modifies LD_LIBRARY_PATH
>     and then
>     > execs the CGI script, but that is ugly and there has to be a
>     better way.
>     > Thanks.
> 
>     set LD_RUN_PATH at build time instead?
> 
>     buildswishe.pl in the svn trunk does that.
> 

I was wrong. buildswishe.pl does this instead, using the LIB, etc args to
Makefile.PL:

sub swish_api
{
    chdir("$swishdir/perl");

    # solaris needs the -R
    # linux, et al, do not
    my $libs =
      $os =~ /sun|sol/i
      ? "-L$installdir/lib -R$installdir/lib -lswish-e -lz"
      : "-L$installdir/lib -lswish-e -lz";

    my @a = (
        "LIBS='$libs'",

        #"LDFLAGS='$ld_opts'",
        #LDFLAGS seems to be ignored by MakeMaker
        # and/or not supported under some versions.

        "CCFLAGS='-I$installdir/include'",
        'LIB=' . $perllib,
        'PREFIX=' . $perllib
            );

    my $arg = join ' ', @a;

    $ENV{SWISHLIBS}   = $libs;
    $ENV{SWISHBINDIR} = "$installdir/bin";

    my $cmd = "$^X Makefile.PL $arg";

    # 2.4.3 and later support non-interactive perllib
    if ($swishdir =~ m/2\.[45]\.[3-9]/)
    {
        $cmd .= " $output";
    }

    print "env SWISHBINDIR set to '$installdir/bin'\n";
    print "configuring with:\n";
    print "$cmd\n";

    nice_exit() if system($cmd);


-- 
Peter Karman  .  http://peknet.com/  .  peter(at)not-real.peknet.com
_______________________________________________
Users mailing list
Users@lists.swish-e.org
http://lists.swish-e.org/listinfo/users
Received on Wed Mar 25 20:52:37 2009