小编Ale*_*s99的帖子

无法在 Cargo.toml 中设置 rustflags target-cpu=native (SIMD-JSON)

我正在尝试编译 Rust simd-json 包。它抱怨该盒子不兼容 SIMD:

    |
221 | fn please_compile_with_a_simd_compatible_cpu_setting_read_the_simdjsonrs_readme() -> ! {}
    |    ----------------------------------------------------------------------------      ^ expected `!`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
Run Code Online (Sandbox Code Playgroud)

然而,盒子是x86按照要求的:

    |
221 | fn please_compile_with_a_simd_compatible_cpu_setting_read_the_simdjsonrs_readme() -> ! {}
    |    ----------------------------------------------------------------------------      ^ expected `!`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
Run Code Online (Sandbox Code Playgroud)

Cargo.toml包含所需的编译器标志:

$ uname -a
Linux ip-172-31-68-220 5.15.0-1011-aws #14-Ubuntu SMP Wed …
Run Code Online (Sandbox Code Playgroud)

simd rust rust-cargo

2
推荐指数
1
解决办法
3938
查看次数

标签 统计

rust ×1

rust-cargo ×1

simd ×1