失敗したときの環境
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/ |
[package]
name = "***"
version = "0.1.0"
authors = ["***"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
opencv = { version = "0.36.0", features = ["buildtime-bindgen"]}
--- あと他にbindgenを利用するcrate ---
解決策 (追記 2020/05/26)
[package]
name = "***"
version = "0.1.0"
authors = ["***"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
opencv = { version = "0.37.0", features = ["buildtime-bindgen", "clang-runtime"]}
--- あと他にbindgenを利用するcrate ---
現時点(2020/05/21)での解決策
[package]
name = "***"
version = "0.1.0"
authors = ["***"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
opencv = { git = "https://github.com/twistedfall/opencv-rust.git", features = ["buildtime-bindgen", "clang-runtime"]}
--- あと他にbindgenを利用するcrate ---
解決までの道筋
失敗した原因
opencv-rustを利用している、Cargo.toml内でbindgenを利用していた。そのbindgenがclang-runtime
ベースで動いていた。
opencv-rustを始めとしてbind generationを並列でやるときにclang-runtimeベースだとうまく動かないらしい。
解決方法
featureとしてclang-runtime
というものを用意して clang-runtime
がついてるときは(ビルド速度を犠牲にして)非並列でbind generationを行うことにした。