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

Build failed on MacOS #129

Closed
higumachan opened this issue May 18, 2020 · 7 comments
Closed

Build failed on MacOS #129

higumachan opened this issue May 18, 2020 · 7 comments

Comments

@higumachan
Copy link
Contributor

Hi I met build error on Mac OS.
I looks some problem about LLVM.
I want to help.

These are my scenario.

item desc
OS MacOS 10.14.6
OpenCV 4 directory /usr/local/Cellar/opencv/4.3.0
opencv-rust features buildtime-bindgen,contrib
How to install Opencv brew install opencv
llvm directory /usr/local/Cellar/llvm/7.0.1/

And, this is a my build log.

fail.log

thanks.

@twistedfall
Copy link
Owner

Are you using clang_sys with runtime feature enabled somewhere in your Cargo.toml or dependencies? That combination wasn't working for me in multithreaded generation so it's known to be broken at the moment.

@higumachan
Copy link
Contributor Author

Thank you for response.

I look there doesn't seem to be a clang_sys with "runtime" feature dependency.

these are Cargo.toml files by I wrote.

[package]
name = "dobot-rs"
version = "0.1.0"
authors = ["higumachan <harekumo792154@gmail.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

members = [
    "libdobot",
]

[dependencies]
libdobot = { path = "./libdobot" }
opencv = {version = "0.36", features = ["buildtime-bindgen"]}
tokio = { version = "0.2.21", features = ["full"] }
[package]
name = "libdobot"
version = "0.1.0"
authors = ["higumachan <harekumo792154@gmail.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
bindgen = "^0.53"
cmake = "0.1"

[dependencies]
strum = "^0.18"
strum_macros = "^0.18"
tokio = { version = "^0.2", features = ["time"] }

@twistedfall
Copy link
Owner

twistedfall commented May 19, 2020

Ah, it's bindgen, from its Cargo.toml:

[features]
default = [... "runtime" ...]
runtime = ["clang-sys/runtime"]

I'll see what can be done, but in the meanwhile you can do a quick fix, in the build.rs change line:

modules.par_iter().for_each(|module| {

to read:

modules.iter().for_each(|module| {

and in the binding-generator/Cargo.toml make the lines read:

clang = {version = "0.23", features = ["runtime", "clang_6_0"]}
clang-sys = {version = "0.28", features = ["runtime", "clang_6_0"]}

The build will be slower, but it should get past the generation phase.

@higumachan
Copy link
Contributor Author

Thank you for response.

I have successfully built 🎉

Can I contribute this way?
My idea is add nonparallel feature.

@twistedfall
Copy link
Owner

Yes, please do! But please call the feature clang-runtime. Because it’s not about being parallel (there are other still other parts that are done in parallel), but about compatibility with clang.

@higumachan
Copy link
Contributor Author

OK!
I will implement new feature call by clang-runtime.

Please wait a few days. thanks.

@twistedfall
Copy link
Owner

Thank you!

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

2 participants