Merge branch 'TimothyGu-develop' into develop
[platform/upstream/openblas.git] / README.md
1 # OpenBLAS
2
3 [![Build Status](https://travis-ci.org/xianyi/OpenBLAS.png?branch=develop)](https://travis-ci.org/xianyi/OpenBLAS)
4
5 ## Introduction
6 OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.
7
8 Please read the documents on OpenBLAS wiki pages <http://github.com/xianyi/OpenBLAS/wiki>.
9
10 ## Binary Packages
11 We provide binary packages for the following platform.
12
13   * Windows x86/x86_64
14
15 You can download them from [file hosting on sourceforge.net](https://sourceforge.net/projects/openblas/files/).
16
17 ## Installation from Source
18 Download from project homepage. http://xianyi.github.com/OpenBLAS/
19
20 Or, check out codes from git://github.com/xianyi/OpenBLAS.git
21 ### Normal compile
22   * type "make" to detect the CPU automatically.
23   or
24   * type "make TARGET=xxx" to set target CPU, e.g. "make TARGET=NEHALEM". The full target list is in file TargetList.txt.
25
26 ### Cross compile
27 Please set CC and FC with the cross toolchains. Then, set HOSTCC with your host C compiler. At last, set TARGET explicitly.
28
29 Examples:
30
31 On X86 box, compile this library for loongson3a CPU.
32
33     make BINARY=64 CC=mips64el-unknown-linux-gnu-gcc FC=mips64el-unknown-linux-gnu-gfortran HOSTCC=gcc TARGET=LOONGSON3A
34
35 On X86 box, compile this library for loongson3a CPU with loongcc (based on Open64) compiler.
36
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
38
39 ### Debug version
40
41     make DEBUG=1
42
43 ### Install to the directory (optional)
44
45 Example:
46
47     make install PREFIX=your_installation_directory
48
49 The default directory is /opt/OpenBLAS
50
51 ## Support CPU & OS
52 Please read GotoBLAS_01Readme.txt
53
54 ### Additional support CPU:
55
56 #### x86/x86-64:
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.
63
64 #### MIPS64:
65 - **ICT Loongson 3A**: Optimized Level-3 BLAS and the part of Level-1,2.
66 - **ICT Loongson 3B**: Experimental
67
68 ### Support OS:
69 - **GNU/Linux**
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.
73
74 ## Usages
75 Link with libopenblas.a or -lopenblas for shared library.
76
77 ### Set the number of threads with environment variables.
78
79 Examples:
80
81     export OPENBLAS_NUM_THREADS=4
82
83  or
84
85     export GOTO_NUM_THREADS=4
86
87  or
88
89     export OMP_NUM_THREADS=4
90
91 The priorities are OPENBLAS_NUM_THREADS > GOTO_NUM_THREADS > OMP_NUM_THREADS.
92
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.
94
95 ### Set the number of threads on runtime.
96
97 We provided the below functions to control the number of threads on runtime.
98
99     void goto_set_num_threads(int num_threads);
100
101     void openblas_set_num_threads(int num_threads);
102
103 If you compile this lib with USE_OPENMP=1, you should use the above functions, too.
104
105 ## Report Bugs
106 Please add a issue in https://github.com/xianyi/OpenBLAS/issues
107
108 ## Contact
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
111
112 ## ChangeLog
113 Please see Changelog.txt to obtain the differences between GotoBLAS2 1.13 BSD version.
114
115 ## Troubleshooting
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.
122
123 ## Contributing
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`.
128
129 ## Donation
130 Please read [this wiki page](https://github.com/xianyi/OpenBLAS/wiki/Donation).