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

error happens when cargo install b3sum #176

Open
pangpu opened this issue Jun 2, 2021 · 8 comments
Open

error happens when cargo install b3sum #176

pangpu opened this issue Jun 2, 2021 · 8 comments

Comments

@pangpu
Copy link

pangpu commented Jun 2, 2021

Hi , I am trying to install blake3

when executing "cargo install b3sum", an error happens and the log looks:

...
cargo:warning=c/blake3_avx512_x86-64_unix.S:2517: Error: operand type mismatch for `vpxord'
cargo:warning=c/blake3_avx512_x86-64_unix.S:2518: Error: operand type mismatch for `vprord'
cargo:warning=c/blake3_avx512_x86-64_unix.S:2521: Error: operand type mismatch for `vpxord'
cargo:warning=c/blake3_avx512_x86-64_unix.S:2522: Error: operand type mismatch for `vprord'
cargo:warning=c/blake3_avx512_x86-64_unix.S:2524: Error: operand type mismatch for `vpxord'
cargo:warning=c/blake3_avx512_x86-64_unix.S:2525: Error: operand type mismatch for `vprord'


error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-Wall" "-Wextra" "-std=c11" "-mavx512f" "-mavx512vl" "-o" "/tmp/cargo-install5M7wG7/release/build/blake3-40c61925e7999996/out/c/blake3_avx512_x86-64_unix.o" "-c" "c/blake3_avx512_x86-64_unix.S" with args "cc" did not execute successfully (status code exit code: 1).

Seems the compiler tries to use AVX512 feature in the compiling, while my CPU does not support AVX 512 (Intel Xeon E5 2680

@sneves
Copy link
Collaborator

sneves commented Jun 2, 2021

What's the version of your C compiler and/or binutils?

@oconnor663
Copy link
Member

oconnor663 commented Jun 2, 2021

This function in build.rs should be detecting whether your compiler supports AVX-512 flags, and disabling our AVX-512 code if not. If you have time, could you help us figure out what it's doing in your case? I've pushed a branch called avx512_debug which fills that function with debug prints. Could you try building it with some commands like these, and tell us what you see:

git clone https://github.com/BLAKE3-team/BLAKE3
cd BLAKE3/b3sum
git checkout avx512_debug
cargo build

@pangpu
Copy link
Author

pangpu commented Jun 3, 2021

What's the version of your C compiler and/or binutils?

Using gcc version 5.5.0

@pangpu
Copy link
Author

pangpu commented Jun 3, 2021

This function in build.rs should be detecting whether your compiler supports AVX-512 flags, and disabling our AVX-512 code if not. If you have time, could you help us figure out what it's doing in your case? I've pushed a branch called avx512_debug which fills that function with debug prints. Could you try building it with some commands like these, and tell us what you see:

git clone https://github.com/BLAKE3-team/BLAKE3
cd BLAKE3/b3sum
git checkout avx512_debug
cargo build

Thanks I will try it later and report what happens

@pangpu
Copy link
Author

pangpu commented Jun 3, 2021

This function in build.rs should be detecting whether your compiler supports AVX-512 flags, and disabling our AVX-512 code if not. If you have time, could you help us figure out what it's doing in your case? I've pushed a branch called avx512_debug which fills that function with debug prints. Could you try building it with some commands like these, and tell us what you see:

git clone https://github.com/BLAKE3-team/BLAKE3
cd BLAKE3/b3sum
git checkout avx512_debug
cargo build
cargo:warning=c/blake3_avx512_x86-64_unix.S:2522: Error: operand type mismatch for `vprord'
 cargo:warning=c/blake3_avx512_x86-64_unix.S:2524: Error: operand type mismatch for `vpxord'
 cargo:warning=c/blake3_avx512_x86-64_unix.S:2525: Error: operand type mismatch for `vprord'
 exit code: 1

 --- stderr
 [build.rs:88] is_windows_msvc() = false
 [build.rs:95] build.is_flag_supported("-mavx512f") = Ok(
     true,
 )
 [build.rs:96] build.is_flag_supported("-mavx512vl") = Ok(
     true,
 )
 [build.rs:100] support_result = Ok(
     true,
 )
 [build.rs:101] YesAVX512 = YesAVX512


 error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-std=c11" "-mavx512f" "-mavx512vl" "-o" "/home/dell-07/blake3/BLAKE3-avx512_debug/target/debug/build/blake3-9eeb7062f782522d/out/c/blake3_avx512_x86-64_unix.o" "-c" "c/blake3_avx512_x86-64_unix.S" with args "cc" did not execute successfully (status code exit code: 1).

@sneves
Copy link
Collaborator

sneves commented Jun 3, 2021

I'm almost certain that this is caused by an old binutils version. What's the output of as -v /dev/null?

@sneves
Copy link
Collaborator

sneves commented Jun 3, 2021

This is what happens with binutils 2.24, which is from 2013 and (as far as I can tell) is used in Ubuntu 14.04:

$ ./binutils-2.24/gas/as-new --64 blake3_avx512_x86-64_unix.s 2>&1 | tail -3
blake3_avx512_x86-64_unix.S:2522: Error: operand type mismatch for `vprord'
blake3_avx512_x86-64_unix.S:2524: Error: operand type mismatch for `vpxord'
blake3_avx512_x86-64_unix.S:2525: Error: operand type mismatch for `vprord'

Binutils 2.24 happens to be the last version that did not support AVX-512 instructions.

@pangpu
Copy link
Author

pangpu commented Jun 4, 2021

This is what happens with binutils 2.24, which is from 2013 and (as far as I can tell) is used in Ubuntu 14.04:

$ ./binutils-2.24/gas/as-new --64 blake3_avx512_x86-64_unix.s 2>&1 | tail -3
blake3_avx512_x86-64_unix.S:2522: Error: operand type mismatch for `vprord'
blake3_avx512_x86-64_unix.S:2524: Error: operand type mismatch for `vpxord'
blake3_avx512_x86-64_unix.S:2525: Error: operand type mismatch for `vprord'

Binutils 2.24 happens to be the last version that did not support AVX-512 instructions.

Yes, the compiling is done in Ubuntu 14.04. I will update the OS and try later.

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