已开启
修复编译numactl报错找不到libatomic库的问题 #312
修复编译numactl报错找不到libatomic库的问题 #312
已开启
MengMengDeXiaoJi创建于 2025年5月7日
MengMengDeXiaoJi
MengMengDeXiaoJi
2025年5月7日

编译numactl时会出现找不到符号的报错信息

编译流程

cd dependency/numactl python3 build.py -m all -t "comm|llt" -f numactl-2.0.14.tar.gz >>../build/build_result.log

会出现以下报错

------------------------------numactl---------------------------------------------------- clearcache.c: In function ‘clearcache’: clearcache.c:74:2: warning: #warning "Consider adding a clearcache implementation for your architecture" [-Wcpp] 74 | #warning "Consider adding a clearcache implementation for your architecture" | ^~~~~~~ /usr/bin/ld: ./.libs/libnuma.so: undefined reference to__atomic_fetch_and_1' /usr/bin/ld: ./.libs/libnuma.so: undefined reference to __atomic_fetch_and_1' collect2: error: ld returned 1 exit status collect2: error: ld returned 1 exit status /usr/bin/ld: ./.libs/libnuma.so: undefined reference to __atomic_fetch_and_1'
make[1]: *** [Makefile:895: migratepages] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:903: numactl] Error 1
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:899: migspeed] Error 1
/usr/bin/ld: ./.libs/libnuma.so: undefined reference to __atomic_fetch_and_1' collect2: error: ld returned 1 exit status make[1]: *** [Makefile:907: numademo] Error 1 make: *** [Makefile:740: all] Error 2 Traceback (most recent call last): File "/root/rpmbuild/SOURCES/openGauss-third_party/dependency/numactl/build.py", line 276, in <module> Operator.build_mode() File "/root/rpmbuild/SOURCES/openGauss-third_party/dependency/numactl/build.py", line 71, in build_mode

分析原因

链接过程中并没有去显示的链接libatomic的动态库,故而会找不到__atomic_fetch_and_1的定义

解决办法

在python编译脚本中的configure命令中加入参数 LIBS='-latomic'

likedislike
合并受阻
opengauss_botopengauss_bot成员
2025年5月7日 添加了label:sig/Community
opengauss_bot
opengauss_bot成员
2025年5月7日 评论:

Welcome To openGauss Community

Hey @MengMengDeXiaoJi , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.

Contact Guide

If you have any questions, please contact the SIG: Community ,
and any of the committers: @hwworkholic, @superlchf, @totaj, @CarrotGo, @congzhou2603, @dodders, @muyulinzhong, @chenxiaobin19, @ywzq1161327784, @shenzheng4, @jemappellehc, @quemingjian, @chendong76 .

likedislike
opengauss_botopengauss_bot成员
2025年5月7日 添加了label:opengauss-cla/yes
opengauss_bot
opengauss_bot成员
2025年5月7日 评论:

CLA Signature Pass

@MengMengDeXiaoJi, thanks for your pull request. All authors of the commits have signed the CLA. 👋

likedislike
opengauss_botopengauss_bot成员
2025年5月7日 添加了label:needs-issue
opengauss_bot
opengauss_bot成员
2025年5月7日 评论:

Notice

@MengMengDeXiaoJi , PullRequest must be associated with at least one issue.

likedislike
MengMengDeXiaoJiMengMengDeXiaoJi
2025年5月7日 关闭了 pull request
MengMengDeXiaoJiMengMengDeXiaoJi
2025年5月8日 重新打开了 pull request
MengMengDeXiaoJiMengMengDeXiaoJi
2025年5月8日 关联了issue:[新需求]: 修复编译numactl报错找不到libatomic库的问题
opengauss_botopengauss_bot成员
2025年5月8日 删除了label:needs-issue
opengauss_botopengauss_bot成员
2025年7月31日 删除了label:sig/Community
opengauss_botopengauss_bot成员
2025年7月31日 添加了label:sig/StorageEngine