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 5.1 kB

13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
12 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. # OpenBLAS
  2. [![Build Status](https://travis-ci.org/xianyi/OpenBLAS.png?branch=develop)](https://travis-ci.org/xianyi/OpenBLAS)
  3. ## Introduction
  4. OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.
  5. Please read the documents on OpenBLAS wiki pages <http://github.com/xianyi/OpenBLAS/wiki>.
  6. ## Binary Packages
  7. We provide binary packages for the following platform.
  8. * Windows x86/x86_64
  9. You can download them from [file hosting on sourceforge.net](https://sourceforge.net/projects/openblas/files/).
  10. ## Installation from Source
  11. Download from project homepage. http://xianyi.github.com/OpenBLAS/
  12. Or, check out codes from git://github.com/xianyi/OpenBLAS.git
  13. ### Normal compile
  14. * type "make" to detect the CPU automatically.
  15. or
  16. * type "make TARGET=xxx" to set target CPU, e.g. "make TARGET=NEHALEM". The full target list is in file TargetList.txt.
  17. ### Cross compile
  18. Please set CC and FC with the cross toolchains. Then, set HOSTCC with your host C compiler. At last, set TARGET explicitly.
  19. Examples:
  20. On X86 box, compile this library for loongson3a CPU.
  21. make BINARY=64 CC=mips64el-unknown-linux-gnu-gcc FC=mips64el-unknown-linux-gnu-gfortran HOSTCC=gcc TARGET=LOONGSON3A
  22. On X86 box, compile this library for loongson3a CPU with loongcc (based on Open64) compiler.
  23. 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
  24. ### Debug version
  25. make DEBUG=1
  26. ### Install to the directory (optional)
  27. Example:
  28. make install PREFIX=your_installation_directory
  29. The default directory is /opt/OpenBLAS
  30. ## Support CPU & OS
  31. Please read GotoBLAS_01Readme.txt
  32. ### Additional support CPU:
  33. #### x86/x86-64:
  34. - **Intel Xeon 56xx (Westmere)**: Used GotoBLAS2 Nehalem codes.
  35. - **Intel Sandy Bridge**: Optimized Level-3 BLAS with AVX on x86-64.
  36. - **Intel Haswell**: Optimized Level-3 BLAS with AVX on x86-64 (identical to Sandy Bridge).
  37. - **AMD Bobcat**: Used GotoBLAS2 Barcelona codes.
  38. - **AMD Bulldozer**: x86-64 S/DGEMM AVX kernels. (Thank Werner Saar)
  39. - **AMD PILEDRIVER**: Used Bulldozer codes.
  40. #### MIPS64:
  41. - **ICT Loongson 3A**: Optimized Level-3 BLAS and the part of Level-1,2.
  42. - **ICT Loongson 3B**: Experimental
  43. ### Support OS:
  44. - **GNU/Linux**
  45. - **MingWin/Windows**: Please read <https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio>.
  46. - **Darwin/Mac OS X**: Experimental. Although GotoBLAS2 supports Darwin, we are the beginner on Mac OS X.
  47. - **FreeBSD**: Supported by community. We didn't test the library on this OS.
  48. ## Usages
  49. Link with libopenblas.a or -lopenblas for shared library.
  50. ### Set the number of threads with environment variables.
  51. Examples:
  52. export OPENBLAS_NUM_THREADS=4
  53. or
  54. export GOTO_NUM_THREADS=4
  55. or
  56. export OMP_NUM_THREADS=4
  57. The priorities are OPENBLAS_NUM_THREADS > GOTO_NUM_THREADS > OMP_NUM_THREADS.
  58. 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.
  59. ### Set the number of threads on runtime.
  60. We provided the below functions to control the number of threads on runtime.
  61. void goto_set_num_threads(int num_threads);
  62. void openblas_set_num_threads(int num_threads);
  63. If you compile this lib with USE_OPENMP=1, you should use the above functions, too.
  64. ## Report Bugs
  65. Please add a issue in https://github.com/xianyi/OpenBLAS/issues
  66. ## Contact
  67. * OpenBLAS users mailing list: https://groups.google.com/forum/#!forum/openblas-users
  68. * OpenBLAS developers mailing list: https://groups.google.com/forum/#!forum/openblas-dev
  69. ## ChangeLog
  70. Please see Changelog.txt to obtain the differences between GotoBLAS2 1.13 BSD version.
  71. ## Troubleshooting
  72. * Please read [Faq](https://github.com/xianyi/OpenBLAS/wiki/Faq) at first.
  73. * Please use gcc version 4.6 and above to compile Sandy Bridge AVX kernels on Linux/MingW/BSD.
  74. * 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.
  75. * The number of CPUs/Cores should less than or equal to 256.
  76. * 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.
  77. * 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.
  78. ## Contributing
  79. 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.
  80. 1. Fork the [OpenBLAS](https://github.com/xianyi/OpenBLAS) repository to start making your changes.
  81. 1. Write a test which shows that the bug was fixed or that the feature works as expected.
  82. 1. Send a pull request. Make sure to add yourself to `CONTRIBUTORS.md`.
  83. ## Donation
  84. Please read [this wiki page](https://github.com/xianyi/OpenBLAS/wiki/Donation).