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

mac x86_64,build lib25519失败 #452

Open
Yinbenxin opened this issue Dec 18, 2024 · 6 comments
Open

mac x86_64,build lib25519失败 #452

Yinbenxin opened this issue Dec 18, 2024 · 6 comments

Comments

@Yinbenxin
Copy link

1.bazel build //... -c opt。 顺利完成编译

但是:
2.bazel run //yacl/crypto/ecc/lib25519:ed25519_test
(base) apple@ybx yacl % bazel run //yacl/crypto/ecc/lib25519:ed25519_test
INFO: Build option --compilation_mode has changed, discarding analysis cache.
ERROR: Target //yacl/crypto/ecc/lib25519:ed25519_test is incompatible and cannot be built, but was explicitly requested.
Dependency chain:
//yacl/crypto/ecc/lib25519:ed25519_test (a610f2)
//yacl/crypto/ecc/lib25519:lib25519 (ab0e3d)
//yacl/crypto/ecc/lib25519:lib25519_factory (ab0e3d)
//yacl/crypto/ecc/lib25519:ed25519_group (ab0e3d)
//yacl/crypto/ecc/lib25519:lib25519_group (ab0e3d)
@lib25519//:25519 (ab0e3d) <-- target platform (@local_config_platform//:host) didn't satisfy constraint @platforms//os:linux
INFO: Elapsed time: 0.468s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 2241 targets configured)
ERROR: Build failed. Not running target

(base) apple@ybx yacl % gcc -v
Apple clang version 16.0.0 (clang-1600.0.26.4)
Target: x86_64-apple-darwin24.1.0

bazel 6.5.0

@tongke6
Copy link
Collaborator

tongke6 commented Dec 18, 2024

@Yinbenxin 请使用 bazel 7.4.1 版本,或者使用 bazelisk

详情见:https://github.com/secretflow/yacl/blob/main/GETTING_STARTED.md#prerequisites

@Yinbenxin
Copy link
Author

1.切换bazel版本
(base) apple@ybx yacl % bazel --version
ERROR: The project you're trying to build requires Bazel 6.5.0 (specified in /Users/apple/git/github/yacl/.bazelversion), but it wasn't found in /usr/local/Cellar/bazel/7.4.1/libexec/bin.

Bazel binaries for all official releases can be downloaded from here:
https://github.com/bazelbuild/bazel/releases

You can download the required version directly using this command:
(cd "/usr/local/Cellar/bazel/7.4.1/libexec/bin" && curl -fLO https://releases.bazel.build/6.5.0/release/bazel-6.5.0-darwin-x86_64 && chmod +x bazel-6.5.0-darwin-x86_64)
所以还是使用bazel 6.5.0

2.这个错误是lib25519的问题,和bazel版本关系不大吧?

@wangzul
Copy link

wangzul commented Dec 19, 2024

yacl用的那个分支的?

@Yinbenxin
Copy link
Author

tag:0.4.5b4_nightly_20240731

@Yinbenxin
Copy link
Author

我执行所有的测试是通过的,但是
//yacl/crypto/ecc:ecc_test SKIPPED
//yacl/crypto/ecc/lib25519:ed25519_test SKIPPED
//yacl/crypto/experimental/tpre:capsule_test SKIPPED
//yacl/crypto/experimental/tpre:hash_test SKIPPED
//yacl/crypto/experimental/tpre:keys_test SKIPPED
//yacl/crypto/experimental/tpre:tpre_test SKIPPED
//yacl/crypto/experimental/vss:vss_test SKIPPED
//yacl/crypto/pairing:pairing_test SKIPPED
//yacl/crypto/pairing/factory:mcl_factory_test SKIPPED
//yacl:secparam_test PASSED in 1.0s
//yacl/base:buffer_test PASSED in 0.9s
//yacl/base:dynamic_bitset_test PASSED in 1.2s
//yacl/base:exception_test PASSED in 1.1s
//yacl/base:int128_test PASSED in 0.9s
//yacl/crypto:key_utils_test PASSED in 6.9s
//yacl/crypto/ecc/lib25519:ed25519_test 是跳过的,说明这个ed25519_test在我的机器上不能使用?

@wangzul
Copy link

wangzul commented Dec 19, 2024

从代码中可以看到,需要系统=linux x86架构,mac os intel不兼容 可以尝试在docker 容器中尝试或更换测试设备
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
]
https://github.com/secretflow/yacl/blob/0.4.5b4_nightly_20240731/yacl/crypto/ecc/lib25519/BUILD.bazel

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

3 participants