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

13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. OpenBLAS is an open source project supported by Lab of Parallel Software and Computational Science, ISCAS <http://www.rdcps.ac.cn>.
  5. Please read the documents on OpenBLAS wiki pages <http://github.com/xianyi/OpenBLAS/wiki>.
  6. ## Installation
  7. Download from project homepage. http://xianyi.github.com/OpenBLAS/
  8. Or, check out codes from git://github.com/xianyi/OpenBLAS.git
  9. ### Normal compile
  10. * type "make" to detect the CPU automatically.
  11. or
  12. * type "make TARGET=xxx" to set target CPU, e.g. "make TARGET=NEHALEM". The full target list is in file TargetList.txt.
  13. ### Cross compile
  14. Please set CC and FC with the cross toolchains. Then, set HOSTCC with your host C compiler. At last, set TARGET explicitly.
  15. Examples:
  16. On X86 box, compile this library for loongson3a CPU.
  17. make BINARY=64 CC=mips64el-unknown-linux-gnu-gcc FC=mips64el-unknown-linux-gnu-gfortran HOSTCC=gcc TARGET=LOONGSON3A
  18. ### Debug version
  19. make DEBUG=1
  20. ### Install to the directory (optional)
  21. Example:
  22. make install PREFIX=your_installation_directory
  23. The default directory is /opt/OpenBLAS
  24. ## Support CPU & OS
  25. Please read GotoBLAS_01Readme.txt
  26. ### Additional support CPU:
  27. #### x86/x86-64:
  28. - **Intel Xeon 56xx (Westmere)**: Used GotoBLAS2 Nehalem codes.
  29. - **Intel Sandy Bridge**: Optimized Level-3 BLAS with AVX on x86-64.
  30. - **Intel Haswell**: Optimized Level-3 BLAS with AVX on x86-64 (identical to Sandy Bridge).
  31. - **AMD Bobcat**: Used GotoBLAS2 Barcelona codes.
  32. - **AMD Bulldozer**: x86-64 S/DGEMM AVX kernels. (Thank Werner Saar)
  33. - **AMD PILEDRIVER**: Used Bulldozer codes.
  34. #### MIPS64:
  35. - **ICT Loongson 3A**: Optimized Level-3 BLAS and the part of Level-1,2.
  36. - **ICT Loongson 3B**: Experimental
  37. ### Support OS:
  38. - **GNU/Linux**
  39. - **MingWin/Windows**: Please read <https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio>.
  40. - **Darwin/Mac OS X**: Experimental. Although GotoBLAS2 supports Darwin, we are the beginner on Mac OS X.
  41. - **FreeBSD**: Supported by community. We didn't test the library on this OS.
  42. ## Usages
  43. Link with libopenblas.a or -lopenblas for shared library.
  44. ### Set the number of threads with environment variables.
  45. Examples:
  46. export OPENBLAS_NUM_THREADS=4
  47. or
  48. export GOTO_NUM_THREADS=4
  49. or
  50. export OMP_NUM_THREADS=4
  51. The priorities are OPENBLAS_NUM_THREADS > GOTO_NUM_THREADS > OMP_NUM_THREADS.
  52. 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.
  53. ### Set the number of threads on runtime.
  54. We provided the below functions to control the number of threads on runtime.
  55. void goto_set_num_threads(int num_threads);
  56. void openblas_set_num_threads(int num_threads);
  57. If you compile this lib with USE_OPENMP=1, you should use the above functions, too.
  58. ## Report Bugs
  59. Please add a issue in https://github.com/xianyi/OpenBLAS/issues
  60. ## Contact
  61. * OpenBLAS users mailing list: https://groups.google.com/forum/#!forum/openblas-users
  62. * OpenBLAS developers mailing list: https://groups.google.com/forum/#!forum/openblas-dev
  63. ## ChangeLog
  64. Please see Changelog.txt to obtain the differences between GotoBLAS2 1.13 BSD version.
  65. ## Troubleshooting
  66. * Please read [Faq](https://github.com/xianyi/OpenBLAS/wiki/Faq) at first.
  67. * Please use gcc version 4.6 and above to compile Sandy Bridge AVX kernels on Linux/MingW/BSD.
  68. * 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.
  69. * The number of CPUs/Cores should less than or equal to 256.
  70. * 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.
  71. * 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.
  72. ## Specification of Git Branches
  73. We used the git branching model in this article (http://nvie.com/posts/a-successful-git-branching-model/).
  74. Now, there are 4 branches in github.com.
  75. * The master branch. This a main branch to reflect a production-ready state.
  76. * The develop branch. This a main branch to reflect a state with the latest delivered development changes for the next release.
  77. * The loongson3a branch. This is a feature branch. We develop Loongson3A codes on this branch. We will merge this feature to develop branch in future.
  78. * The gh-pages branch. This is for web pages