build-tpcds-tools.sh 报multiple definition,请问如何解决?

Viewed 100

搭了个doris集群,想先做个tpc-ds测试,编译测试工具是报错,错误信息如下:

gcc -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DYYDEBUG  -DLINUX -g -Wall  -o dsdgen s_brand.o s_customer_address.o s_call_center.o s_catalog.o s_catalog_order.o s_catalog_order_lineitem.o s_catalog_page.o s_catalog_promotional_item.o s_catalog_returns.o s_category.o s_class.o s_company.o s_customer.o s_division.o s_inventory.o s_item.o s_manager.o s_manufacturer.o s_market.o s_pline.o s_product.o s_promotion.o s_purchase.o s_reason.o s_store.o s_store_promotional_item.o s_store_returns.o s_subcategory.o s_subclass.o s_warehouse.o s_web_order.o s_web_order_lineitem.o s_web_page.o s_web_promotinal_item.o s_web_returns.o s_web_site.o s_zip_to_gmt.o w_call_center.o w_catalog_page.o w_catalog_returns.o w_catalog_sales.o w_customer_address.o w_customer.o w_customer_demographics.o w_datetbl.o w_household_demographics.o w_income_band.o w_inventory.o w_item.o w_promotion.o w_reason.o w_ship_mode.o w_store.o w_store_returns.o w_store_sales.o w_timetbl.o w_warehouse.o w_web_page.o w_web_returns.o w_web_sales.o w_web_site.o dbgen_version.o address.o build_support.o date.o decimal.o dist.o driver.o error_msg.o genrand.o join.o list.o load.o misc.o nulls.o parallel.o permute.o pricing.o print.o r_params.o StringBuffer.o tdef_functions.o tdefs.o text.o scd.o scaling.o release.o sparse.o validate.o -lm
/usr/bin/ld: s_purchase.o:/opt/src/apache-doris-2.0.11-src/tools/tpcds-tools/bin/DSGen-software-code-3.2.0rc1/tools/s_purchase.c:55: multiple definition of `nItemIndex'; s_catalog_order.o:/opt/src/apache-doris-2.0.11-src/tools/tpcds-tools/bin/DSGen-software-code-3.2.0rc1/tools/s_catalog_order.c:56: first defined here
/usr/bin/ld: s_web_order.o:/opt/src/apache-doris-2.0.11-src/tools/tpcds-tools/bin/DSGen-software-code-3.2.0rc1/tools/s_web_order.c:56: multiple definition of `nItemIndex'; s_catalog_order.o:/opt/src/apache-doris-2.0.11-src/tools/tpcds-tools/bin/DSGen-software-code-3.2.0rc1/tools/s_catalog_order.c:56: first defined here
/usr/bin/ld: s_web_order_lineitem.o:/opt/src/apache-doris-2.0.11-src/tools/tpcds-tools/bin/DSGen-software-code-3.2.0rc1/tools/s_web_order_lineitem.c:54: multiple definition of `g_s_web_order_lineitem'; s_web_order.o:/opt/src/apache-doris-2.0.11-src/tools/tpcds-tools/bin/DSGen-software-code-3.2.0rc1/tools/s_web_order.c:54: first defined here
/usr/bin/ld: w_catalog_page.o:/opt/src/apache-doris-2.0.11-src/tools/tpcds-tools/bin/DSGen-software-code-3.2.0rc1/tools/w_catalog_page.c:52: multiple definition of `g_w_catalog_page'; s_catalog_page.o:/opt/src/apache-doris-2.0.11-src/tools/tpcds-tools/bin/DSGen-software-code-3.2.0rc1/tools/s_catalog_page.c:51: first defined here
/usr/bin/ld: w_warehouse.o:/opt/src/apache-doris-2.0.11-src/tools/tpcds-tools/bin/DSGen-software-code-3.2.0rc1/tools/w_warehouse.c:53: multiple definition of `g_w_warehouse'; s_warehouse.o:/opt/src/apache-doris-2.0.11-src/tools/tpcds-tools/bin/DSGen-software-code-3.2.0rc1/tools/s_warehouse.c:51: first defined here
/usr/bin/ld: w_web_site.o:/opt/src/apache-doris-2.0.11-src/tools/tpcds-tools/bin/DSGen-software-code-3.2.0rc1/tools/w_web_site.c:59: multiple definition of `g_w_web_site'; s_web_site.o:/opt/src/apache-doris-2.0.11-src/tools/tpcds-tools/bin/DSGen-software-code-3.2.0rc1/tools/s_web_site.c:51: first defined here
collect2: error: ld returned 1 exit status
make: *** [makefile:233:dsdgen] 错误 1

环境信息如下

fanlf@fanlf-H3C-X7-030s-0274:/opt/src/apache-doris-2.0.11-src/tools/tpcds-tools$ uname -a
Linux fanlf-H3C-X7-030s-0274 5.15.0-48-generic #54-Ubuntu SMP Fri Aug 26 13:26:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
fanlf@fanlf-H3C-X7-030s-0274:/opt/src/apache-doris-2.0.11-src/tools/tpcds-tools$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04) 
fanlf@fanlf-H3C-X7-030s-0274:/opt/src/apache-doris-2.0.11-src/tools/tpcds-tools$ make --version
GNU Make 4.3
为 x86_64-pc-linux-gnu 编译
Copyright (C) 1988-2020 Free Software Foundation, Inc.
许可证:GPLv3+:GNU 通用公共许可证第 3 版或更新版本<http://gnu.org/licenses/gpl.html>。
本软件是自由软件:您可以自由修改和重新发布它。
在法律允许的范围内没有其他保证。
fanlf@fanlf-H3C-X7-030s-0274:/opt/src/apache-doris-2.0.11-src/tools/tpcds-tools$ lsbrelease
找不到命令 “lsbrelease”,您的意思是:
  “lsb_release” 命令来自 Debian 软件包 lsb-release (11.1.0ubuntu4)
尝试 sudo apt install <deb name>
fanlf@fanlf-H3C-X7-030s-0274:/opt/src/apache-doris-2.0.11-src/tools/tpcds-tools$ cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

3 Answers
  • 这个是doris代码库中的build-tpcds-tools.sh吗?拉的doris代码库是什么版本?

  • 确认一下路径中存在的压缩包是“tools/tpcds-tools/TPC-DS_Tools_v3.2.0new.zip”,还是“tools/tpcds-tools/TPC-DS_Tools_v3.2.0.zip

如果是后者,说明用了过于陈旧的压缩包,这个包只能用于非常古老的编译器版本,你的环境编译器过新,我们已经提供了一个更新的脚本,不过你也可以很方便的手动更改:

tools/tpcds-tools/bin/DSGen-software-code-3.2.0rc1/tools/makefile
这个文件的BASE_CFLAGS 增加一条 -fcommon,然后clean了重新make即可。

【问题状态】已记录
【问题处理】内部定位中,有进展会更新回帖

感谢您的回复!
2.0.11中的build-tpcds-tools.sh为:wget "https://doris-build-1308700295.cos.ap-beijing.myqcloud.com/tools/TPC-DS_Tools_v3.2.0.zip",估计就是这个原因。