The sound distributed version control system

#9 blake3 v0.3.7 fails to build on darwin (mojave)

Closed on November 22, 2020
o1lo01ol1o on November 6, 2020

Apologies as this may be due to my local rust configuration, but it looks like blake3 fails to build on Mojave. Is the below known to anyone in the rust community?

$ rustc --version
rustc 1.47.0 (18bf6b4f0 2020-10-07)
$ clang --version
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
The following warnings were emitted during compilation:

warning: c/blake3_sse2_x86-64_unix.S:1707:9: error: invalid operand for instruction
warning:         movd xmm3, rax
warning:         ^
warning: c/blake3_sse2_x86-64_unix.S:1920:9: error: invalid operand for instruction
warning:         movd xmm12, rax
warning:         ^

error: failed to run custom build command for `blake3 v0.3.7`

Caused by:
  process didn't exit successfully: `/var/folders/tz/4tpc5bgj0659vk61x1ndfhp40000gn/T/cargo-installZxcSHx/release/build/blake3-48c0321c2bf23bb3/build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-env-changed=CARGO_FEATURE_PURE
  TARGET = Some("x86_64-apple-darwin")
  HOST = Some("x86_64-apple-darwin")
  CC_x86_64-apple-darwin = None
  CC_x86_64_apple_darwin = None
  HOST_CC = None
  CC = None
  CFLAGS_x86_64-apple-darwin = None
  CFLAGS_x86_64_apple_darwin = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2,sse3,ssse3")
  CC_x86_64-apple-darwin = None
  CC_x86_64_apple_darwin = None
  HOST_CC = None
  CC = None
  CFLAGS_x86_64-apple-darwin = None
  CFLAGS_x86_64_apple_darwin = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2,sse3,ssse3")
  cargo:rerun-if-env-changed=CARGO_FEATURE_PREFER_INTRINSICS
  cargo:rerun-if-env-changed=CARGO_FEATURE_PURE
  cargo:rustc-cfg=blake3_sse2_ffi
  cargo:rustc-cfg=blake3_sse41_ffi
  cargo:rustc-cfg=blake3_avx2_ffi
  TARGET = Some("x86_64-apple-darwin")
  OPT_LEVEL = Some("3")
  HOST = Some("x86_64-apple-darwin")
  CC_x86_64-apple-darwin = None
  CC_x86_64_apple_darwin = None
  HOST_CC = None
  CC = None
  CFLAGS_x86_64-apple-darwin = None
  CFLAGS_x86_64_apple_darwin = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2,sse3,ssse3")
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-arch" "x86_64" "-Wall" "-Wextra" "-std=c11" "-o" "/var/folders/tz/4tpc5bgj0659vk61x1ndfhp40000gn/T/cargo-installZxcSHx/release/build/blake3-a7ec806ffd6bb9d8/out/c/blake3_sse2_x86-64_unix.o" "-c" "c/blake3_sse2_x86-64_unix.S"
  cargo:warning=c/blake3_sse2_x86-64_unix.S:1707:9: error: invalid operand for instruction
  cargo:warning=        movd xmm3, rax
  cargo:warning=        ^
  cargo:warning=c/blake3_sse2_x86-64_unix.S:1920:9: error: invalid operand for instruction
  cargo:warning=        movd xmm12, rax
  cargo:warning=        ^
  exit code: 1

  --- stderr


  error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-arch" "x86_64" "-Wall" "-Wextra" "-std=c11" "-o" "/var/folders/tz/4tpc5bgj0659vk61x1ndfhp40000gn/T/cargo-installZxcSHx/release/build/blake3-a7ec806ffd6bb9d8/out/c/blake3_sse2_x86-64_unix.o" "-c" "c/blake3_sse2_x86-64_unix.S" with args "cc" did not execute successfully (status code exit code: 1).


warning: build failed, waiting for other jobs to finish...
error: failed to compile `anu v1.0.0-alpha`, intermediate artifacts can be found at `/var/folders/tz/4tpc5bgj0659vk61x1ndfhp40000gn/T/cargo-installZxcSHx`

Caused by:
  build failed
pmeunier on November 9, 2020

It isn’t known to me. Did you report it to the blake3 folks?

https://github.com/BLAKE3-team/BLAKE3

pmeunier on November 22, 2020

So, the xmm… registers are part of the AVX512 instruction set, which not all CPUs and compilers support. After digging into the closed BLAKE3 issues, I found https://github.com/BLAKE3-team/BLAKE3/issues/79#issuecomment-612591045, indicating that your version of Clang seems to be a bit old.

I found that one way to solve all these version issues on OSX is to use the Nix package manager, which has been reported to compile Pijul just fine, see https://nixos.org/download.html if you want to learn more about this.

pmeunier closed this discussion on November 22, 2020