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

bazel编译失败 #15

Open
reacher1130 opened this issue Aug 21, 2024 · 13 comments
Open

bazel编译失败 #15

reacher1130 opened this issue Aug 21, 2024 · 13 comments
Assignees

Comments

@reacher1130
Copy link

cmake version 3.30.2
gcc version 11.1.0 (GCC)
bazel 6.5.0
在centos7编译
提示:
_____ END BUILD LOGS _____
rules_foreign_cc: Build wrapper script location: bazel-out/k8-opt/bin/external/com_github_openssl_openssl/openssl_foreign_cc/wrapper_build_script.sh
rules_foreign_cc: Build script location: bazel-out/k8-opt/bin/external/com_github_openssl_openssl/openssl_foreign_cc/build_script.sh
rules_foreign_cc: Build log location: bazel-out/k8-opt/bin/external/com_github_openssl_openssl/openssl_foreign_cc/Configure.log

Target //ic_impl:ic_main failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /data/ant-sf/interconnection-impl/ic_impl/BUILD.bazel:19:10 Linking ic_impl/ic_main failed: (Exit 2): bash failed: error executing command (from target @com_github_openssl_openssl//:openssl) /bin/bash -c bazel-out/k8-opt/bin/external/com_github_openssl_openssl/openssl_foreign_cc/wrapper_build_script.sh

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging

@zimu-yuxi
Copy link

请问是在编译interconnection-impl代码时报错的吗?
是否已经需要根据 spu 构建前提在编译环境上安装好依赖库

@reacher1130
Copy link
Author

已经安装好了

@reacher1130
Copy link
Author

还是那个问题,

@zimu-yuxi
Copy link

还是那个问题,

你好,具体解决方式是什么呢

@reacher1130
Copy link
Author

reacher1130 commented Aug 29, 2024

同时,在另一个ubuntu wsl平台上,编译spu是可以正常通过的,但编译interconnection-impl会一直卡在:
(secretflow) root@DESKTOP-UMI6HU8:~/develop/interconnection-impl# bazel build -c opt ic_impl/ic_main
Computing main repo mapping:
Fetching repository @@bazel_skylib; starting 142s

如果清除bazel缓存,重新编译会出现如下情况:
Starting local Bazel server and connecting to it...
DEBUG: /root/.cache/bazel/_bazel_root/b12e4e3f9a14f11e902c5f6f1fe2e080/external/xla/third_party/repo.bzl:132:14:
Warning: skipping import of repository 'llvm-raw' because it already exists.
ERROR: Traceback (most recent call last):
File "/root/.cache/bazel/_bazel_root/b12e4e3f9a14f11e902c5f6f1fe2e080/external/tsl/tools/toolchains/cpus/aarch64/aarch64.bzl", line 312, column 43, in
remote_aarch64_configure = repository_rule(
Error in repository_rule: in call to repository_rule(), parameter 'remotable' is experimental and thus unavailable with the current flags. It may be enabled by setting --experimental_repo_remote_exec
ERROR: Error computing the main repository mapping: at /root/.cache/bazel/_bazel_root/b12e4e3f9a14f11e902c5f6f1fe2e080/external/xla/workspace2.bzl:7:6: at /root/.cache/bazel/_bazel_root/b12e4e3f9a14f11e902c5f6f1fe2e080/external/tsl/workspace2.bzl:36:6: at /root/.cache/bazel/_bazel_root/b12e4e3f9a14f11e902c5f6f1fe2e080/external/tsl/tools/toolchains/cpus/aarch64/aarch64_compiler_configure.bzl:5:6: initialization of module 'tools/toolchains/cpus/aarch64/aarch64.bzl' failed
Computing main repo mapping:
Fetching repository @@io_bazel_rules_closure; starting
Fetching repository @@bazel_skylib; starting
Fetching repository @@llvm-raw; starting

@wangzul
Copy link

wangzul commented Aug 29, 2024

epo mapping:
Fetching repository @@bazel_skylib; starting 142s

你这样尝试一下

  1. 首先进入镜像配置conda
    #配置源
    conda config --append channels conda-forge
    #配置源
    conda config --append channels bioconda
  2. conda create -n spu python=3.10 cmake ninja gcc=11.4 gxx=11.4 perl-ipc-cmd nasm clangxx=15 -y
  3. conda activate spu 激活后应该是这样的(spu) root@DESKTOP-UMI6HU8:

由于环境出现了变化需要先删除缓存bazel clean --expunge。

@reacher1130
Copy link
Author

还是一样的问题

@wangzul
Copy link

wangzul commented Aug 29, 2024

还是一样的问题
在一下编译环境运行pip list 看一下

@wangzul
Copy link

wangzul commented Aug 29, 2024

还是一样的问题
在一下编译环境运行pip list 看一下

尝试安装一下spu后进行编译 pip install spu==0.9.2b0

@shaojian-ant
Copy link
Contributor

shaojian-ant commented Aug 29, 2024

root/.cache/bazel/_bazel_root/b12e4e3f9a14f11e902c5f6f1fe2e080 把这个文件夹删掉再编译试试呢

@reacher1130
Copy link
Author

还是会出现问题,编译该repo的时候现在会提示:
ERROR: /root/.cache/bazel/_bazel_root/b12e4e3f9a14f11e902c5f6f1fe2e080/external/local_cuda/BUILD: no such target '@@local_cuda//:cuda_runtime': target 'cuda_runtime' not declared in package '' defined by /root/.cache/bazel/_bazel_root/b12e4e3f9a14f11e902c5f6f1fe2e080/external/local_cuda/BUILD
ERROR: /root/.cache/bazel/_bazel_root/b12e4e3f9a14f11e902c5f6f1fe2e080/external/rules_cuda/cuda/BUILD.bazel:85:11: every rule of type label_flag implicitly depends upon the target '@@local_cuda//:cuda_runtime', but this target could not be found because of: no such target '@@local_cuda//:cuda_runtime': target 'cuda_runtime' not declared in package '' defined by /root/.cache/bazel/_bazel_root/b12e4e3f9a14f11e902c5f6f1fe2e080/external/local_cuda/BUILD
ERROR: Analysis of target '//ic_impl:ic_main' failed; build aborted: Analysis failed

@shaojian-ant
Copy link
Contributor

shaojian-ant commented Sep 2, 2024

还有其它报错信息吗
也可以在 docker 镜像编译试下: https://github.com/secretflow/spu/blob/main/CONTRIBUTING.md#docker

@wangzul
Copy link

wangzul commented Nov 8, 2024

@reacher1130 有尝试在 https://github.com/secretflow/spu/blob/main/CONTRIBUTING.md#docker 镜像中做过验证吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants