Pre-requisite:
- $ sudo apt-get install gfortran
Getting OpenBLAS Source:
- $ git clone https://github.com/xianyi/OpenBLAS
Building Source:
- cd OpenBLAS
- make FC=gfortran
make[1]: Leaving directory ‘/mnt/avkash/OpenBLAS/exports’
OpenBLAS build complete. (BLAS CBLAS LAPACK LAPACKE)
OS … Linux
Architecture … x86_64
BINARY … 64bit
C compiler … GCC (command line : gcc)
Fortran compiler … GFORTRAN (command line : gfortran)
Library Name … libopenblas_sandybridgep-r0.2.20.dev.a (Multi threaded; Max num-threads is 8)
To install the library, you can run “make PREFIX=/path/to/your/installation install”.
Installation:
- $ sudo make PREFIX=/usr/local install
make -j 8 -f Makefile.install install
make[1]: Entering directory ‘/mnt/avkash/OpenBLAS’
Generating openblas_config.h in /usr/local/include
Generating f77blas.h in /usr/local/include
Generating cblas.h in /usr/local/include
Copying LAPACKE header files to /usr/local/include
Copying the static library to /usr/local/lib
Copying the shared library to /usr/local/lib
Generating OpenBLASConfig.cmake in /usr/local/lib/cmake/openblas
Generating OpenBLASConfigVersion.cmake in /usr/local/lib/cmake/openblas
Install OK!
make[1]: Leaving directory ‘/mnt/avkash/OpenBLAS’
Error: If you hit the following error: /usr/bin/ld: cannot find -lgfortran
gcc -O2 -DMAX_STACK_ALLOC=2048 -Wall -m64 -DF_INTERFACE_GFORT -fPIC -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=8 -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DCHAR_NAME=\”_\” -DCHAR_CNAME=\”\” -DNO_AFFINITY -I.. -shared -o ../libopenblas_sandybridgep-r0.2.20.dev.so \
|
Solution: You just need to use NO_LAPACK=1 parameter along with make.
$ make FC=gfortran NO_LAPACK=1 |
Thats it!!