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

Building error in Mac OS Majave #41

Closed
maromato opened this issue Jan 3, 2019 · 10 comments
Closed

Building error in Mac OS Majave #41

maromato opened this issue Jan 3, 2019 · 10 comments

Comments

@maromato
Copy link

maromato commented Jan 3, 2019

No description provided.

@maromato
Copy link
Author

maromato commented Jan 3, 2019

I have a issue to compiling croaring-sys v0.3.7 in MacBook pro (OS Mojave) when I tried to install grin (https://github.com/mimblewimble/grin/blob/master/doc/build.md)

Error massage as below

Compiling grin v0.5.0 (/Users/USERNAME/grin)
Running `/Users/USERNAME/grin/target/debug/build/grin-c26cf48a5

error: failed to run custom build command for croaring-sys v0.3.7
process didn't exit successfully: /Users/USERNAME/grin/target/debug/build/croaring-sys-5cd7dcd423b72406/build-script-build (exit code: 101)

Versions of Clang, llvm, rusct is as below:

clang --version
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin18.2.0
Thread model: posix

llvm-gcc --version
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin18.2.0
Thread model: posix

rustc --version
rustc 1.31.1 (b6c32da9b 2018-12-18)

Does anybody has a good idea to solve this?
Thanks in advance!

@saulius
Copy link
Member

saulius commented Jan 9, 2019

Hi @maromato,

can you please paste the output of the following command:

cargo clean -p croaring-sys && cargo build -p croaring-sys -vv

Thanks!

@bddap
Copy link

bddap commented Jan 9, 2019

The failure seems related to clang/llvm version.

Building with Apple's latest clang fails.
$ cargo --version
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

$ cargo clean -p croaring-sys && cargo build -p croaring-sys -vv 2>&1
       Fresh version_check v0.1.5
       Fresh cc v1.0.28
       Fresh cfg-if v0.1.6
       Fresh ucd-util v0.1.3
       Fresh glob v0.2.11
       Fresh lazy_static v1.2.0
       Fresh unicode-width v0.1.5
       Fresh quick-error v1.2.2
       Fresh utf8-ranges v1.0.2
       Fresh unicode-xid v0.1.0
       Fresh bitflags v1.0.4
       Fresh ansi_term v0.11.0
       Fresh strsim v0.7.0
       Fresh vec_map v0.8.1
       Fresh termcolor v1.0.4
       Fresh peeking_take_while v0.1.2
       Fresh log v0.4.6
       Fresh regex-syntax v0.6.4
       Fresh thread_local v0.3.6
       Fresh textwrap v0.10.0
       Fresh humantime v1.2.0
       Fresh proc-macro2 v0.3.5
       Fresh libc v0.2.46
       Fresh quote v0.5.2
       Fresh memchr v1.0.2
       Fresh atty v0.2.11
       Fresh which v1.0.5
       Fresh memchr v2.1.2
       Fresh libloading v0.5.0
       Fresh nom v3.2.1
       Fresh clap v2.32.0
       Fresh aho-corasick v0.6.9
       Fresh clang-sys v0.23.0
       Fresh cexpr v0.2.3
       Fresh regex v1.1.0
       Fresh env_logger v0.5.13
       Fresh bindgen v0.37.4
   Compiling croaring-sys v0.3.7 (/Users/a/d/croaring-rs/croaring-sys)
     Running `rustc --crate-name build_script_build croaring-sys/build.rs --color never --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=1825600d312edde4 -C extra-filename=-1825600d312edde4 --out-dir /Users/a/d/croaring-rs/target/debug/build/croaring-sys-1825600d312edde4 -C incremental=/Users/a/d/croaring-rs/target/debug/incremental -L dependency=/Users/a/d/croaring-rs/target/debug/deps --extern bindgen=/Users/a/d/croaring-rs/target/debug/deps/libbindgen-93add4b29d12b7ca.rlib --extern cc=/Users/a/d/croaring-rs/target/debug/deps/libcc-cb3cfdae9f23f214.rlib -L native=/Users/a/d/croaring-rs/target/debug/build/libloading-16d07f106662d76a/out`
     Running `/Users/a/d/croaring-rs/target/debug/build/croaring-sys-1825600d312edde4/build-script-build`
[croaring-sys 0.3.7] TARGET = Some("x86_64-apple-darwin")
[croaring-sys 0.3.7] OPT_LEVEL = Some("0")
[croaring-sys 0.3.7] HOST = Some("x86_64-apple-darwin")
[croaring-sys 0.3.7] CC_x86_64-apple-darwin = None
[croaring-sys 0.3.7] CC_x86_64_apple_darwin = None
[croaring-sys 0.3.7] HOST_CC = None
[croaring-sys 0.3.7] CC = None
[croaring-sys 0.3.7] CFLAGS_x86_64-apple-darwin = None
[croaring-sys 0.3.7] CFLAGS_x86_64_apple_darwin = None
[croaring-sys 0.3.7] HOST_CFLAGS = None
[croaring-sys 0.3.7] CFLAGS = None
[croaring-sys 0.3.7] DEBUG = Some("true")
[croaring-sys 0.3.7] running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-std=c11" "-march=native" "-O3" "-o" "/Users/a/d/croaring-rs/target/debug/build/croaring-sys-4f39554f6330599b/out/CRoaring/roaring.o" "-c" "CRoaring/roaring.c"
[croaring-sys 0.3.7] exit code: 0
[croaring-sys 0.3.7] AR_x86_64-apple-darwin = None
[croaring-sys 0.3.7] AR_x86_64_apple_darwin = None
[croaring-sys 0.3.7] HOST_AR = None
[croaring-sys 0.3.7] AR = None
[croaring-sys 0.3.7] running: "ar" "crs" "/Users/a/d/croaring-rs/target/debug/build/croaring-sys-4f39554f6330599b/out/libroaring.a" "/Users/a/d/croaring-rs/target/debug/build/croaring-sys-4f39554f6330599b/out/CRoaring/roaring.o"
[croaring-sys 0.3.7] exit code: 0
[croaring-sys 0.3.7] cargo:rustc-link-lib=static=roaring
[croaring-sys 0.3.7] cargo:rustc-link-search=native=/Users/a/d/croaring-rs/target/debug/build/croaring-sys-4f39554f6330599b/out
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/emmintrin.h:3427:10: error: returning 'int' from a function with incompatible result type '__m128' (vector of 4 'float' values)
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avxintrin.h:2228:10: error: invalid conversion between vector type '__m256' (vector of 8 'float' values) and integer type 'int' of different size
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avxintrin.h:3115:10: error: invalid conversion between vector type '__m256d' (vector of 4 'double' values) and integer type 'int' of different size
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avxintrin.h:3133:10: error: invalid conversion between vector type '__m256' (vector of 8 'float' values) and integer type 'int' of different size
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:971:10: error: invalid conversion between vector type '__m512d' (vector of 8 'double' values) and integer type 'int' of different size
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:982:10: error: invalid conversion between vector type '__m512d' (vector of 8 'double' values) and integer type 'int' of different size
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:992:10: error: invalid conversion between vector type '__m512d' (vector of 8 'double' values) and integer type 'int' of different size
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1021:10: error: invalid conversion between vector type '__m512' (vector of 16 'float' values) and integer type 'int' of different size
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1032:10: error: invalid conversion between vector type '__m512' (vector of 16 'float' values) and integer type 'int' of different size
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1042:10: error: invalid conversion between vector type '__m512' (vector of 16 'float' values) and integer type 'int' of different size
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1126:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1136:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1144:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1154:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1164:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1172:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1182:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1192:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1200:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
[croaring-sys 0.3.7] fatal error: too many errors emitted, stopping now [-ferror-limit=]
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/emmintrin.h:3427:10: error: returning 'int' from a function with incompatible result type '__m128' (vector of 4 'float' values), err: true
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avxintrin.h:2228:10: error: invalid conversion between vector type '__m256' (vector of 8 'float' values) and integer type 'int' of different size, err: true
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avxintrin.h:3115:10: error: invalid conversion between vector type '__m256d' (vector of 4 'double' values) and integer type 'int' of different size, err: true
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avxintrin.h:3133:10: error: invalid conversion between vector type '__m256' (vector of 8 'float' values) and integer type 'int' of different size, err: true
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:971:10: error: invalid conversion between vector type '__m512d' (vector of 8 'double' values) and integer type 'int' of different size, err: true
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:982:10: error: invalid conversion between vector type '__m512d' (vector of 8 'double' values) and integer type 'int' of different size, err: true
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:992:10: error: invalid conversion between vector type '__m512d' (vector of 8 'double' values) and integer type 'int' of different size, err: true
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1021:10: error: invalid conversion between vector type '__m512' (vector of 16 'float' values) and integer type 'int' of different size, err: true
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1032:10: error: invalid conversion between vector type '__m512' (vector of 16 'float' values) and integer type 'int' of different size, err: true
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1042:10: error: invalid conversion between vector type '__m512' (vector of 16 'float' values) and integer type 'int' of different size, err: true
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1126:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size, err: true
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1136:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size, err: true
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1144:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size, err: true
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1154:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size, err: true
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1164:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size, err: true
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1172:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size, err: true
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1182:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size, err: true
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1192:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size, err: true
[croaring-sys 0.3.7] /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1200:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size, err: true
[croaring-sys 0.3.7] fatal error: too many errors emitted, stopping now [-ferror-limit=], err: true
[croaring-sys 0.3.7] thread 'main' panicked at 'Unable to generate bindings: ()', libcore/result.rs:1009:5
[croaring-sys 0.3.7] note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: failed to run custom build command for `croaring-sys v0.3.7 (/Users/a/d/croaring-rs/croaring-sys)`
process didn't exit successfully: `/Users/a/d/croaring-rs/target/debug/build/croaring-sys-1825600d312edde4/build-script-build` (exit code: 101)
--- stdout
TARGET = Some("x86_64-apple-darwin")
OPT_LEVEL = Some("0")
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
DEBUG = Some("true")
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-std=c11" "-march=native" "-O3" "-o" "/Users/a/d/croaring-rs/target/debug/build/croaring-sys-4f39554f6330599b/out/CRoaring/roaring.o" "-c" "CRoaring/roaring.c"
exit code: 0
AR_x86_64-apple-darwin = None
AR_x86_64_apple_darwin = None
HOST_AR = None
AR = None
running: "ar" "crs" "/Users/a/d/croaring-rs/target/debug/build/croaring-sys-4f39554f6330599b/out/libroaring.a" "/Users/a/d/croaring-rs/target/debug/build/croaring-sys-4f39554f6330599b/out/CRoaring/roaring.o"
exit code: 0
cargo:rustc-link-lib=static=roaring
cargo:rustc-link-search=native=/Users/a/d/croaring-rs/target/debug/build/croaring-sys-4f39554f6330599b/out

--- stderr
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/emmintrin.h:3427:10: error: returning 'int' from a function with incompatible result type '__m128' (vector of 4 'float' values)
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avxintrin.h:2228:10: error: invalid conversion between vector type '__m256' (vector of 8 'float' values) and integer type 'int' of different size
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avxintrin.h:3115:10: error: invalid conversion between vector type '__m256d' (vector of 4 'double' values) and integer type 'int' of different size
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avxintrin.h:3133:10: error: invalid conversion between vector type '__m256' (vector of 8 'float' values) and integer type 'int' of different size
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:971:10: error: invalid conversion between vector type '__m512d' (vector of 8 'double' values) and integer type 'int' of different size
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:982:10: error: invalid conversion between vector type '__m512d' (vector of 8 'double' values) and integer type 'int' of different size
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:992:10: error: invalid conversion between vector type '__m512d' (vector of 8 'double' values) and integer type 'int' of different size
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1021:10: error: invalid conversion between vector type '__m512' (vector of 16 'float' values) and integer type 'int' of different size
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1032:10: error: invalid conversion between vector type '__m512' (vector of 16 'float' values) and integer type 'int' of different size
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1042:10: error: invalid conversion between vector type '__m512' (vector of 16 'float' values) and integer type 'int' of different size
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1126:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1136:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1144:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1154:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1164:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1172:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1182:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1192:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1200:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size
fatal error: too many errors emitted, stopping now [-ferror-limit=]
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/emmintrin.h:3427:10: error: returning 'int' from a function with incompatible result type '__m128' (vector of 4 'float' values), err: true
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avxintrin.h:2228:10: error: invalid conversion between vector type '__m256' (vector of 8 'float' values) and integer type 'int' of different size, err: true
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avxintrin.h:3115:10: error: invalid conversion between vector type '__m256d' (vector of 4 'double' values) and integer type 'int' of different size, err: true
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avxintrin.h:3133:10: error: invalid conversion between vector type '__m256' (vector of 8 'float' values) and integer type 'int' of different size, err: true
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:971:10: error: invalid conversion between vector type '__m512d' (vector of 8 'double' values) and integer type 'int' of different size, err: true
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:982:10: error: invalid conversion between vector type '__m512d' (vector of 8 'double' values) and integer type 'int' of different size, err: true
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:992:10: error: invalid conversion between vector type '__m512d' (vector of 8 'double' values) and integer type 'int' of different size, err: true
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1021:10: error: invalid conversion between vector type '__m512' (vector of 16 'float' values) and integer type 'int' of different size, err: true
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1032:10: error: invalid conversion between vector type '__m512' (vector of 16 'float' values) and integer type 'int' of different size, err: true
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1042:10: error: invalid conversion between vector type '__m512' (vector of 16 'float' values) and integer type 'int' of different size, err: true
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1126:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size, err: true
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1136:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size, err: true
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1144:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size, err: true
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1154:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size, err: true
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1164:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size, err: true
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1172:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size, err: true
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1182:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size, err: true
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1192:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size, err: true
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include/avx512fintrin.h:1200:10: error: invalid conversion between vector type '__m512i' (vector of 8 'long long' values) and integer type 'int' of different size, err: true
fatal error: too many errors emitted, stopping now [-ferror-limit=], err: true
thread 'main' panicked at 'Unable to generate bindings: ()', libcore/result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Building with clang version 7.0.1, installed via brew, reports success.
$ clang --version
clang version 7.0.1 (tags/RELEASE_701/final)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin

$ cargo clean -p croaring-sys && cargo build -p croaring-sys -vv
       Fresh version_check v0.1.5
       Fresh cc v1.0.28
       Fresh cfg-if v0.1.6
       Fresh ucd-util v0.1.3
       Fresh lazy_static v1.2.0
       Fresh glob v0.2.11
       Fresh utf8-ranges v1.0.2
       Fresh quick-error v1.2.2
       Fresh unicode-xid v0.1.0
       Fresh unicode-width v0.1.5
       Fresh strsim v0.7.0
       Fresh ansi_term v0.11.0
       Fresh vec_map v0.8.1
       Fresh bitflags v1.0.4
       Fresh termcolor v1.0.4
       Fresh peeking_take_while v0.1.2
       Fresh log v0.4.6
       Fresh regex-syntax v0.6.4
       Fresh thread_local v0.3.6
       Fresh humantime v1.2.0
       Fresh proc-macro2 v0.3.5
       Fresh textwrap v0.10.0
       Fresh libc v0.2.46
       Fresh quote v0.5.2
       Fresh memchr v1.0.2
       Fresh atty v0.2.11
       Fresh which v1.0.5
       Fresh memchr v2.1.2
       Fresh libloading v0.5.0
       Fresh nom v3.2.1
       Fresh clap v2.32.0
       Fresh aho-corasick v0.6.9
       Fresh clang-sys v0.23.0
       Fresh cexpr v0.2.3
       Fresh regex v1.1.0
       Fresh env_logger v0.5.13
       Fresh bindgen v0.37.4
   Compiling croaring-sys v0.3.7 (/Users/a/d/croaring-rs/croaring-sys)
     Running `rustc --crate-name build_script_build croaring-sys/build.rs --color never --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=1825600d312edde4 -C extra-filename=-1825600d312edde4 --out-dir /Users/a/d/croaring-rs/target/debug/build/croaring-sys-1825600d312edde4 -C incremental=/Users/a/d/croaring-rs/target/debug/incremental -L dependency=/Users/a/d/croaring-rs/target/debug/deps --extern bindgen=/Users/a/d/croaring-rs/target/debug/deps/libbindgen-93add4b29d12b7ca.rlib --extern cc=/Users/a/d/croaring-rs/target/debug/deps/libcc-cb3cfdae9f23f214.rlib -L native=/Users/a/d/croaring-rs/target/debug/build/libloading-16d07f106662d76a/out`
     Running `/Users/a/d/croaring-rs/target/debug/build/croaring-sys-1825600d312edde4/build-script-build`
[croaring-sys 0.3.7] TARGET = Some("x86_64-apple-darwin")
[croaring-sys 0.3.7] OPT_LEVEL = Some("0")
[croaring-sys 0.3.7] HOST = Some("x86_64-apple-darwin")
[croaring-sys 0.3.7] CC_x86_64-apple-darwin = None
[croaring-sys 0.3.7] CC_x86_64_apple_darwin = None
[croaring-sys 0.3.7] HOST_CC = None
[croaring-sys 0.3.7] CC = None
[croaring-sys 0.3.7] CFLAGS_x86_64-apple-darwin = None
[croaring-sys 0.3.7] CFLAGS_x86_64_apple_darwin = None
[croaring-sys 0.3.7] HOST_CFLAGS = None
[croaring-sys 0.3.7] CFLAGS = None
[croaring-sys 0.3.7] DEBUG = Some("true")
[croaring-sys 0.3.7] running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-std=c11" "-march=native" "-O3" "-o" "/Users/a/d/croaring-rs/target/debug/build/croaring-sys-4f39554f6330599b/out/CRoaring/roaring.o" "-c" "CRoaring/roaring.c"
[croaring-sys 0.3.7] exit code: 0
[croaring-sys 0.3.7] AR_x86_64-apple-darwin = None
[croaring-sys 0.3.7] AR_x86_64_apple_darwin = None
[croaring-sys 0.3.7] HOST_AR = None
[croaring-sys 0.3.7] AR = None
[croaring-sys 0.3.7] running: "ar" "crs" "/Users/a/d/croaring-rs/target/debug/build/croaring-sys-4f39554f6330599b/out/libroaring.a" "/Users/a/d/croaring-rs/target/debug/build/croaring-sys-4f39554f6330599b/out/CRoaring/roaring.o"
[croaring-sys 0.3.7] exit code: 0
[croaring-sys 0.3.7] cargo:rustc-link-lib=static=roaring
[croaring-sys 0.3.7] cargo:rustc-link-search=native=/Users/a/d/croaring-rs/target/debug/build/croaring-sys-4f39554f6330599b/out
     Running `rustc --crate-name croaring_sys croaring-sys/src/lib.rs --color never --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=1c35a81aa57fb2ee -C extra-filename=-1c35a81aa57fb2ee --out-dir /Users/a/d/croaring-rs/target/debug/deps -C incremental=/Users/a/d/croaring-rs/target/debug/incremental -L dependency=/Users/a/d/croaring-rs/target/debug/deps --extern libc=/Users/a/d/croaring-rs/target/debug/deps/liblibc-2195dd51ed6ad2a0.rlib -L native=/Users/a/d/croaring-rs/target/debug/build/croaring-sys-4f39554f6330599b/out -l static=roaring`
    Finished dev [unoptimized + debuginfo] target(s) in 38.67s

@bddap
Copy link

bddap commented Jan 9, 2019

correction: Don't think Apple's latest clang was the issue. Turns out I had both clang 7.0.0 and 7.0.1 installed via brew. I'm guessing 7.0.0 was being used to compile against headers in clang/10.0.0/include/, which probably doesn't work.

I remedied the issue by running brew uninstall llvm twice to get rid of both 7.0.0 and 7.0.1.

@maromato does that solve the issue for you?

@bddap
Copy link

bddap commented Jan 9, 2019

Related: mimblewimble/grin#2264 (comment)

@maromato
Copy link
Author

@bddap Thanks! I tried do brew uninstall llvm and brew install llvm, but it did not work.

@maromato
Copy link
Author

@saulius

Here's the output! Thanks,

$cargo clean -p croaring-sys && cargo build -p croaring-sys -vv
Fresh version_check v0.1.5
Fresh cfg-if v0.1.6
Fresh cc v1.0.25
Fresh ucd-util v0.1.3
Fresh glob v0.2.11
Fresh lazy_static v1.2.0
Fresh unicode-width v0.1.5
Fresh unicode-xid v0.1.0
Fresh utf8-ranges v1.0.2
Fresh quick-error v1.2.2
Fresh yaml-rust v0.3.5
Fresh termcolor v1.0.4
Fresh ansi_term v0.11.0
Fresh vec_map v0.8.1
Fresh bitflags v1.0.4
Fresh strsim v0.7.0
Fresh peeking_take_while v0.1.2
Fresh regex-syntax v0.6.4
Fresh thread_local v0.3.6
Fresh textwrap v0.10.0
Fresh proc-macro2 v0.3.5
Fresh humantime v1.2.0
Fresh libc v0.2.44
Fresh serde v1.0.81
Fresh quote v0.5.2
Fresh memchr v1.0.2
Fresh atty v0.2.11
Fresh which v1.0.5
Fresh memchr v2.1.1
Fresh log v0.4.6
Fresh libloading v0.5.0
Fresh nom v3.2.1
Fresh clap v2.32.0
Fresh aho-corasick v0.6.9
Fresh clang-sys v0.23.0
Fresh cexpr v0.2.3
Fresh regex v1.1.0
Fresh env_logger v0.5.13
Fresh bindgen v0.37.4
Compiling croaring-sys v0.3.7
Running rustc --crate-name build_script_build /Users/USERNAME/.cargo/registry/src/github.com-1ecc6299db9ec823/croaring-sys-0.3.7/build.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=5cd7dcd423b72406 -C extra-filename=-5cd7dcd423b72406 --out-dir /Users/USERNAME/grin/target/debug/build/croaring-sys-5cd7dcd423b72406 -L dependency=/Users/USERNAME/grin/target/debug/deps --extern bindgen=/Users/USERNAME/grin/target/debug/deps/libbindgen-9be7ef54a33981a2.rlib --extern cc=/Users/USERNAME/grin/target/debug/deps/libcc-9e07da308060b9c5.rlib --cap-lints warn -L native=/Users/USERNAME/grin/target/debug/build/libloading-1e8d9460f69ca752/out
Running /Users/USERNAME/grin/target/debug/build/croaring-sys-5cd7dcd423b72406/build-script-build
[croaring-sys 0.3.7] TARGET = Some("x86_64-apple-darwin")
[croaring-sys 0.3.7] OPT_LEVEL = Some("0")
[croaring-sys 0.3.7] HOST = Some("x86_64-apple-darwin")
[croaring-sys 0.3.7] CC_x86_64-apple-darwin = None
[croaring-sys 0.3.7] CC_x86_64_apple_darwin = None
[croaring-sys 0.3.7] HOST_CC = None
[croaring-sys 0.3.7] CC = None
[croaring-sys 0.3.7] CFLAGS_x86_64-apple-darwin = None
[croaring-sys 0.3.7] CFLAGS_x86_64_apple_darwin = None
[croaring-sys 0.3.7] HOST_CFLAGS = None
[croaring-sys 0.3.7] CFLAGS = None
[croaring-sys 0.3.7] DEBUG = Some("true")
[croaring-sys 0.3.7] running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-std=c11" "-march=native" "-O3" "-o" "/Users/USERNAME/grin/target/debug/build/croaring-sys-f663ee6f0595a963/out/CRoaring/roaring.o" "-c" "CRoaring/roaring.c"
[croaring-sys 0.3.7] exit code: 0
[croaring-sys 0.3.7] AR_x86_64-apple-darwin = None
[croaring-sys 0.3.7] AR_x86_64_apple_darwin = None
[croaring-sys 0.3.7] HOST_AR = None
[croaring-sys 0.3.7] AR = None
[croaring-sys 0.3.7] running: "ar" "crs" "/Users/USERNAME/grin/target/debug/build/croaring-sys-f663ee6f0595a963/out/libroaring.a" "/Users/USERNAME/grin/target/debug/build/croaring-sys-f663ee6f0595a963/out/CRoaring/roaring.o"
[croaring-sys 0.3.7] exit code: 0
[croaring-sys 0.3.7] cargo:rustc-link-lib=static=roaring
[croaring-sys 0.3.7] cargo:rustc-link-search=native=/Users/USERNAME/grin/target/debug/build/croaring-sys-f663ee6f0595a963/out
[croaring-sys 0.3.7] /usr/local/Cellar/llvm/7.0.1/include/c++/v1/stdlib.h:94:15: fatal error: 'stdlib.h' file not found
[croaring-sys 0.3.7] /usr/local/Cellar/llvm/7.0.1/include/c++/v1/stdlib.h:94:15: fatal error: 'stdlib.h' file not found, err: true
[croaring-sys 0.3.7] thread 'main' panicked at 'Unable to generate bindings: ()', libcore/result.rs:1009:5
[croaring-sys 0.3.7] note: Run with RUST_BACKTRACE=1 for a backtrace.
error: failed to run custom build command for croaring-sys v0.3.7
process didn't exit successfully: /Users/USERNAME/grin/target/debug/build/croaring-sys-5cd7dcd423b72406/build-script-build (exit code: 101)
--- stdout
TARGET = Some("x86_64-apple-darwin")
OPT_LEVEL = Some("0")
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
DEBUG = Some("true")
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-std=c11" "-march=native" "-O3" "-o" "/Users/USERNAME/grin/target/debug/build/croaring-sys-f663ee6f0595a963/out/CRoaring/roaring.o" "-c" "CRoaring/roaring.c"
exit code: 0
AR_x86_64-apple-darwin = None
AR_x86_64_apple_darwin = None
HOST_AR = None
AR = None
running: "ar" "crs" "/Users/USERNAME/grin/target/debug/build/croaring-sys-f663ee6f0595a963/out/libroaring.a" "/Users/USERNAME/grin/target/debug/build/croaring-sys-f663ee6f0595a963/out/CRoaring/roaring.o"
exit code: 0
cargo:rustc-link-lib=static=roaring
cargo:rustc-link-search=native=/Users/USERNAME/grin/target/debug/build/croaring-sys-f663ee6f0595a963/out

--- stderr
/usr/local/Cellar/llvm/7.0.1/include/c++/v1/stdlib.h:94:15: fatal error: 'stdlib.h' file not found
/usr/local/Cellar/llvm/7.0.1/include/c++/v1/stdlib.h:94:15: fatal error: 'stdlib.h' file not found, err: true
thread 'main' panicked at 'Unable to generate bindings: ()', libcore/result.rs:1009:5
note: Run with RUST_BACKTRACE=1 for a backtrace.

@JohnsonYi
Copy link

@bddap Thanks! I tried do brew uninstall llvm and brew install llvm, but it did not work.

masOS has a system default llvm(apple version), so do not use brew to install an extra one, just "brew uninstall llvm" to get rid off llvm from homebrew, you can use "brew list -l" for a double check, not re-install.

If you still have the same issue, try "sudo xcode-select --switch /Applications/Xcode.app" to switch clang from command line tools to xcode.app, you will have the newest clang version.

@JohnsonYi
Copy link

The failure seems related to clang/llvm version.

Building with Apple's latest clang fails.
Building with clang version 7.0.1, installed via brew, reports success.

You have to switch the "InstalledDir" of clang from command line tools to Xcode.app, they have two different clang versions, clang under xcode will work fine.

Use the following command to switch:
sudo xcode-select --switch /Applications/Xcode.app

@maromato
Copy link
Author

@JohnsonYi @bddap Thanks! Just do brew uninstall llvm worked!

saulius added a commit that referenced this issue Mar 29, 2020
The problem occurs during Rust binding generation. When clang bindings
used come from Homebrew yet headers used for binding generation come
from system (XCode).

```
[2020-03-29T16:06:49Z INFO  bindgen] Clang Version: clang version 9.0.1 , parsed: Some((9, 0))
[2020-03-29T16:06:49Z DEBUG bindgen] Generating bindings, libclang at /usr/local/opt/llvm@9/lib/libclang.dylib
[2020-03-29T16:06:49Z DEBUG bindgen] Trying to find clang with flags: []
[2020-03-29T16:06:49Z DEBUG bindgen] Found clang: Clang { path: "/usr/bin/clang", version: Some(CXVersion { Major: 11, Minor: 0, Subminor: 0 }), c_search_paths: Some(["/usr/local/include", "/Library/Developer/CommandLineTools/usr/lib/clang/11.0.0/include", "/Library/Developer/CommandLineTools/usr/include", "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include", "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"]), cpp_search_paths: Some(["/usr/local/include", "/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1", "/Library/Developer/CommandLineTools/usr/lib/clang/11.0.0/include", "/Library/Developer/CommandLineTools/usr/include", "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include", "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"]) }
```

Some related issues:
#41
rust-lang/rust-bindgen#1506
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

4 participants