Closed maromato closed 5 years ago
Hi @maromato,
can you please paste the output of the following command:
cargo clean -p croaring-sys && cargo build -p croaring-sys -vv
Thanks!
The failure seems related to clang/llvm version.
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 Thanks! I tried do brew uninstall llvm
and brew install llvm
, but it did not work.
@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.
@bddap Thanks! I tried do
brew uninstall llvm
andbrew 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.
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
@JohnsonYi @bddap Thanks! Just do brew uninstall llvm
worked!
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!