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

Compiling librocksdb-sys v6.11.4 failed on macOS 10.15.7 #474

Closed
yiyanwannian opened this issue Nov 9, 2020 · 7 comments
Closed

Compiling librocksdb-sys v6.11.4 failed on macOS 10.15.7 #474

yiyanwannian opened this issue Nov 9, 2020 · 7 comments

Comments

@yiyanwannian
Copy link

err:
error occurred: Command "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-arch" "x86_64" "-I" "rocksdb/include/" "-I" "rocksdb/" "-I" "rocksdb/third-party/gtest-1.8.1/fused-src/" "-I" "." "-Wall" "-Wextra" "-std=c++11" "-Wno-unused-parameter" "-msse2" "-msse4.1" "-msse4.2" "-mpclmul" "-DNDEBUG=1" "-DHAVE_SSE42=1" "-DHAVE_PCLMUL=1" "-DOS_MACOSX=1" "-DROCKSDB_PLATFORM_POSIX=1" "-DROCKSDB_LIB_IO_POSIX=1" "-o" "/Users/XXX/dev/src/github.com/rust-rocksdb/rust-rocksdb/librocksdb-sys/target/release/build/librocksdb-sys-a6c8953761ec2b75/out/rocksdb/cache/cache.o" "-c" "rocksdb/cache/cache.cc" with args "c++" did not execute successfully (status code exit code: 1).

detail error info below err.txt
err.txt

@kaimast
Copy link

kaimast commented Nov 19, 2020

I am also getting build errors on two different linux machines. One with Ubuntu 20.10 and one with ubuntu 20.04. Both have the most recent rust nightly...

Is there a specific version of clang or GCC that should be used?

@rohitjoshi
Copy link
Contributor

This issue came when I ran cargo update which updated cc package. I manually changed back to v1.0.61 version and it works fine now.

@Maher4Ever
Copy link

Maher4Ever commented Nov 19, 2020

@rohitjoshi How did you downgrade the cc build dependency?

Update: For anyone facing this issue, as @rohitjoshi mentioned downgrading the cc crate fixes it. This can be done by adding the following to your Cargo.toml file:

[build-dependencies.cc]
version = "=1.0.61"
features = ["parallel"]

@yiyanwannian
Copy link
Author

yiyanwannian commented Nov 19, 2020

after add build-dependencies.cc to Cargo.toml, but same error still over there
image

@yiyanwannian
Copy link
Author

My issue still on my macos
rustup show
Default host: x86_64-apple-darwin
rustup home: /Users/xxx/.rustup

installed toolchains

stable-x86_64-apple-darwin (default)
nightly-x86_64-apple-darwin

active toolchain

stable-x86_64-apple-darwin (default)
rustc 1.48.0 (7eac88abb 2020-11-16)

@yiyanwannian
Copy link
Author

fixed by change /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath file
line: 304
change include <math.h> to include "math.h"

@juancolchete
Copy link

I was using linux on WSL2 but, this was one of the first posts related with my problem that I found and I will leave one link and I hope help someone that is also stucked when build librocksdb-sys v6.11.4 full solution

resumed solution:
sudo apt-get update
sudo apt-get install g++

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