Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 在arm设备上进行编译时遇到问题 #214

Open
sMiaoPaSi opened this issue Dec 4, 2024 · 10 comments
Open

[Bug]: 在arm设备上进行编译时遇到问题 #214

sMiaoPaSi opened this issue Dec 4, 2024 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@sMiaoPaSi
Copy link

Describe the bug

在arm架构的嵌入式设备里,编译psi
bazel build //psi:main -c opt
指令遇到问题
在构建过程中,psi/proto/kuscia.pb.cc 文件中引用了一些标准的头文件(如 stddef.h、stdarg.h 等),但是这些头文件在构建过程中没有正确声明其依赖关系,导致编译失败。

Steps To Reproduce

设备环境如下
系统信息:
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal
硬件配置:
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s): 3
Vendor ID: ARM
Model: 0
Model name: Cortex-A55
Stepping: r2p0
CPU max MHz: 2304.0000
CPU min MHz: 408.0000
BogoMIPS: 48.00
L1d cache: 256 KiB
L1i cache: 256 KiB
L2 cache: 1 MiB
L3 cache: 3 MiB
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled v
ia prctl
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atom
ics fphp asimdhp cpuid asimdrdm lrcpc dcpop asi
mddp
内存信息:
total used free shared buff/cache available
Mem: 15Gi 1.3Gi 7.5Gi 30Mi 6.4Gi 13Gi
Swap: 0B 0B 0B

在运行指令:
bazel build //psi:main -c opt 时,遇到如下问题:

root@jh3588:/secretFlow/psi# bazel build //psi:main -c opt
INFO: Analyzed target //psi:main (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /root/secretFlow/psi/psi/proto/BUILD.bazel:68:14: Compiling psi/proto/kuscia.pb.cc failed: undeclared inclusion(s) in rule '//psi/proto:kuscia_proto':
this rule is missing dependency declarations for the following files included by 'psi/proto/kuscia.pb.cc':
'/usr/lib/gcc/aarch64-linux-gnu/10/include/stddef.h'
'/usr/lib/gcc/aarch64-linux-gnu/10/include/stdarg.h'
'/usr/lib/gcc/aarch64-linux-gnu/10/include/stdint.h'
'/usr/lib/gcc/aarch64-linux-gnu/10/include/limits.h'
'/usr/lib/gcc/aarch64-linux-gnu/10/include/syslimits.h'
ERROR: /root/.cache/bazel/_bazel_root/e507dab6215eb9c2343c9703f01cea92/external/com_google_double_conversion/BUILD.bazel:24:6: Error while validating output TreeArtifact File:[[<execution_root>]bazel-out/aarch64-opt/bin]external/com_google_double_conversion/copy_double-conversion/double-conversion : java.lang.InterruptedException
Target //psi:main failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 22.317s, Critical Path: 20.60s
INFO: 10 processes: 8 internal, 2 linux-sandbox.
FAILED: Build did NOT complete successfully
root@jh3588:
/secretFlow/psi#

Expected behavior

希望能和在x86系统一样,将我们psi库成功编译部署运行

Version

暂不清楚

Operating system

Ubuntu 20.04.6 LTS

Hardware Resources

8c16g

@sMiaoPaSi sMiaoPaSi added the bug Something isn't working label Dec 4, 2024
@6fj 6fj assigned huocun-ant and unassigned 6fj Dec 4, 2024
@BrainWH
Copy link

BrainWH commented Dec 4, 2024

可以提供一下当前的psi版本信息,上面的报错信息划掉了,也可以贴一下

@sMiaoPaSi
Copy link
Author

psi版本是直接git clone的版本
报错如下:
root@jh3588:~/secretFlow/psi# bazel build //psi:main -c opt
INFO: Analyzed target //psi:main (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /root/secretFlow/psi/psi/proto/BUILD.bazel:68:14: Compiling psi/proto/kuscia.pb.cc failed: undeclared inclusion(s) in rule '//psi/proto:kuscia_proto':
this rule is missing dependency declarations for the following files included by 'psi/proto/kuscia.pb.cc':
'/usr/lib/gcc/aarch64-linux-gnu/10/include/stddef.h'
'/usr/lib/gcc/aarch64-linux-gnu/10/include/stdarg.h'
'/usr/lib/gcc/aarch64-linux-gnu/10/include/stdint.h'
'/usr/lib/gcc/aarch64-linux-gnu/10/include/limits.h'
'/usr/lib/gcc/aarch64-linux-gnu/10/include/syslimits.h'
ERROR: /root/.cache/bazel/_bazel_root/e507dab6215eb9c2343c9703f01cea92/external/com_google_double_conversion/BUILD.bazel:24:6: Error while validating output TreeArtifact File:[[<execution_root>]bazel-out/aarch64-opt/bin]external/com_google_double_conversion/copy_double-conversion/double-conversion : java.lang.InterruptedException
Target //psi:main failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 22.317s, Critical Path: 20.60s
INFO: 10 processes: 8 internal, 2 linux-sandbox.
FAILED: Build did NOT complete successfully

@wangzul
Copy link

wangzul commented Dec 4, 2024

编译使用的gcc版本可以提供一下。

@sMiaoPaSi
Copy link
Author

root@jh3588:/secretFlow/psi# gcc --version
gcc (Ubuntu 10.5.0-1ubuntu1
20.04) 10.5.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@sMiaoPaSi
Copy link
Author

gcc版本是10.5.0,bazel6.5.0

@BrainWH
Copy link

BrainWH commented Dec 4, 2024

可以先升级gcc的版本,相关依赖的具体的版本信息参照:https://github.com/secretflow/devtools/blob/main/dockerfiles/ubuntu-base-ci.DockerFile

@sMiaoPaSi
Copy link
Author

已经将设备的gcc 、g++版本升级为11.4.0,
但是编译之后仍然失败

root@jh3588:/secretFlow/psi# bazel build //psi:main -c opt
Starting local Bazel server and connecting to it...
INFO: Analyzed target //psi:main (229 packages loaded, 26106 targets configured).
INFO: Found 1 target...
ERROR: /root/.cache/bazel/_bazel_root/e507dab6215eb9c2343c9703f01cea92/external/zlib/BUILD.bazel:19:11: Compiling inffast.c failed: undeclared inclusion(s) in rule '@zlib//:zlib':
this rule is missing dependency declarations for the following files included by 'inffast.c':
'/usr/lib/gcc/aarch64-linux-gnu/11/include/stddef.h'
'/usr/lib/gcc/aarch64-linux-gnu/11/include/limits.h'
'/usr/lib/gcc/aarch64-linux-gnu/11/include/syslimits.h'
'/usr/lib/gcc/aarch64-linux-gnu/11/include/stdarg.h'
ERROR: /root/.cache/bazel/_bazel_root/e507dab6215eb9c2343c9703f01cea92/external/zlib/BUILD.bazel:19:11: Compiling inftrees.c failed: undeclared inclusion(s) in rule '@zlib//:zlib':
this rule is missing dependency declarations for the following files included by 'inftrees.c':
'/usr/lib/gcc/aarch64-linux-gnu/11/include/stddef.h'
'/usr/lib/gcc/aarch64-linux-gnu/11/include/limits.h'
'/usr/lib/gcc/aarch64-linux-gnu/11/include/syslimits.h'
'/usr/lib/gcc/aarch64-linux-gnu/11/include/stdarg.h'
Target //psi:main failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 19.154s, Critical Path: 0.68s
INFO: 14 processes: 10 internal, 4 linux-sandbox.
FAILED: Build did NOT complete successfully
root@jh3588:
/secretFlow/psi# gcc -version

@sMiaoPaSi
Copy link
Author

微信图片_20241205104352

@sMiaoPaSi
Copy link
Author

root@jh3588:~/secretFlow/psi# bazel build //psi:main -c opt
Starting local Bazel server and connecting to it...
INFO: Analyzed target //psi:main (229 packages loaded, 26106 targets configured).
INFO: Found 1 target...
ERROR: /root/.cache/bazel/_bazel_root/e507dab6215eb9c2343c9703f01cea92/external/zlib/BUILD.bazel:19:11: Compiling inffast.c failed: undeclared inclusion(s) in rule '@zlib//:zlib':
this rule is missing dependency declarations for the following files included by 'inffast.c':
'/usr/lib/gcc/aarch64-linux-gnu/11/include/stddef.h'
'/usr/lib/gcc/aarch64-linux-gnu/11/include/limits.h'
'/usr/lib/gcc/aarch64-linux-gnu/11/include/syslimits.h'
'/usr/lib/gcc/aarch64-linux-gnu/11/include/stdarg.h'
ERROR: /root/.cache/bazel/_bazel_root/e507dab6215eb9c2343c9703f01cea92/external/zlib/BUILD.bazel:19:11: Compiling inftrees.c failed: undeclared inclusion(s) in rule '@zlib//:zlib':
this rule is missing dependency declarations for the following files included by 'inftrees.c':
'/usr/lib/gcc/aarch64-linux-gnu/11/include/stddef.h'
'/usr/lib/gcc/aarch64-linux-gnu/11/include/limits.h'
'/usr/lib/gcc/aarch64-linux-gnu/11/include/syslimits.h'
'/usr/lib/gcc/aarch64-linux-gnu/11/include/stdarg.h'
Target //psi:main failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 19.154s, Critical Path: 0.68s
INFO: 14 processes: 10 internal, 4 linux-sandbox.
FAILED: Build did NOT complete successfully

@BrainWH
Copy link

BrainWH commented Dec 5, 2024

检查编译的环境:Install gcc>=11.2, cmake>=3.26, ninja, nasm>=2.15, python>=3.9, bazelisk, xxd, lld

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants