3 [![Build Status](https://travis-ci.org/xianyi/OpenBLAS.png?branch=develop)](https://travis-ci.org/xianyi/OpenBLAS)
6 OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.
8 Please read the documents on OpenBLAS wiki pages <http://github.com/xianyi/OpenBLAS/wiki>.
11 We provide binary packages for the following platform.
15 You can download them from [file hosting on sourceforge.net](https://sourceforge.net/projects/openblas/files/).
17 ## Installation from Source
18 Download from project homepage. http://xianyi.github.com/OpenBLAS/
20 Or, check out codes from git://github.com/xianyi/OpenBLAS.git
22 * type "make" to detect the CPU automatically.
24 * type "make TARGET=xxx" to set target CPU, e.g. "make TARGET=NEHALEM". The full target list is in file TargetList.txt.
27 Please set CC and FC with the cross toolchains. Then, set HOSTCC with your host C compiler. At last, set TARGET explicitly.
31 On X86 box, compile this library for loongson3a CPU.
33 make BINARY=64 CC=mips64el-unknown-linux-gnu-gcc FC=mips64el-unknown-linux-gnu-gfortran HOSTCC=gcc TARGET=LOONGSON3A
35 On X86 box, compile this library for loongson3a CPU with loongcc (based on Open64) compiler.
37 make CC=loongcc FC=loongf95 HOSTCC=gcc TARGET=LOONGSON3A CROSS=1 CROSS_SUFFIX=mips64el-st-linux-gnu- NO_LAPACKE=1 NO_SHARED=1 BINARY=32
43 ### Install to the directory (optional)
47 make install PREFIX=your_installation_directory
49 The default directory is /opt/OpenBLAS
52 Please read GotoBLAS_01Readme.txt
54 ### Additional support CPU:
57 - **Intel Xeon 56xx (Westmere)**: Used GotoBLAS2 Nehalem codes.
58 - **Intel Sandy Bridge**: Optimized Level-3 BLAS with AVX on x86-64.
59 - **Intel Haswell**: Optimized Level-3 BLAS with AVX on x86-64 (identical to Sandy Bridge).
60 - **AMD Bobcat**: Used GotoBLAS2 Barcelona codes.
61 - **AMD Bulldozer**: x86-64 S/DGEMM AVX kernels. (Thank Werner Saar)
62 - **AMD PILEDRIVER**: Used Bulldozer codes.
65 - **ICT Loongson 3A**: Optimized Level-3 BLAS and the part of Level-1,2.
66 - **ICT Loongson 3B**: Experimental
70 - **MingWin/Windows**: Please read <https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio>.
71 - **Darwin/Mac OS X**: Experimental. Although GotoBLAS2 supports Darwin, we are the beginner on Mac OS X.
72 - **FreeBSD**: Supported by community. We didn't test the library on this OS.
75 Link with libopenblas.a or -lopenblas for shared library.
77 ### Set the number of threads with environment variables.
81 export OPENBLAS_NUM_THREADS=4
85 export GOTO_NUM_THREADS=4
89 export OMP_NUM_THREADS=4
91 The priorities are OPENBLAS_NUM_THREADS > GOTO_NUM_THREADS > OMP_NUM_THREADS.
93 If you compile this lib with USE_OPENMP=1, you should set OMP_NUM_THREADS environment variable. OpenBLAS ignores OPENBLAS_NUM_THREADS and GOTO_NUM_THREADS with USE_OPENMP=1.
95 ### Set the number of threads on runtime.
97 We provided the below functions to control the number of threads on runtime.
99 void goto_set_num_threads(int num_threads);
101 void openblas_set_num_threads(int num_threads);
103 If you compile this lib with USE_OPENMP=1, you should use the above functions, too.
106 Please add a issue in https://github.com/xianyi/OpenBLAS/issues
109 * OpenBLAS users mailing list: https://groups.google.com/forum/#!forum/openblas-users
110 * OpenBLAS developers mailing list: https://groups.google.com/forum/#!forum/openblas-dev
113 Please see Changelog.txt to obtain the differences between GotoBLAS2 1.13 BSD version.
116 * Please read [Faq](https://github.com/xianyi/OpenBLAS/wiki/Faq) at first.
117 * Please use gcc version 4.6 and above to compile Sandy Bridge AVX kernels on Linux/MingW/BSD.
118 * Please use Clang version 3.1 and above to compile the library on Sandy Bridge microarchitecture. The Clang 3.0 will generate the wrong AVX binary code.
119 * The number of CPUs/Cores should less than or equal to 256.
120 * On Linux, OpenBLAS sets the processor affinity by default. This may cause [the conflict with R parallel](https://stat.ethz.ch/pipermail/r-sig-hpc/2012-April/001348.html). You can build the library with NO_AFFINITY=1.
121 * On Loongson 3A. make test would be failed because of pthread_create error. The error code is EAGAIN. However, it will be OK when you run the same testcase on shell.
124 1. [Check for open issues](https://github.com/xianyi/OpenBLAS/issues) or open a fresh issue to start a discussion around a feature idea or a bug.
125 1. Fork the [OpenBLAS](https://github.com/xianyi/OpenBLAS) repository to start making your changes.
126 1. Write a test which shows that the bug was fixed or that the feature works as expected.
127 1. Send a pull request. Make sure to add yourself to `CONTRIBUTORS.md`.
130 Please read [this wiki page](https://github.com/xianyi/OpenBLAS/wiki/Donation).