Skip to content

error: linking with cc failed: exit code: 1 #183

Closed
@karasjoh000

Description

@karasjoh000

I am running a example

#[macro_use(mem_info)]
extern crate arrayfire as af;

use std::time::Instant;
use af::*;

#[allow(unused_must_use)]
#[allow(unused_variables)]
fn main() {
    set_device(0);
    info();
    let samples = 20_000_000;
    let dims = Dim4::new(&[samples, 1, 1, 1]);

    let x = &randu::<f32>(dims);
    let y = &randu::<f32>(dims);

    let start = Instant::now();

    mem_info!("Before benchmark");

    for bench_iter in 0..100 {
        let xsqrd = &mul(x, x, false);
        let ysqrd = &mul(y, y, false);
        let xplusy = &add(xsqrd, ysqrd, false);
        let root = &sqrt(xplusy);
        let cnst = &constant(1, dims);
        let (real, imag) = sum_all(&le(root, cnst, false));
        let pi_val = real*4.0/(samples as f64);
    }

    println!("Estimated Pi Value in {:?}", start.elapsed());

    mem_info!("After benchmark");
}

and I am getting this error:

error: linking with `cc` failed: exit code: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions