secretflow / yacl

YACL (Yet Another Common crypto library) is a C++ library that contains cryptography, network and io modules which other SecretFlow code depends on.
https://www.secretflow.org.cn/en/docs/yacl/main/
Apache License 2.0
76 stars 63 forks source link

macos m1 编译yacl报错 #57

Closed DeShuiYu closed 1 year ago

DeShuiYu commented 1 year ago

分支

main

macos

macos Ventura 13.2

clang -v

Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

clang++ -v

Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

gcc -v

Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

g++ -v

Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

bazel info

Starting local Bazel server and connecting to it...
bazel-bin: /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/execroot/yacl/bazel-out/darwin_arm64-fastbuild/bin
bazel-genfiles: /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/execroot/yacl/bazel-out/darwin_arm64-fastbuild/bin
bazel-testlogs: /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/execroot/yacl/bazel-out/darwin_arm64-fastbuild/testlogs
character-encoding: file.encoding = ISO-8859-1, defaultCharset = ISO-8859-1
command_log: /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/command.log
committed-heap-size: 322MB
execution_root: /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/execroot/yacl
gc-count: 6
gc-time: 18ms
install_base: /var/tmp/_bazel_dsy/install/dc2159ad4e237743745cc81e45bf4748
java-home: /private/var/tmp/_bazel_dsy/install/dc2159ad4e237743745cc81e45bf4748/embedded_tools/jdk
java-runtime: OpenJDK Runtime Environment (build 11.0.10+9-LTS) by Azul Systems, Inc.
java-vm: OpenJDK 64-Bit Server VM (build 11.0.10+9-LTS, mixed mode) by Azul Systems, Inc.
max-heap-size: 4294MB
output_base: /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c
output_path: /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/execroot/yacl/bazel-out
package_path: %workspace%
**release: release 5.4.1**
repository_cache: /var/tmp/_bazel_dsy/cache/repos/v1
server_log: /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/java.log.macbook-pro.dsy.log.java.20230424-232120.88617
server_pid: 88617
used-heap-size: 55MB
workspace: /Users/dsy/Desktop/yacl

编译命令

 bazel build //... -c opt

报错日志

DEBUG: Rule 'org_interconnection' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1669271462 +0800"
DEBUG: Repository org_interconnection instantiated at:
  /Users/dsy/Desktop/yacl/WORKSPACE:19:10: in <toplevel>
  /Users/dsy/Desktop/yacl/bazel/repositories.bzl:59:10: in yacl_deps
  /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
Repository rule git_repository defined at:
  /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in <toplevel>
ERROR: /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/external/com_github_brpc_brpc/BUILD.bazel:228:13: in objc_library rule @com_github_brpc_brpc//:macos_lib: Expected action_config for 'objc++-compile' to be configured
ERROR: /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/external/com_github_brpc_brpc/BUILD.bazel:228:13: in objc_library rule @com_github_brpc_brpc//:macos_lib: 
Traceback (most recent call last):
        File "/virtual_builtins_bzl/common/objc/objc_library.bzl", line 127, column 124, in _objc_library_impl
        File "/virtual_builtins_bzl/common/objc/compilation_support.bzl", line 316, column 50, in _register_compile_and_archive_actions
        File "/virtual_builtins_bzl/common/objc/compilation_support.bzl", line 422, column 74, in _cc_compile_and_link
        File "/virtual_builtins_bzl/common/objc/compilation_support.bzl", line 193, column 29, in _compile
Error in compile: Expected action_config for 'objc++-compile' to be configured
ERROR: /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/external/com_github_brpc_brpc/BUILD.bazel:228:13: Analysis of target '@com_github_brpc_brpc//:macos_lib' failed
INFO: Repository remote_java_tools instantiated at:
  /DEFAULT.WORKSPACE.SUFFIX:392:6: in <toplevel>
  /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
Repository rule http_archive defined at:
  /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/external/bazel_tools/tools/build_defs/repo/http.bzl:355:31: in <toplevel>
INFO: Repository 'remote_java_tools' used the following cache hits instead of downloading the corresponding file.
 * Hash '2eede49b2d80135e0ea22180f63df26db2ed4b795c1c041b25cc653d6019fbec' for https://mirror.bazel.build/bazel_java_tools/releases/java/v11.7.1/java_tools-v11.7.1.zip
If the definition of 'remote_java_tools' was updated, verify that the hashes were also updated.
INFO: Repository com_github_dltcollab_sse2neon instantiated at:
  /Users/dsy/Desktop/yacl/WORKSPACE:19:10: in <toplevel>
  /Users/dsy/Desktop/yacl/bazel/repositories.bzl:39:35: in yacl_deps
  /Users/dsy/Desktop/yacl/bazel/repositories.bzl:321:10: in _com_github_dltcollab_sse2neon
  /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
Repository rule http_archive defined at:
  /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/external/bazel_tools/tools/build_defs/repo/http.bzl:355:31: in <toplevel>
INFO: Repository remotejdk11_macos_aarch64 instantiated at:
  /DEFAULT.WORKSPACE.SUFFIX:123:6: in <toplevel>
  /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
  /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/external/bazel_tools/tools/jdk/remote_java_repository.bzl:48:17: in remote_java_repository
Repository rule http_archive defined at:
  /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db19c/external/bazel_tools/tools/build_defs/repo/http.bzl:355:31: in <toplevel>
ERROR: Analysis of target '//yacl/link/transport:channel_brpc_test' failed; build aborted: 
INFO: Elapsed time: 9.120s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (109 packages loaded, 9059 targets configured)
    Fetching ...est_ot; Cloning f40a33a37e3ff8cd81655c35237c177e358dc5b1 of https://github.co\
m/secretflow/simplest-ot.git 7s
    Fetching ..._tools; Extracting /private/var/tmp/_bazel_dsy/4f9993a0cd77836fcc6fa6eaf86db1\
9c/external/remote_java_tools/temp241924901069986556/java_tools-v11.7.1.zip
    Fetching https://mirror.bazel.build/.../zulu11.50.19-ca-jdk11.0.12-macosx_aarch64.tar.gz
anakinxc commented 1 year ago

Hi @DeShuiYu

xcode 版本是多少呀

DeShuiYu commented 1 year ago

Hi @DeShuiYu

xcode 版本是多少呀

没有安装xcode.app 但是有xcode-select ,没有xcode.app是否有影响

anakinxc commented 1 year ago
objc++-compile

bazel 在没有 xcode app 的情况下会有一些奇奇怪怪的行为,推荐还是安装完整的 xcode app 安装完记得 bazel clean --expunge 一下

DeShuiYu commented 1 year ago
objc++-compile

bazel 在没有 xcode app 的情况下会有一些奇奇怪怪的行为,推荐还是安装完整的 xcode app 安装完记得 bazel clean --expunge 一下

编译成功了~,谢谢