Merge pull request #1221 from ashwinyes/develop_arm_softfp
[platform/upstream/openblas.git] / README.md
1 # OpenBLAS
2
3 [![Join the chat at https://gitter.im/xianyi/OpenBLAS](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/xianyi/OpenBLAS?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4
5 Travis CI: [![Build Status](https://travis-ci.org/xianyi/OpenBLAS.png?branch=develop)](https://travis-ci.org/xianyi/OpenBLAS)
6
7 AppVeyor: [![Build status](https://ci.appveyor.com/api/projects/status/09sohd35n8nkkx64/branch/develop?svg=true)](https://ci.appveyor.com/project/xianyi/openblas/branch/develop)
8 ## Introduction
9 OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.
10
11 Please read the documents on OpenBLAS wiki pages <http://github.com/xianyi/OpenBLAS/wiki>.
12
13 ## Binary Packages
14 We provide binary packages for the following platform.
15
16   * Windows x86/x86_64
17
18 You can download them from [file hosting on sourceforge.net](https://sourceforge.net/projects/openblas/files/).
19
20 ## Installation from Source
21 Download from project homepage. http://xianyi.github.com/OpenBLAS/
22
23 Or, check out codes from git://github.com/xianyi/OpenBLAS.git
24 ### Normal compile
25   * type "make" to detect the CPU automatically.
26   or
27   * type "make TARGET=xxx" to set target CPU, e.g. "make TARGET=NEHALEM". The full target list is in file TargetList.txt.
28
29 ### Cross compile
30 Please set CC and FC with the cross toolchains. Then, set HOSTCC with your host C compiler. At last, set TARGET explicitly.
31
32 Examples:
33
34 On X86 box, compile this library for loongson3a CPU.
35
36     make BINARY=64 CC=mips64el-unknown-linux-gnu-gcc FC=mips64el-unknown-linux-gnu-gfortran HOSTCC=gcc TARGET=LOONGSON3A
37
38 On X86 box, compile this library for loongson3a CPU with loongcc (based on Open64) compiler.
39
40     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
41
42 ### Debug version
43
44     make DEBUG=1
45
46 ### Compile with MASS Support on Power CPU (Optional dependency)
47
48 [IBM MASS](http://www-01.ibm.com/software/awdtools/mass/linux/mass-linux.html) library consists of a set of mathematical functions for C, C++, and
49 Fortran-language applications that are tuned for optimum performance on POWER architectures. OpenBLAS with MASS requires 64-bit, little-endian OS on POWER.
50 The library can be installed as below -
51
52  * On Ubuntu:
53
54     wget -q http://public.dhe.ibm.com/software/server/POWER/Linux/xl-compiler/eval/ppc64le/ubuntu/public.gpg -O- | sudo apt-key add -</br>
55     echo "deb http://public.dhe.ibm.com/software/server/POWER/Linux/xl-compiler/eval/ppc64le/ubuntu/ trusty main" | sudo tee /etc/apt/sources.list.d/ibm-xl-compiler-eval.list</br>
56     sudo apt-get update</br>
57     sudo apt-get install libxlmass-devel.8.1.5</br>
58
59  * On RHEL/CentOS:
60
61     wget http://public.dhe.ibm.com/software/server/POWER/Linux/xl-compiler/eval/ppc64le/rhel7/repodata/repomd.xml.key</br>
62     sudo rpm --import repomd.xml.key</br>
63     wget http://public.dhe.ibm.com/software/server/POWER/Linux/xl-compiler/eval/ppc64le/rhel7/ibm-xl-compiler-eval.repo</br>
64     sudo cp ibm-xl-compiler-eval.repo /etc/yum.repos.d/</br>
65     sudo yum install libxlmass-devel.8.1.5</br>
66
67 After installing MASS library, compile openblas with USE_MASS=1.
68
69 Example:
70
71 Compiling on Power8 with MASS support -
72
73     make USE_MASS=1 TARGET=POWER8
74
75 ### Install to the directory (optional)
76
77 Example:
78
79     make install PREFIX=your_installation_directory
80
81 The default directory is /opt/OpenBLAS
82
83 ## Support CPU & OS
84 Please read GotoBLAS_01Readme.txt
85
86 ### Additional support CPU:
87
88 #### x86/x86-64:
89 - **Intel Xeon 56xx (Westmere)**: Used GotoBLAS2 Nehalem codes.
90 - **Intel Sandy Bridge**: Optimized Level-3 and Level-2 BLAS with AVX on x86-64.
91 - **Intel Haswell**: Optimized Level-3 and Level-2 BLAS with AVX2 and FMA  on x86-64.
92 - **AMD Bobcat**: Used GotoBLAS2 Barcelona codes.
93 - **AMD Bulldozer**: x86-64 ?GEMM FMA4 kernels. (Thank Werner Saar)
94 - **AMD PILEDRIVER**: Uses Bulldozer codes with some optimizations.
95 - **AMD STEAMROLLER**: Uses Bulldozer codes with some optimizations.
96
97 #### MIPS64:
98 - **ICT Loongson 3A**: Optimized Level-3 BLAS and the part of Level-1,2.
99 - **ICT Loongson 3B**: Experimental
100
101 #### ARM:
102 - **ARMV6**: Optimized BLAS for vfpv2 and vfpv3-d16 ( e.g. BCM2835, Cortex M0+ )
103 - **ARMV7**: Optimized BLAS for vfpv3-d32 ( e.g. Cortex A8, A9 and A15 )
104
105 #### ARM64:
106 - **ARMV8**: Experimental
107 - **ARM Cortex-A57**: Experimental
108
109 #### IBM zEnterprise System:
110 - **Z13**: Optimized Level-3 BLAS 
111      
112
113 ### Support OS:
114 - **GNU/Linux**
115 - **MingWin or Visual Studio(CMake)/Windows**: Please read <https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio>.
116 - **Darwin/Mac OS X**: Experimental. Although GotoBLAS2 supports Darwin, we are the beginner on Mac OS X.
117 - **FreeBSD**: Supported by community. We didn't test the library on this OS.
118 - **Android**: Supported by community. Please read <https://github.com/xianyi/OpenBLAS/wiki/How-to-build-OpenBLAS-for-Android>.
119
120 ## Usages
121 Link with libopenblas.a or -lopenblas for shared library.
122
123 ### Set the number of threads with environment variables.
124
125 Examples:
126
127     export OPENBLAS_NUM_THREADS=4
128
129  or
130
131     export GOTO_NUM_THREADS=4
132
133  or
134
135     export OMP_NUM_THREADS=4
136
137 The priorities are OPENBLAS_NUM_THREADS > GOTO_NUM_THREADS > OMP_NUM_THREADS.
138
139 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.
140
141 ### Set the number of threads on runtime.
142
143 We provided the below functions to control the number of threads on runtime.
144
145     void goto_set_num_threads(int num_threads);
146
147     void openblas_set_num_threads(int num_threads);
148
149 If you compile this lib with USE_OPENMP=1, you should use the above functions, too.
150
151 ## Report Bugs
152 Please add a issue in https://github.com/xianyi/OpenBLAS/issues
153
154 ## Contact
155 * OpenBLAS users mailing list: https://groups.google.com/forum/#!forum/openblas-users
156 * OpenBLAS developers mailing list: https://groups.google.com/forum/#!forum/openblas-dev
157
158 ## ChangeLog
159 Please see Changelog.txt to obtain the differences between GotoBLAS2 1.13 BSD version.
160
161 ## Troubleshooting
162 * Please read [Faq](https://github.com/xianyi/OpenBLAS/wiki/Faq) at first.
163 * Please use gcc version 4.6 and above to compile Sandy Bridge AVX kernels on Linux/MingW/BSD.
164 * 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.
165 * The number of CPUs/Cores should less than or equal to 256. On Linux x86_64(amd64), there is experimental support for up to 1024 CPUs/Cores and 128 numa nodes if you build the library with BIGNUMA=1.
166 * OpenBLAS does not set processor affinity by default. On Linux, you can enable processor affinity by commenting the line NO_AFFINITY=1 in Makefile.rule. But this may cause [the conflict with R parallel](https://stat.ethz.ch/pipermail/r-sig-hpc/2012-April/001348.html).
167 * 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.
168
169 ## Contributing
170 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.
171 1. Fork the [OpenBLAS](https://github.com/xianyi/OpenBLAS) repository to start making your changes.
172 1. Write a test which shows that the bug was fixed or that the feature works as expected.
173 1. Send a pull request. Make sure to add yourself to `CONTRIBUTORS.md`.
174
175 ## Donation
176 Please read [this wiki page](https://github.com/xianyi/OpenBLAS/wiki/Donation).