我正在关注the arrayfire-rust guide来设置我自己的Rust项目。我可以cargo build
,但是当我cargo run
时,我会得到意想不到的结果。如果我直接从shell运行程序,我会得到预期的结果。
$cargo run
Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs
Running `target/debug/xxx`
There are 0 available backends
$cargo build
Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs
$./target/debug/xxx
There are 2 available backends
main.rs :
extern crate arrayfire as af;
use af::*;
fn main() {
println!("There are {:?} available backends", get_backend_count());
}
Cargo.toml
[package]
name = "xxx"
version = "0.1.0"
authors = ["xxx"]
[dependencies]
arrayfire = "3.4.1"
我已经提交an issue with the crate,维护人员正在调查。