无法使用 cpanm 在 Rocky Linux 9.4 上安装/编译 perl 模块 DBD::DB2

问题描述 投票:0回答:1

我正在尝试使用 cpanm commando 在 rocky linux 9.4 上安装/编译 DBD::DB2 perl 模块,但它不起作用。我什至在 RHEL 和 Oracle Linux 上尝试过,但无论如何都不起作用。

我收到以下错误:

    [root@ol9vm-desk01 ~]# cpanm DBD::DB2
    --> Working on DBD::DB2
    Fetching http://www.cpan.org/authors/id/R/RO/ROCKETDB/DBD-DB2-1.89.tar.gz ... OK
    Configuring DBD-DB2-1.89 ... OK
    Building and testing DBD-DB2-1.89 ... FAIL
    ! Installing DBD::DB2 failed. See /root/.cpanm/work/1720158884.3245/build.log for details. Retry with --force to force install it.

到目前为止我做了什么:

1。 Perl 安装:

    [root@ol9vm-desk01 ~]# perl -V
    Summary of my perl5 (revision 5 version 32 subversion 1) configuration:
      Platform:
        osname=linux
        osvers=5.15.0-5.76.5.1.el9uek.x86_64
        archname=x86_64-linux-thread-multi
        uname='linux host-100-100-224-49 5.15.0-5.76.5.1.el9uek.x86_64 #2 smp fri dec 9 18:37:36 pst 2022 x86_64 x86_64 x86_64 gnulinux'
config_args='-des -Doptimize=none -Dccflags=-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Dldflags=-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Dccdlflags=-Wl,--enable-new-dtags -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Dlddlflags=-shared -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Dshrpdir=/usr/lib64 -DDEBUGGING=-g -Dversion=5.32.1 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl5/5.32 -Dsitearch=/usr/local/lib64/perl5/5.32 -Dprivlib=/usr/share/perl5 -Dvendorlib=/usr/share/perl5/vendor_perl -Darchlib=/usr/lib64/perl5 -Dvendorarch=/usr/lib64/perl5/vendor_perl -Darchname=x86_64-linux-thread-multi -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Duseshrplib -Dusethreads -Duseithreads -Dusedtrace=/usr/bin/dtrace -Duselargefiles -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl=n -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto -Ud_endservent_r_proto -Ud_setservent_r_proto -Dscriptdir=/usr/bin -Dusesitecustomize -Duse64bitint'

 @INC:
    /usr/local/lib64/perl5/5.32
    /usr/local/share/perl5/5.32
    /usr/lib64/perl5/vendor_perl
    /usr/share/perl5/vendor_perl
    /usr/lib64/perl5
    /usr/share/perl5

2。 IBM DB2 数据服务器客户端已安装

    tdbcli@ol9vm-desk01 ~]$ db2level
    DB21085I  This instance or install (instance name, where applicable: "tdbcli") 
    uses "64" bits and DB2 code release "SQL11059" with level identifier 
    "060A010F".
    Informational tokens are "DB2 v11.5.9.0", "s2310270807", "DYN2310270807AMD64", 
    and Fix Pack "0".
    Product is installed at "/opt/ibm/db2/V11.5".

3. DBI Perl 模块成功安装作为先决条件:

    instmodsh 
    Available commands are:
       l            - List all installed modules
       m <module>   - Select a module
       q            - Quit the program
    cmd? l
    Installed modules are:
       DBI
       Perl

4。尝试以 root 身份安装 perl 模块 DBD::DB2:

    DB2_HOME=/opt/ibm/db2/V11.5
    export DB2LIB=/opt/ibm/db2/V11.5/lib64

    [root@ol9vm-desk01 ~]# cpanm DBD::DB2
    --> Working on DBD::DB2
    Fetching http://www.cpan.org/authors/id/R/RO/ROCKETDB/DBD-DB2-1.89.tar.gz ... OK
    Configuring DBD-DB2-1.89 ... OK
    Building and testing DBD-DB2-1.89 ... FAIL
    ! Installing DBD::DB2 failed. See /root/.cpanm/work/1720158884.3245/build.log for details. Retry     with --force to force install it.

这里最后部分编译日志报错:

dbdimp.c: In function ‘dbd_st_cancel’:
/usr/local/lib64/perl5/5.32/auto/DBI/DBIXS.h:383:45: warning: unused variable ‘imp_dbh’ [-Wunused-variable]
  383 | #define D_imp_dbh_from_sth D_imp_from_child(imp_dbh, imp_dbh_t, imp_sth)
      |                                             ^~~~~~~
/usr/local/lib64/perl5/5.32/auto/DBI/DBIXS.h:381:39: note: in definition of macro ‘D_imp_from_child’
  381 |                                 type *name = (type*)(DBIc_PARENT_COM(child))
      |                                       ^~~~
dbdimp.c:3000:9: note: in expansion of macro ‘D_imp_dbh_from_sth’
 3000 |         D_imp_dbh_from_sth;
      |         ^~~~~~~~~~~~~~~~~~
dbdimp.c: In function ‘db2_st_finish’:
/usr/local/lib64/perl5/5.32/auto/DBI/DBIXS.h:383:45: warning: unused variable ‘imp_dbh’ [-Wunused-variable]
  383 | #define D_imp_dbh_from_sth D_imp_from_child(imp_dbh, imp_dbh_t, imp_sth)
      |                                             ^~~~~~~
/usr/local/lib64/perl5/5.32/auto/DBI/DBIXS.h:381:39: note: in definition of macro ‘D_imp_from_child’
  381 |                                 type *name = (type*)(DBIc_PARENT_COM(child))
      |                                       ^~~~
dbdimp.c:3019:9: note: in expansion of macro ‘D_imp_dbh_from_sth’
 3019 |         D_imp_dbh_from_sth;
      |         ^~~~~~~~~~~~~~~~~~
dbdimp.c: In function ‘bind_lob_column_helper’:
dbdimp.c:1081:1: warning: control reaches end of non-void function [-Wreturn-type]
 1081 | }
      | ^
dbdimp.c: In function ‘db2_describe’:
dbdimp.c:1318:20: warning: ‘db_codepage’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 1318 |                 if ( app_codepage != db_codepage) {
      |                    ^
dbdimp.c:1318:20: warning: ‘app_codepage’ may be used uninitialized in this function [-Wmaybe-uninitialized]
cc1: some warnings being treated as errors
make: *** [Makefile:351: dbdimp.o] Error 1

此刻我真的很失落...

提前感谢您的帮助

perl db2 rhel cpanm rocky-os
1个回答
0
投票

您的问题表明您也未能在 RHEL 上构建 DBD::DB2,尽管您没有提供详细信息。

此答案显示了 RHEL 8.10 x64 上 DBD::DB2 构建的当前成功状态。

下面的命令序列使用 clidriver 的一次性副本。

注意:您不需要安装任何 Db2 组件来执行此特定构建,尽管相关的头文件和库文件必须存在并通过环境变量进行标识,但这可以通过零安装方法来实现。 但是,如果您do已经安装了相关的Db2组件,那么它必须正确配置,特别是相关的环境变量(见下文)必须在构建之前正确设置。

如果您在 RHEL 上得到不同的结果,请检查您的配置。

perl -v

-- 5.26.3

cpanm DBI

-- 1.643

cd /tmp

curl -O https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz 

export INCLUDE=/tmp/clidriver/include
export LIB=/tmp/clidriver/lib
export DB2_HOME=/tmp/clidriver
export LD_LIBRARY_PATH=/tmp/clidriver/LIB

# cpanm DBD::DB2
--> Working on DBD::DB2
Fetching http://www.cpan.org/authors/id/R/RO/ROCKETDB/DBD-DB2-1.89.tar.gz ... OK
Configuring DBD-DB2-1.89 ... OK
Building and testing DBD-DB2-1.89 ... OK
Successfully installed DBD-DB2-1.89
1 distribution installed
© www.soinside.com 2019 - 2024. All rights reserved.