为什么 Perl 的 DBD::DB2 在安装过程中找不到 dbivport.h?

发布于 2024-08-30 12:35:55 字数 1975 浏览 4 评论 0原文

我们正在使用 Perl 实用程序从 DB2 数据库转储数据。我们安装了 DBI 软件包,它也要求 DBD 软件包。

我们没有 root 访问权限,当我们尝试安装 DBD 软件包时,我们收到以下错误:

    ERROR BUILDING DB2.pm
    [lijumathew@intblade03 DBD-DB2-1.78]$ make
    make[1]: Entering directory '/home/lijumathew/lperl/perlsrc/DBD-DB2-1.78/Constants'
    gcc -c  -I"/db2/db2tf1/sqllib/include" -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -m32 -march=i386 -mtune=pentium4   -DVERSION=\"1.78\" -DXS_VERSION=\"1.78\" -fPIC "-I/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE"   Constants.c
    Running Mkbootstrap for DBD::DB2::Constants ()
    chmod 644 Constants.bs
    rm -f ../blib/arch/auto/DBD/DB2/Constants/Constants.so
    gcc  -shared -L/usr/local/lib Constants.o  -o ../blib/arch/auto/DBD/DB2/Constants/Constants.so
    chmod 755 ../blib/arch/auto/DBD/DB2/Constants/Constants.so
    cp Constants.bs ../blib/arch/auto/DBD/DB2/Constants/Constants.bs
    chmod 644 ../blib/arch/auto/DBD/DB2/Constants/Constants.bs
    make[1]: Leaving directory `/home/lijumathew/lperl/perlsrc/DBD-DB2-1.78/Constants'
    gcc -c  -I"/db2/db2tf1/sqllib/include" -I"/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBI" -I"/usr/lib/perl5/5.8.5/i386-linux-thread-multi/auto/DBI" -I"/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI" -I"/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBI"  -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -m32 -march=i386 -mtune=pentium4   -DVERSION=\"1.78\" -DXS_VERSION=\"1.78\" -fPIC "-I/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE"   DB2.c
    In file included from DB2.h:22,
                     from DB2.xs:7:
    dbdimp.h:10:22: dbivport.h: No such file or directory
    make: *** [DB2.o] Error 1

我们如何解决此问题?我们需要root权限来解决这个问题吗?

We are using a Perl utility to dump data from DB2 database. We installed DBI package and it is asking for DBD package also.

We dont have root access and when we try to install DBD package we are getting the following error:

    ERROR BUILDING DB2.pm
    [lijumathew@intblade03 DBD-DB2-1.78]$ make
    make[1]: Entering directory '/home/lijumathew/lperl/perlsrc/DBD-DB2-1.78/Constants'
    gcc -c  -I"/db2/db2tf1/sqllib/include" -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -m32 -march=i386 -mtune=pentium4   -DVERSION=\"1.78\" -DXS_VERSION=\"1.78\" -fPIC "-I/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE"   Constants.c
    Running Mkbootstrap for DBD::DB2::Constants ()
    chmod 644 Constants.bs
    rm -f ../blib/arch/auto/DBD/DB2/Constants/Constants.so
    gcc  -shared -L/usr/local/lib Constants.o  -o ../blib/arch/auto/DBD/DB2/Constants/Constants.so
    chmod 755 ../blib/arch/auto/DBD/DB2/Constants/Constants.so
    cp Constants.bs ../blib/arch/auto/DBD/DB2/Constants/Constants.bs
    chmod 644 ../blib/arch/auto/DBD/DB2/Constants/Constants.bs
    make[1]: Leaving directory `/home/lijumathew/lperl/perlsrc/DBD-DB2-1.78/Constants'
    gcc -c  -I"/db2/db2tf1/sqllib/include" -I"/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBI" -I"/usr/lib/perl5/5.8.5/i386-linux-thread-multi/auto/DBI" -I"/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI" -I"/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBI"  -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -m32 -march=i386 -mtune=pentium4   -DVERSION=\"1.78\" -DXS_VERSION=\"1.78\" -fPIC "-I/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE"   DB2.c
    In file included from DB2.h:22,
                     from DB2.xs:7:
    dbdimp.h:10:22: dbivport.h: No such file or directory
    make: *** [DB2.o] Error 1

How do we fix this? Do we need root access to resolve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

潇烟暮雨 2024-09-06 12:35:55

您遇到问题是因为大多数 Perl 模块(包括 DBD-DB2)都不是为了安装到 DBI 模块之外的不同位置而编写的,如果您尝试以非 root 身份安装,就会发生这种情况。要使其正常工作,您需要在 Makefile 中添加如下行:

DEFINE =  -DDB2_CACHE_FIX  -I${DBI_INCL}

并将 DBI_INCL 设置为包含 DBI 头文件的目录。

You're having a problem because most perl modules, including DBD-DB2, aren't written to be installed to different places than the DBI module, which is what happens if you try to install things as non-root. To get this to work, you need to add a line like this to the Makefile:

DEFINE =  -DDB2_CACHE_FIX  -I${DBI_INCL}

and set DBI_INCL to the directory that has the DBI header files.

静若繁花 2024-09-06 12:35:55

请查看 CPAN 论坛 DBD::DB2 make failed

另外,如果您执行以下操作可以提供帮助you out:

Set the DB2 environment variable

   1. In C Shell setenv DB2_HOME $HOME/sqllib
   2. In Bash Shell export DB2_HOME=$HOME/sqllib

安装模块:

# perl Makefile.PL PREFIX=path
# make
# make test
# make install

但是,如果您可以向我们提供 perl -V 输出、您所在的平台和 DBI 版本,这将有助于回答问题。

Please have a look at CPAN forum for DBD::DB2 make failed

Also, if you do below can help you out:

Set the DB2 environment variable

   1. In C Shell setenv DB2_HOME $HOME/sqllib
   2. In Bash Shell export DB2_HOME=$HOME/sqllib

Install Module:

# perl Makefile.PL PREFIX=path
# make
# make test
# make install

However, it would be helpful to answer the problem if you can provide us with the perl -V output, the platform you are on and DBI version.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文