2

我想使用PSPP-Perl-Module,但它似乎比预期的要困难得多。我可以使用任何版本的模块,但是因为似乎必须在每个 mashine 上构建它(如果我错了,请纠正我的错误)我选择 Ubuntu LTS 版本:

pspp-0.7.9+git20120319 是 Ubuntu LTS 12.04 中的 PSPP 版本。

第一次尝试:CPAN 安装

   cpan PSPP:Sysfile

将构建一个相当旧的版本

   CPAN.pm: Going to build P/PD/PDONELAN/PSPP-Perl-0.7.2.20090730.tar.gz

并要求提供我目前没有的已配置源目录。

   Enter the location of the build directory of the configured pspp source: []

第二次尝试:apt-get source -b

cd ~
apt-get build-dep pspp
apt-get source -b pspp

将0.7.9+git20120319的源码下载到当前目录并构建。构建似乎工作了很长一段时间,但在测试阶段以错误结束:

...
| configure:43806: $? = 0
| configure:43806: gcc -std=gnu99 -c -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Wdeclaration-after-statement -D_FORTIFY_SOURCE=2 -pthread -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pango-1.0   conftest.c >&5
| conftest.c: In function 'main':
| conftest.c:444:22: error: expected expression before ')' token
| configure:43806: $? = 1
| configure: failed program was:
| | /* confdefs.h */
...
| This file was extended by GNU PSPP config.status 0.7.9, which was
| generated by GNU Autoconf 2.68.  Invocation command line was
| 
|   CONFIG_FILES    = 
|   CONFIG_HEADERS  = 
|   CONFIG_LINKS    = 
|   CONFIG_COMMANDS = 
|   $ ./config.status config.h
| 
| on agnes
| 
| config.status:2635: creating config.h

make[1]: *** [override_dh_auto_test] Fehler 1
make[1]: Verlasse Verzeichnis '/root/pspp-0.7.9+git20120319'
make: *** [build] Fehler 2
dpkg-buildpackage: Fehler: Fehler-Exitstatus von debian/rules build war 2
Build-Befehl »cd pspp-0.7.9+git20120319 && dpkg-buildpackage -b -uc« fehlgeschlagen.
E: Kindprozess fehlgeschlagen

PSPP 用户邮件列表在今年 1 月讨论了构建 Perl 模块的一些问题,我引用:

Basically you are right, you will need to compile PSPP first, but you don't need
to install it.  At a risk of contradicting that sentence, you should follow the 
instructions in the file called INSTALL.  However, to save yourself a bit of
time and from having to install lots of things you won't need, you can pass 
various --without-* flags to configure, thus:

./configure --without-gui --without-cairo --without-libncurses 
make
cd perl-module
make install

因此,在未完成的构建中,我进入了 perl-module 目录

cd pspp-0.7.9+git20120319/perl-module
make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/lib/perl/5.14.2/auto/PSPP/PSPP.so
Installing /usr/lib/perl/5.14.2/auto/PSPP/PSPP.bs
Installing /usr/lib/perl/5.14.2/PSPP.pm
Installing /usr/man/man3/PSPP.3pm
Installing /usr/man/man3/PSPP::Examples.3pm
Appending installation info to /usr/lib/perl/5.14.2/perllocal.pod

长话短说:使用 perl 模块仍然没有成功:

#!/usr/bin/perl
use PSPP;

Can't load '/usr/local/lib/perl/5.14.2/auto/PSPP/PSPP.so' for module PSPP: libpspp-core-0.7.9.so: Kann die Shared-Object-Datei nicht öffnen: Datei oder Verzeichnis nicht gefunden at /usr/share/perl/5.14/XSLoader.pm line 71.
 at /usr/local/lib/perl/5.14.2/PSPP.pm line 26
BEGIN failed--compilation aborted at /usr/local/lib/perl/5.14.2/PSPP.pm line 27.
Compilation failed in require at ./test2.pl line 2.
BEGIN failed--compilation aborted at ./test2.pl line 2.

:-(

有问题的文件PSPP.so存在:

ls /usr/local/lib/perl/5.14.2/auto/PSPP
libpspp-0.7.9.so  libpspp-core-0.7.9.so  libpspp-core.so  libpspp.so  PSPP.bs  PSPP.so

这就是我卡住的地方。非常欢迎任何关于任何方法的提示。我的理解是,CPAN 上传了 PSPP-Module 的旧版本 0.7.2,但 PSPP-Module 实际上是主要 PSPP 源的一部分。为什么 mashine 没有自动安装该模块作为apt-get install pspp的一部分。是吗?我是否太愚蠢而无法找到/使​​用它?

非常感谢,史蒂夫

4

1 回答 1

0

感谢 PSPP 的友好邮件列表上的回答,我找到了解决方案:

ldd /usr/local/lib/perl/5.14.2/auto/PSPP/PSPP.so
        linux-vdso.so.1 =>  (0x00007fffe23d2000)
        libpspp-core-0.7.9.so => not found
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7b66a35000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f7b6702c000)

然后我创建了一个文件

echo '/usr/local/lib/perl/5.14.2/auto/PSPP' > /etc/ld.so.conf.d/pspp.conf
ldconfig

现在看起来更好了!

ldd /usr/local/lib/perl/5.14.2/auto/PSPP/PSPP.so
        linux-vdso.so.1 =>  (0x00007fff1a5ff000)
        libpspp-core-0.7.9.so =>
/usr/local/lib/perl/5.14.2/auto/PSPP/libpspp-core-0.7.9.so
(0x00007f4daf913000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4daf554000)
        libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2
(0x00007f4daf1f8000)
        libpq.so.5 => /usr/lib/libpq.so.5 (0x00007f4daefcb000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f4daedb4000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4daeab7000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f4dafe06000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4dae8b3000)
        libssl.so.0.9.8 => /lib/x86_64-linux-gnu/libssl.so.0.9.8
(0x00007f4dae660000)
        libcrypto.so.0.9.8 => /lib/x86_64-linux-gnu/libcrypto.so.0.9.8
(0x00007f4dae2d2000)
        libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3
(0x00007f4dae004000)
        libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2
(0x00007f4dade00000)
        libgssapi_krb5.so.2 =>
/usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f4dadbc1000)
        libldap_r-2.4.so.2 =>
/usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007f4dad972000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f4dad755000)
        libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3
(0x00007f4dad52c000)
        libkrb5support.so.0 =>
/usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f4dad324000)
        libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1
(0x00007f4dad120000)
        libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2
(0x00007f4dacf03000)
        liblber-2.4.so.2 => /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2
(0x00007f4daccf5000)
        libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2
(0x00007f4dacada000)
        libgssapi.so.3 => /usr/lib/x86_64-linux-gnu/libgssapi.so.3
(0x00007f4dac89b000)
        libgnutls.so.26 => /usr/lib/x86_64-linux-gnu/libgnutls.so.26
(0x00007f4dac5df000)
        libgcrypt.so.11 => /lib/x86_64-linux-gnu/libgcrypt.so.11
(0x00007f4dac361000)
        libheimntlm.so.0 => /usr/lib/x86_64-linux-gnu/libheimntlm.so.0
(0x00007f4dac159000)
        libkrb5.so.26 => /usr/lib/x86_64-linux-gnu/libkrb5.so.26
(0x00007f4dabed3000)
        libasn1.so.8 => /usr/lib/x86_64-linux-gnu/libasn1.so.8
(0x00007f4dabc33000)
        libhcrypto.so.4 => /usr/lib/x86_64-linux-gnu/libhcrypto.so.4
(0x00007f4dab9fe000)
        libroken.so.18 => /usr/lib/x86_64-linux-gnu/libroken.so.18
(0x00007f4dab7e9000)
        libtasn1.so.3 => /usr/lib/x86_64-linux-gnu/libtasn1.so.3
(0x00007f4dab5d8000)
        libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0
(0x00007f4dab3c5000)
        libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0
(0x00007f4dab1c1000)
        libwind.so.0 => /usr/lib/x86_64-linux-gnu/libwind.so.0
(0x00007f4daaf98000)
        libheimbase.so.1 => /usr/lib/x86_64-linux-gnu/libheimbase.so.1
(0x00007f4daad88000)
        libhx509.so.5 => /usr/lib/x86_64-linux-gnu/libhx509.so.5
(0x00007f4daab3e000)
        libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
(0x00007f4daa89b000)
        libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1
(0x00007f4daa661000)

我现在可以运行使用 PSPP 本机库的示例 Perl 代码。

于 2013-04-11T18:57:35.530 回答