blas

How to build hmatrix with BLAS and LAPACK under Windows?

孤者浪人 提交于 2019-12-07 07:38:55
问题 Windows 10 x64 Cabal 1.22 I'm following steps in Windows section https://github.com/AlbertoRuiz/hmatrix/blob/master/INSTALL.md I downloaded hmatrix sources and gsl-lapack-windows.zip. When I try to install hmatrix with: D:\Projects\workspace\hmatrix-0.16.1.5>cabal install --extra-include-dirs=D:\Projects\workspace\gsl-lapack-windows\ --extra-lib-dirs=d:\Projects\workspace\gsl-lapack-windows\ I got this message that I'm still cannot solve: Configuring hmatrix-0.16.1.5... Failed to install

iOS 4 Accelerate Cblas with 4x4 matrices

一个人想着一个人 提交于 2019-12-07 03:29:02
问题 I’ve been looking into the Accelerate framework that was made available in iOS 4. Specifically, I made some attempts to use the Cblas routines in my linear algebra library in C. Now I can’t get the use of these functions to give me any performance gain over very basic routines. Specifically, the case of 4x4 matrix multiplication. Wherever I couldn’t make use of affine or homogeneous properties of the matrices, I’ve been using this routine (abridged): float *mat4SetMat4Mult(const float *m0,

Armadillo + Matlab Mex segfault

强颜欢笑 提交于 2019-12-06 11:50:21
I fiddled with this the whole day, so I thought I might make everyone benefit from my experience, please see my answer below. I first had a problem with running a compiled Mex file within Matlab, because Matlab complained that it couldn't open the shared library libarmadillo . I solved this using the environment variables LD_LIBRARY_PATH and LD_RUN_PATH ( DYLD_LIBRARY_PATH and LYLD_RUN_PATH in osx). The problem remained however, that a simple test file would segfault at runtime even though the exact same code would compile and run fine outside Matlab (not Mex'd). The segfault seems to be

Symmetric Matrix Inversion in C using CBLAS/LAPACK

徘徊边缘 提交于 2019-12-06 11:18:44
问题 I am writing an algorithm in C that requires Matrix and Vector multiplications. I have a matrix Q (W x W) which is created by multiplying the transpose of a vector J (1 x W) with itself and adding Identity matrix I , scaled using scalar a . Q = [(J^T) * J + aI]. I then have to multiply the inverse of Q with vector G to get vector M . M = (Q^(-1)) * G. I am using cblas and clapack to develop my algorithm. When matrix Q is populated using random numbers (type float) and inverted using the

Numpy SVD appears to parallelize on Mac OSX, but not on my Ubuntu virtual machine

拜拜、爱过 提交于 2019-12-06 09:23:22
问题 I want to run the following script: #python imports import time #3rd party imports import numpy as np import pandas as pd def pd_svd(pd_dataframe): np_dataframe = pd_dataframe.values return np.linalg.svd(pd_dataframe) if __name__ == '__main__': li_times = [] for i in range(1, 3): start = time.time() pd_dataframe = pd.DataFrame(np.random.random((3000, 252 * i))) pd_svd(pd_dataframe) li_times.append(str(time.time() - start)) print li_times I try it on my Macbook Air 2011 with OSX 10.9.4 and on

Matrix-vector product with dgemm/dgemv

风格不统一 提交于 2019-12-06 05:38:30
问题 Using Lapack with C++ is giving me a small headache. I found the functions defined for fortran a bit eccentric, so I tried to make a few functions on C++ to make it easier for me to read what's going on. Anyway, I'm not getting th matrix-vector product working as I wish. Here is a small sample of the program. smallmatlib.cpp: #include <cstdio> #include <stdlib.h> extern "C"{ // product C= alphaA.B + betaC void dgemm_(char* TRANSA, char* TRANSB, const int* M, const int* N, const int* K, double

“undefined reference to 'cblas_ddot'” when using cblas library

微笑、不失礼 提交于 2019-12-06 04:39:08
问题 I was testing the cblas ddot, and the code I used is from the link and I fixed it as #include <stdio.h> #include <stdlib.h> #include <cblas.h> int main() { double m[10],n[10]; int i; int result; printf("Enter the elements into first vector.\n"); for(i=0;i<10;i++) scanf("%lf",&m[i]); printf("Enter the elements into second vector.\n"); for(i=0;i<10;i++) scanf("%lf",&n[i]); result = cblas_ddot(10, m, 1, n, 1); printf("The result is %d\n",result); return 0; } Then when I compiled it, it turned

How to check which BLAS is in my Ubuntu system?

萝らか妹 提交于 2019-12-06 00:38:13
问题 In particular, I would like to know if xianyi's OpenBLAS has been installed. I work on several PCs and had it installed in several PCs over the past couple of years, but I lost track which were not installed with it. I need to know which PC has it and which doesn't This is how I installed it: git clone git://github.com/xianyi/OpenBLAS cd OpenBLAS make FC=gfortran sudo make PREFIX=/usr/local/ install Note: I may have deleted the OpenBLAS directory, so it's not a reliable indicator. And I have

CFFI Not Loading Dependent Libraries?

依然范特西╮ 提交于 2019-12-05 19:50:28
I am trying to use the BLAS/LAPACK libraries from SBCL (specifically trying to get the LLA package running). I was having a lot of troubles getting the BLAS shared library to load; eventually I discovered that it wasn't able to load its dependent libraries. Eventually I was able to load BLAS by loaded all of its dependencies manually: (setq cffi::*foreign-library-directories* '("C:/cygwin64/bin/" "C:/cygwin64/lib/lapack/")) (CFFI:LOAD-FOREIGN-LIBRARY "CYGWIN1.DLL") (CFFI:LOAD-FOREIGN-LIBRARY "CYGGCCC_S-SEH-1.DLL") [..etc..] (CFFI:LOAD-FOREIGN-LIBRARY "CYGBLAS-0.dll") As a workaround this isn't

How can I make NumPy use OpenBlas in Ubuntu?

痴心易碎 提交于 2019-12-05 18:53:40
I have both BLAS and OpenBLAS installed: $ dpkg -l \*blas\* | grep ^i ii libblas-dev 1.2.20110419-7 amd64 Basic Linear Algebra Subroutines 3, static library ii libblas3 1.2.20110419-7 amd64 Basic Linear Algebra Reference implementations, shared library ii libopenblas-base 0.2.8-6ubuntu1 amd64 Optimized BLAS (linear algebra) library based on GotoBLAS2 ii libopenblas-dev 0.2.8-6ubuntu1 amd64 Optimized BLAS (linear algebra) library based on GotoBLAS2 However, NumPy still says that OpenBLAS is not available: >> np.__config__.show() blas_info: libraries = ['blas'] library_dirs = ['/usr/lib']