This code testing gsl works fine:
    
    
    import futhark
    
    {.passL: "-lgsl -lgslcblas".}
    
    importc:
      "gsl/gsl_sf_bessel.h"
    
    var
      x = 5.0
      y = gslSfBesselJ0(x)
    echo "J=(", x, ") = ", y
    
    
    Run

but oddly, this does not:
    
    
    import futhark
    
    {.passL: "-lgsl -lgslcblas".}
    
    importc:
      "gsl/gsl_linalg.h"
    
    var
      a_data = @[ 0.18'f64, 0.60'f64, 0.57'f64, 0.96'f64, 0.41'f64, 0.24'f64, 
0.99'f64, 0.58'f64, 0.14'f64, 0.30'f64, 0.97'f64, 0.66'f64, 0.51'f64, 0.13'f64, 
0.19'f64, 0.85]
      b_data = @[1.0'f64, 2.0'f64, 3.0'f64, 4.0'f64]
      m = gsl_matrix_view_array(addr a_data[0], 4, 4)
    
    echo "a_data =(", a_data, ")"
    echo "b_data =(", b_data, ")"
    
    
    Run

This is the error I get: 
    
    
    /home/tkd/.nimble/pkgs/futhark-0.3.1/futhark.nim(440, 14) template/generic 
instantiation of `importcImpl` from here
    /home/tkd/.choosenim/toolchains/nim-1.6.0/lib/pure/parsejson.nim(179, 8) 
Error: interpretation requires too many iterations; if you are sure this is not 
a bug in your code, compile with `--maxLoopIterationsVM:number` (current value: 
10000000)
    
    
    Run

Reply via email to