Archiv verlassen und diese Seite im Standarddesign anzeigen : [Unix/Perl] Bibliotheken werden nicht gefunden
ArmerIrrer
23.03.2006, 17:45
Hi Leute,
ich bin in der linux welt noch nicht so bewandert und habe ein problem. ich teste gerade eine art DataWare House Tool unter Linux. Es besteht aus einem Server und einem client teil. der Server läuft, den client bekomme ich nicht installiert, da er einige bibliotheken nicht findet. Ich habe Debian (über internet installiert) und die pakete die er benötigte über apt-get installiert. Um zu überprüfen ob alle module etc drauf sind ist bei dem tool ein perl script namens checkenv.pl dabei. diese schickt mir immer die folgende ausgabe:
--------------------------------------------------------------------------------
| module | ver | min | max | stat |
--------------------------------------------------------------------------------
| Apache2 | ? | ? | ? | ? |
| Apache::compat | ? | ? | ? | ? |
| CGI | 3.15 | 3.00 | 3.06 | new |
| Carp | 1.04 | 1.01 | ? | OK |
| Digest::MD5 | 2.36 | 2.33 | ? | OK |
| GD | ? | 2.12 | ? | ? |
| GD::Graph | ? | 1.43 | ? | ? |
| GD::Graph3d | ? | 0.63 | ? | ? |
| GD::Graph::Map | ? | 1.05 1.05 | ? |
| GD::Polyline | ? | 0.1 | ? | ? |
| GD::Text | ? | 0.86 | ? | ? |
| HTML::HTMLDoc | ? | 0.07 | ? | ? |
| OpenOffice::OODoc | ? | 1.111| ? | ? |
| SOAP::Lite | 0.67 | 0.55 | 0.60 | new |
| Storable | 2.15 | ? | ? | ? |
| VRML | ? | 1.06 | ? | ? |
| XML::Simple | 2.14 | 2.09 | ? | OK |
--------------------------------------------------------------------------------
für mich heißt das die fehlenden pakete module etc müssen noch installiert werden. gesagt - getan (wie gesagt apt-get), die anzeige änderte sich trotzdem nicht. Bin mir recht sicher daß ich alles nötige drauf habe, auf jedenfall aber apache2...
Warum findet er das alles nicht, und wie kann ich das ändern? muss ich irgendwelche pfade setzen oder sowas?
Du könntest mit ldd überprüfen, von welchen Libraries die Client-Applikation abhängt.
Zum Beispiel sind die Aphängigkeiten vom Emacs folgende...
martin@debian:~$ ldd /usr/bin/emacs
libXaw3d.so.6 => /usr/X11R6/lib/libXaw3d.so.6 (0x40018000)
libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x40063000)
libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x4007a000)
# ...
libdl.so.2 => /lib/tls/libdl.so.2 (0x40425000)
martin@debian:~$
Vlt. sind aber auch alle Bibliotheken installiert, aber die Bindings nicht initialisiert. Also womöglich ldconfig ausführen - die man-Pages geben weitere Informationen.
Hast du das Programm eigentlich aus einem Debian-Paket installiert? Nenn ggf. mal die genau bezeichnung.
Anderenfalls gehe ich davon aus, das man einige Umgebungsvariablen abändern muss. Gibt es keine Dokumentation oder gar Manualpages zu dem Programm?
ArmerIrrer
24.03.2006, 09:49
Moin
ldd hat schon mal nicht funktioniert, der client ist eine web application und besteht nur aus cgi's, da sagte er mir immer so was:
/usr/bin/ldd: line 161: /lib64/ld-linux-x86-64.so.2: cannot execute binary file
not a dynamic executable
ldconfig hat leider auch nicht funktioniert, das heißt er hats schon gemacht, allerdings ohne erfolg...
Das Programm heisst bee und ist ein SorceForge Projekt, daher nicht mit einem Debian packet installiert. Das ganze ist eine tschechische firma, daher ist das englisch manchmal etwas fehlerhaft, eigentlich aber ganz gut. Hier mal die Homepage des Projektes: http://bee.insightstrategy.cz/en/index.html
Manuals sind zwar vorhanden, allerdings beinhalten diese hauptsächlich installations anweisungen dieser art: entpacken sie die datei xy nach /usr/....., führen sie /.../checkenv.pl aus und installieren sie die fehlenden pakete. Ändern sie folgende pfade wie folgt: etc. Auf ev. probleme wie ich sie habe ist dort nicht eingegangen.
Ich hatte auch schon probleme mit der installation des servers, da dort in einigen konfigurationsdateien falsche pfade angegeben waren und ähnliches. Vermute daher fehler dieser art auch hier...
Jan Krüger
24.03.2006, 15:44
Hi,
es geht hier wahrscheinlich nicht um Pakete im allgemeinen Sinn, sondern um Perl-Module. Die Debian-Pakete dafür folgen dem folgenden Namensschema:
libapache2-perl
libgd-text-perl
usw.
butterkeks
24.03.2006, 19:06
Generell kann man für die Installation von Perlmodulen aus dem CPAN auch die CPAN Shell benutzen:
http://www.perl.com/doc/manual/html/lib/CPAN.html
Dort kriegt man mehr, als bei den repositories diverser Distributionen.
Wenn es immer noch nicht klappt, wäre vlt. ein relevanter Schnipsel vom Perl Script nützlich (um zu sehen, wie Pakete gesucht werden)
Jan Krüger
25.03.2006, 00:12
Dort kriegt man mehr, als bei den repositories diverser Distributionen.
Dafür klappt das mit den automatischen Updates und der Deinstallation bei den Distributorpaketen deutlich besser.
ArmerIrrer
27.03.2006, 12:20
Sorry, ich konnte über das we nicht wirklich weiterarbeiten, aber immerhin habe ich heute noch ein paar module installiert bekommen. trotzdem fehlt immernoch der Apache2, und apache compat. da ich der meinung war apache ist drauf habe ich einfach mal apache2::compat mir von cpan gezogen und wollte es installieren, aber auch er findet apsx nicht... wie auch immer ich habe mal das skript was bei dem tool, das ich eigentlich installieren möchte, dabei ist angegeben. Es nennt sich checkenv.pl und versucht zu checken ob alle nötigen module installiert sind:
use strict;
use warnings;
use Getopt::Std;
use Data:: Dumper;
my $Dir;
my $verbose;
my $dump;
BEGIN {
unshift @INC, ($0 =~ m,^(.*)/[^/]+$,)[0] . '/../lib';
($main::VERSION) = ('$Revision: 2.0 $'=~/((\d+\.)+\d+)/); # don't edit, string will be set by CVS automatically
$main::COPYRIGHT = '(C) 2002 Insight Strategy, a. s.';
($main::TAG)=('$Name: $'=~/Name:\s*(.*)\s*\$/); # don't edit, string will be set by CVS automatically
$main::TAG =~ y/_/./ if $main::TAG; # change CVS name in form v2_1 to v2.1
$main::TAG =~ s/rc/ RC/ if $main::TAG; # change CVS name in form v2_1rc2 to v2.1 RC1
$main::TAGVERSION = ($main::TAG ? "$main::TAG, rev. ($main::VERSION)" : "rev. $main::VERSION");
sub main::HELP_MESSAGE {
print <<END;
$main::COPYRIGHT
Usage:
$0 [--help] [--version] [-v] [-d] [-r project_root_dir]
For more details run:
perldoc -F $0
END
}
sub main::VERSION_MESSAGE {
print "Bear Client Shell $main::TAGVERSION\n";
}
$Getopt::Std::STANDARD_HELP_VERSION = 1;
my %opts;
if ( !getopts("dvr:", \%opts) || @ARGV!=0 ) {
wa &main::HELP_MESSAGE;
exit(1);
}
if ($opts{r}) {
if (-d $opts{r} && -r _ && -x _) {
($Dir = $opts{r}) =~ s,/\s*$,,;
} else {
print("can't acces '$opts{r}' directory\n");
&main::HELP_MESSAGE;
exit(1);
}
}
$verbose = $opts{v};
$dump = $opts{d};
}wa # End of the BEGIN section
use Checkenv;
my $m = new Checkenv($Dir);
printf "Perl version required v%s, actual v%s (%s) ... %s\n", $m->RequiredPerlVer() || '???', $], $m->PerlVer(), !$m->RequiredPerlVer() || $m->RequiredPerlVer() <= $] ? 'OK' : 'OLD';
#printf "%s\n", join("\n", @INC);
my $lib = $m->GetRequiredModules(); # hash containing all used libraries
if ($dump) {
print Dumper($lib);
exit if not $verbose;
}
my $tw = 80;
printf "%s\n", '-'x$tw;
printf "| %30s | %10s | %10s | %10s | %4s |\n", 'module', 'ver', 'min', 'max', 'stat';
printf "%s\n", '-'x$tw;
#printf "| %30s | %10s | %10s | %10s | %4s |\n", 'perl', $], $m->RequiredPerlVer(), '', $m->RequiredPerlVer() >= $] ? 'OK' : 'old';
foreach my $pm (sort keys %{$lib}) {
my $ver = $lib->{$pm}->{actual} if exists $lib->{$pm}->{actual};
my $min = $lib->{$pm}->{min} if exists $lib->{$pm}->{min};
my $max = $lib->{$pm}->{max} if exists $lib->{$pm}->{max};
my $ok;
if ($ver) {
if ($min && $max) {
$ok = 'OK' if $max >= $ver && $min <= $ver;
$ok = 'old' if $min > $ver;
$ok = 'new' if $max < $ver;
} elsif ($max) {
$ok = $max >= $ver ? 'OK' : 'new';
} elsif ($min) {
$ok = $min <= $ver ? 'OK' : 'old';
} else {
$ok = '?';
}
} else {
$ok = '?';
}
printf "| %-30s | %10s | %10s | %10s | %4s |\n", $pm, $ver || '?', $min || '?', $max || '?', $ok;
if ($verbose) {
foreach (map {$_->{name}} @{$lib->{$pm}->{file}}) {
printf "| %30s | %10s | %10s | %10s | %4s |\n", $_, '', '', '', '';
}
}
}
printf "%s\n", '-'x$tw;
#----------------------------------------------------------
__END__
=head1 NAME
checkenv.pl - The Bear Instalation Environment checker
=head1 DESCRIPTION
Interactive BEE instalation environment checker.
=head1 SYNOPSIS
B<checkenv.pl> [--help] [--version] [-v] [-r project_root_dir]
=head1 OPTIONS
B<-v> Verbose output; list will include names of the files where 'use' of the module is located.
B<-d> Dump output and exits (verbose list will be shown if -v parameter is set as well)
B<-r> I<project_root_dir>
Specify the root directory of the file (I<*.[p[lm]>) scan.
B<--help>
Print a one-line help message and exit.
B<--version>
Print a version message and exit.
=head1 SEE ALSO
perldoc lib/Checkenv.pm
=head1 COPYRIGHT
I<Copyright (C) 2005 Insight Strategy, a. s.> All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the I<GNU General Public License> version 2 as published
by the Free Software Foundation.
This program can be distributed or placed on a volume of a storage or
distribution medium together with files and/or programs covered by different
Licenses or distributed under different specific conditions. Only files with
reference to I<GNU General Public License> are covered by this kind of the
License. In addition, this program can use third party plug-ins or can make use
of meta-data files covered by specific different (possibly commercial)
Licenses. Please read their own copyright notices and license conditions
for your reference.
This program is distributed in the hope that it will be useful,
but B<WITHOUT ANY WARRANTY>; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
I<GNU General Public License> in F<./COPYING> file for more details.
=cut
habs einfach mal komplett reingestellt (ohne kommentar). ich steige leider noch nicht komplett durch, vielleicht sagt euch das ja schon mehr?
butterkeks
27.03.2006, 22:40
Der interessante Code befindet sich, wie es aussieht, in einem Modul namens "Checkenv", das sich aber in einer anderen .pm oder .pl Datei befinden muss...
ArmerIrrer
28.03.2006, 12:48
OK, ich hab die Checkenv.pm gefunden. Z.T. ist sie sogar zu verstehen, allerdings fehlt mir doch etwas linuxwissen. Ich hoffe ihr kommt besser zurecht...
Hier ist sie:
use strict;
use warnings;
package Checkenv;
our ($VERSION) = ('$Revision: 2.0 $'=~/((\d+\.)+\d+)/); # don't edit, string will be set by CVS automatically
my $copyright = '(C) Insight Strategy, a. s., 2004';
sub new {
my $class = shift;
my $dir = shift || '.'; # root directory of file scanning
my $self = {};
_scan_dir($self, $dir);
_remove_pm($self);
_set_min_max($self);
delete $self->{pm};
bless ($self, $class);
return $self;
}
sub _scan_dir {
my $self = shift;
my $dir = shift;
foreach my $name (glob("$dir/*")) {
if (-d $name) {
_scan_dir($self, $name);
} elsif ($name=~/\.p[lm]$|\.cgi$/) {
_scan_file($self, $name);
}
}
}
sub _remove_pm { # remove all local modules
my $self = shift;
foreach my $pm (keys %{$self->{pm}}) {
delete $self->{LIB}->{$pm} if exists $self->{LIB}->{$pm};
}
}
sub _set_min_max { # set min and max module version on module level
my $self = shift;
foreach my $pm (keys %{$self->{LIB}}) {
foreach my $f (@{$self->{LIB}->{$pm}->{file}}) {
$self->{LIB}->{$pm}->{min} = $f->{min} if exists $f->{min} && (exists $self->{LIB}->{$pm}->{min} && $self->{LIB}->{$pm}->{min} < $f->{min} || !exists $self->{LIB}->{$pm}->{min});
$self->{LIB}->{$pm}->{max} = $f->{max} if exists $f->{max} && (exists $self->{LIB}->{$pm}->{max} && $self->{LIB}->{$pm}->{max} > $f->{max} || !exists $self->{LIB}->{$pm}->{max});
}
$self->{LIB}->{$pm}->{actual} = ModuleVer(undef, $pm);
}
}
sub _scan_file {
my $self = shift;
my $fn = shift;
# following section is needed because there are lib/Bearlib/*.pm files containing code in the Bearlib namespace
if ($fn=~/(\w+).pm$/) { # prepare hash of module names
$self->{pm}->{$1}=undef;
}
if ($fn=~/(\w+)\/(\w+).pm$/) { # prepare hash of module names, !!! should be rewritten as recursive function
$self->{pm}->{$1.'::'.$2}=undef;
}
# end of section
open F, $fn;
my $comment;
foreach my $line (<F>) {
next if $comment;
if ($comment && $line=~/^=cut/) { # end of the block comment
$comment=0;
next;
} elsif ($line=~/^=\w+/) { # start of the block comment
$comment=1;
next;
}
$line =~ s/^\s*#\s*use\s/use /o; # we recognize commented out 'use' line as regular one
if ($line=~/^\s*use\s+([\d\.]+).*;/) {
$self->{PERL_V} = $1 if !$self->{PERL_V} || $self->{PERL_V}<$1;
} elsif ($line =~ /^\s*use\s+([\w:]+)\b.*#\s*part\s+of[^#]*$/) {
# we will ommit modules marked as part of another
$self->{pm}{$1}=undef unless exists $self->{pm}{$1};
next;
} elsif ($line =~ /^\s*use\s+([\w:]+)\b\s*(\d+\.?\d*)?.*;/) {
next if $1 =~ /^(warnings|strict|lib|utf8|vars|POSIX)$/o;
next if exists $self->{pm}{$1};
my $module = $1;
my $f;
$f->{name} = $fn;
$f->{min} = $2 if $2;
if ($line =~ /#\s*(\d+\.?\d*)?\s*<?\s*(\d+\.?\d*)?/) {
$f->{recommended} = $1 if $1;
$f->{max} = $2 if $2;
}
$f->{note} = $1 if $line =~ /#.*?#\s*(.*)$/;
push @{$self->{LIB}->{$module}->{file}}, $f;
} elsif ($line=~/^\s*package\s+(\d+\.?\d*).*;/) {
$self->{pm}->{$1} = undef;
}
}
close F;
}
sub GetRequiredModules { # returns hash containing status of the required modules
my $self = shift;
return $self->{LIB};
}
sub RequiredPerlVer { # returns reguired perl version in form eg. 5.008005
my $self = shift;
return $self->{PERL_V};
}
sub PerlVer { # returns perl version in form eg. 5.8.5
my $self = shift;
my $perlver;
if (defined $^V) {
$perlver = $^V; # New in Perl 5.6.1, one byte per part
$perlver = ord(substr($perlver,0)).'.'.ord(substr($perlver,1)).'.'.ord(substr($perlver,2));
} else {
if ( $] =~ /(\d)\.(\d{3})(\d{3})/) {
$perlver = $1.'.'.$2*1.0.'.'.$3*1.0;
}
}
return $perlver;
}
sub ModuleVer { # returns version of module
my $self = shift;
my $mod = shift;
return eval "use ${mod}; \$${mod}::VERSION";
}
1
__END__
=head1 NAME
Checkenv.pm - The Bear Instalation Environment checker module
=head1 SYNOPSIS
use Checkenv;
my $m = new Checkenv('.');
printf "Perl version required v%s, actual v%s (%s) ... %s\n",
$m->RequiredPerlVer(),
$],
$m->PerlVer(),
$m->RequiredPerlVer() >= $] ? 'OK' : 'OLD';
my $lib = $m->GetRequiredModules();
foreach my $pm (sort keys %{$lib}) {
printf "| %-30s | %10s | %10s | %10s |\n",
$pm,
$lib->{$pm}->{actual} || '?',
$lib->{$pm}->{min} || '?',
$lib->{$pm}->{max} || '?';
}
=head1 DESCRIPTION
This module provides information of required version of necessary modules.
It scans all *.p[lm] files under specific root directory (actual or specified
one by the constructor's parameter and collects all modules used. All modules defined under
specific directory will be omitted.
There is standard perl syntax used for minimal required module version specification.
Additionally one can specified maximal and recommended module version and
arbitrary note as well in form:
use module min_version; # recommended_version # note
See example:
use SOAP::Lite 0.55; # 0.60 # NEED PATCH
# use URI 1.27; # # prerequisite for SOAP
use GD::Text 0.86; # # GDTextUtil
use Graph 0.20101; # 0.20106 < 0.20107
use GD::Graph::mixed; # part of GD::Graph
Commented 'use' line can be presented for reference of transitional dependency only.
There are two optional field in the comment part of the line (separated by '#'):
recommended version and note. Section of the recommended version can contain
maximal permissible version in form '< max_version' optionally. 'use' lines containing
comment "# part of ..." are be omitted.
=head1 COPYRIGHT
I<Copyright (C) 2005 Insight Strategy, a. s.> All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the I<GNU General Public License> version 2 as published
by the Free Software Foundation.
This program can be distributed or placed on a volume of a storage or
distribution medium together with files and/or programs covered by different
Licenses or distributed under different specific conditions. Only files with
reference to I<GNU General Public License> are covered by this kind of the
License. In addition, this program can use third party plug-ins or can make use
of meta-data files covered by specific different (possibly commercial)
Licenses. Please read their own copyright notices and license conditions
for your reference.
This program is distributed in the hope that it will be useful,
but B<WITHOUT ANY WARRANTY>; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
I<GNU General Public License> in F<./COPYING> file for more details.
=cut
ArmerIrrer
07.04.2006, 12:52
Falls sich noch irgendwer mit diesem script beschäftigen sollte (ich hoffe nicht) dann Vielen dank und viel erfolg, aber es ist inzwischen umsonst, das programm woraus es stammt ist echt fürn arsch, jedenfalls im bezug auf den leistungsanspruch den es selber erhebt, und Cheffe hat das projekt abgeblasen, bzw auf eis gelegt. Also danke für die Ratschläge etc.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.