You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 7.6 kB

10 years ago
13 years ago
13 years ago
13 years ago
11 years ago
11 years ago
13 years ago
11 years ago
9 years ago
11 years ago
8 years ago
8 years ago
9 years ago
13 years ago
13 years ago
13 years ago
11 years ago
12 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. # OpenBLAS
  2. [![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)
  3. Travis CI: [![Build Status](https://travis-ci.org/xianyi/OpenBLAS.png?branch=develop)](https://travis-ci.org/xianyi/OpenBLAS)
  4. AppVeyor: [![Build status](https://ci.appveyor.com/api/projects/status/09sohd35n8nkkx64/branch/develop?svg=true)](https://ci.appveyor.com/project/xianyi/openblas/branch/develop)
  5. ## Introduction
  6. OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.
  7. Please read the documents on OpenBLAS wiki pages <http://github.com/xianyi/OpenBLAS/wiki>.
  8. ## Binary Packages
  9. We provide binary packages for the following platform.
  10. * Windows x86/x86_64
  11. You can download them from [file hosting on sourceforge.net](https://sourceforge.net/projects/openblas/files/).
  12. ## Installation from Source
  13. Download from project homepage. http://xianyi.github.com/OpenBLAS/
  14. Or, check out codes from git://github.com/xianyi/OpenBLAS.git
  15. ### Normal compile
  16. * type "make" to detect the CPU automatically.
  17. or
  18. * type "make TARGET=xxx" to set target CPU, e.g. "make TARGET=NEHALEM". The full target list is in file TargetList.txt.
  19. ### Cross compile
  20. Please set CC and FC with the cross toolchains. Then, set HOSTCC with your host C compiler. At last, set TARGET explicitly.
  21. Examples:
  22. On X86 box, compile this library for loongson3a CPU.
  23. make BINARY=64 CC=mips64el-unknown-linux-gnu-gcc FC=mips64el-unknown-linux-gnu-gfortran HOSTCC=gcc TARGET=LOONGSON3A
  24. On X86 box, compile this library for loongson3a CPU with loongcc (based on Open64) compiler.
  25. 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
  26. ### Debug version
  27. make DEBUG=1
  28. ### Compile with MASS Support on Power CPU (Optional dependency)
  29. [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
  30. Fortran-language applications that are tuned for optimum performance on POWER architectures. OpenBLAS with MASS requires 64-bit, little-endian OS on POWER.
  31. The library can be installed as below -
  32. * On Ubuntu:
  33. wget -q http://public.dhe.ibm.com/software/server/POWER/Linux/xl-compiler/eval/ppc64le/ubuntu/public.gpg -O- | sudo apt-key add -
  34. 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
  35. sudo apt-get update
  36. sudo apt-get install libxlmass-devel.8.1.3
  37. * On RHEL/CentOS:
  38. wget http://public.dhe.ibm.com/software/server/POWER/Linux/xl-compiler/eval/ppc64le/rhel7/repodata/repomd.xml.key
  39. sudo rpm --import repomd.xml.key
  40. wget http://public.dhe.ibm.com/software/server/POWER/Linux/xl-compiler/eval/ppc64le/rhel7/ibm-xl-compiler-eval.repo
  41. sudo cp ibm-xl-compiler-eval.repo /etc/yum.repos.d/
  42. sudo yum install libxlmass-devel.8.1.3
  43. After installing MASS library, compile openblas with USE_MASS=1.
  44. Example:
  45. Compiling on Power8 with MASS support -
  46. make USE_MASS=1 TARGET=POWER8
  47. ### Install to the directory (optional)
  48. Example:
  49. make install PREFIX=your_installation_directory
  50. The default directory is /opt/OpenBLAS
  51. ## Support CPU & OS
  52. Please read GotoBLAS_01Readme.txt
  53. ### Additional support CPU:
  54. #### x86/x86-64:
  55. - **Intel Xeon 56xx (Westmere)**: Used GotoBLAS2 Nehalem codes.
  56. - **Intel Sandy Bridge**: Optimized Level-3 and Level-2 BLAS with AVX on x86-64.
  57. - **Intel Haswell**: Optimized Level-3 and Level-2 BLAS with AVX2 and FMA on x86-64.
  58. - **AMD Bobcat**: Used GotoBLAS2 Barcelona codes.
  59. - **AMD Bulldozer**: x86-64 ?GEMM FMA4 kernels. (Thank Werner Saar)
  60. - **AMD PILEDRIVER**: Uses Bulldozer codes with some optimizations.
  61. - **AMD STEAMROLLER**: Uses Bulldozer codes with some optimizations.
  62. #### MIPS64:
  63. - **ICT Loongson 3A**: Optimized Level-3 BLAS and the part of Level-1,2.
  64. - **ICT Loongson 3B**: Experimental
  65. #### ARM:
  66. - **ARMV6**: Optimized BLAS for vfpv2 and vfpv3-d16 ( e.g. BCM2835, Cortex M0+ )
  67. - **ARMV7**: Optimized BLAS for vfpv3-d32 ( e.g. Cortex A8, A9 and A15 )
  68. #### ARM64:
  69. - **ARMV8**: Experimental
  70. - **ARM Cortex-A57**: Experimental
  71. #### IBM zEnterprise System:
  72. - **Z13**: Optimized Level-3 BLAS
  73. ### Support OS:
  74. - **GNU/Linux**
  75. - **MingWin or Visual Studio(CMake)/Windows**: Please read <https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio>.
  76. - **Darwin/Mac OS X**: Experimental. Although GotoBLAS2 supports Darwin, we are the beginner on Mac OS X.
  77. - **FreeBSD**: Supported by community. We didn't test the library on this OS.
  78. - **Android**: Supported by community. Please read <https://github.com/xianyi/OpenBLAS/wiki/How-to-build-OpenBLAS-for-Android>.
  79. ## Usages
  80. Link with libopenblas.a or -lopenblas for shared library.
  81. ### Set the number of threads with environment variables.
  82. Examples:
  83. export OPENBLAS_NUM_THREADS=4
  84. or
  85. export GOTO_NUM_THREADS=4
  86. or
  87. export OMP_NUM_THREADS=4
  88. The priorities are OPENBLAS_NUM_THREADS > GOTO_NUM_THREADS > OMP_NUM_THREADS.
  89. 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.
  90. ### Set the number of threads on runtime.
  91. We provided the below functions to control the number of threads on runtime.
  92. void goto_set_num_threads(int num_threads);
  93. void openblas_set_num_threads(int num_threads);
  94. If you compile this lib with USE_OPENMP=1, you should use the above functions, too.
  95. ## Report Bugs
  96. Please add a issue in https://github.com/xianyi/OpenBLAS/issues
  97. ## Contact
  98. * OpenBLAS users mailing list: https://groups.google.com/forum/#!forum/openblas-users
  99. * OpenBLAS developers mailing list: https://groups.google.com/forum/#!forum/openblas-dev
  100. ## ChangeLog
  101. Please see Changelog.txt to obtain the differences between GotoBLAS2 1.13 BSD version.
  102. ## Troubleshooting
  103. * Please read [Faq](https://github.com/xianyi/OpenBLAS/wiki/Faq) at first.
  104. * Please use gcc version 4.6 and above to compile Sandy Bridge AVX kernels on Linux/MingW/BSD.
  105. * 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.
  106. * 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.
  107. * 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).
  108. * 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.
  109. ## Contributing
  110. 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.
  111. 1. Fork the [OpenBLAS](https://github.com/xianyi/OpenBLAS) repository to start making your changes.
  112. 1. Write a test which shows that the bug was fixed or that the feature works as expected.
  113. 1. Send a pull request. Make sure to add yourself to `CONTRIBUTORS.md`.
  114. ## Donation
  115. Please read [this wiki page](https://github.com/xianyi/OpenBLAS/wiki/Donation).