title: Blas seems very slow
body: <p>I am comparing matrix multiplications on my machine, and it seems like the c++ blas is very slow. It takes about 4 seconds to multiply a 1000x1000 matrix, and the same time required in python is about 1.5 seconds. I think there might be something wrong with the linking, but I really do not know much how to fix these kind of things. Here is the c++ code</p>
  
  <pre><code>    #include &lt;stdio.h&gt;
  #include &lt;iostream&gt;
  #include &lt;time.h&gt;
  #include &lt;gsl/gsl_blas.h&gt;
  #include &lt;gsl/gsl_sf_bessel.h&gt;
  using namespace std;
  
  
  double diffclock(clock_t clock1,clock_t clock2) { double diffticks=clock1-clock2; double diffms=(diffticks*1000)/CLOCKS_PER_SEC; return diffms; }
  
  
  
  
  int
  main (void)
  {
    double* a=new double[1000*1000];
  
    double* b=new double[1000*1000];
  
    double* c=new double[1000*1000];
  
    for (int i=0;i&lt;1000*1000;i++){
    a[i]=i;
    b[i]=i/5+i*i/100;}
  
    gsl_matrix_view A = gsl_matrix_view_array(a, 1000, 1000);
    gsl_matrix_view B = gsl_matrix_view_array(b, 1000, 1000);
    gsl_matrix_view C = gsl_matrix_view_array(c, 1000, 1000);
  
    /* Compute C = A B */
    cout&lt;&lt;"start"&lt;&lt;endl;
    clock_t begin=clock();
  
    gsl_blas_dgemm (CblasNoTrans, CblasNoTrans,
                    1.0, &amp;A.matrix, &amp;B.matrix,
                    0.0, &amp;C.matrix);
    clock_t end=clock();
    cout&lt;&lt;double(diffclock(end,begin))&lt;&lt;endl;
  
    return 0;  
  }
  </code></pre>
  
  <p>I am compiling using 
      //g++ -o program mm.cpp -I/home/gsl/include -lm -L/home/gsl/lib -lgsl -lgslcblas</p>
  
  <p>The python code is</p>
  
  <pre><code>    import time
  import numpy as np
  
  
  
  n=1000
  a=np.zeros((n,n))
  b=np.zeros((n,n))
  for i in range(0,n):
      for j in range(0,n):
          a[i,j]=i*n+j
          b[i,j]=(i*n+j)/5+(n*i+j)**2/5
  print "start"
  start=time.time()
  c=np.dot(a,b)
  end=time.time()
  print end-start
  </code></pre>
  
  <p>thanks for any help!</p>