Skip to content

Commit cc55bc9

Browse files
committed
improved openblas install instructions
1 parent 11bb61d commit cc55bc9

File tree

3 files changed

+17
-19
lines changed

3 files changed

+17
-19
lines changed

docs/PERFORMANCE_LIBRARY_INSTRUCTIONS.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,22 @@ Please refer to the documentation to find out where conda installs packages on y
111111

112112
## SAF_USE_OPEN_BLAS_AND_LAPACKE
113113

114-
For those who would like to use the framework with [OpenBLAS](https://github.com/xianyi/OpenBLAS), note that for Debian/Ubuntu based Linux distributions, the libraries may be installed via:
114+
The framework also supports [OpenBLAS](https://github.com/xianyi/OpenBLAS). However, unlike Intel MKL and Apple Accelerate, the OpenBLAS library does not offer an optimised DFT/FFT, and some vector-vector operations; such as element-wise multiplications and additions. Therefore, consider pairing OpenBLAS with **SAF_ENABLE_SIMD** (enabling SSE3 and AVX2) and **SAF_USE_INTEL_IPP** or **SAF_USE_FFTW**, in which case, the performance of SAF will become roughly on par with e.g. Apple Accelerate; but not quite as fast as Intel MKL.
115115

116+
For Debian/Ubuntu based Linux distributions the required libraries may be installed via:
116117
```
117118
sudo apt-get install liblapack3 liblapack-dev libopenblas-base libopenblas-dev liblapacke-dev
118119
```
120+
While Apple Accelerate is the more recommended option for MacOSX users, OpenBLAS may be installed and used with the following:
121+
```
122+
brew install openblas
123+
export LDFLAGS="-L/usr/local/opt/openblas/lib"
124+
export CPPFLAGS="-I/usr/local/opt/openblas/include"
125+
```
126+
127+
Windows users can follow the instuctions found [here](https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio).
119128

120-
However, if you are not on Linux, or would prefer to have more control over things, then the required libraries may also be built via CMake:
129+
Lastly, you may also instead build the required libraries yourself via CMake. For example:
121130

122131
```
123132
git clone https://github.com/xianyi/OpenBLAS.git
@@ -130,22 +139,11 @@ cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 -DBUILD_WITHOUT_LAPACK
130139
make
131140
```
132141

133-
The static openblas library can then be found in:
134-
```
135-
OpenBLAS/build/lib/libopenblas.a
136-
```
137-
138-
The required include files are then found in:
139-
```
140-
OpenBLAS/lapack-netlib/CBLAS/include
141-
OpenBLAS/lapack-netlib/LAPACKE/include
142-
```
143-
144142
## SAF_USE_APPLE_ACCELERATE
145143

146-
Only for MacOSX users. Simply add the [**Accelerate**](https://developer.apple.com/documentation/accelerate) framework to your XCode project, and you're good to go.
144+
Only for MacOSX users. Simply link against the [**Accelerate**](https://developer.apple.com/documentation/accelerate) framework and you're good to go.
147145

148-
Note that Accelerate also includes an optimised FFT implementation and a number of additional vectorised utility functions which SAF is also able to make use of.
146+
Note that Accelerate also includes an optimised DFT/FFT implementation and a number of additional vectorised utility functions which SAF is also able to make use of.
149147

150148

151149
## SAF_USE_ATLAS

framework/include/saf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
" (_____ ) | ___ | | __) \n" \
118118
" /|____) | | | | | | | \n" \
119119
" (_______) |_| |_| |_| (Version: " SAF_VERSION_STRING ", License:" \
120-
" " SAF_LICENSE_STRING ") \n\n"
120+
" " SAF_LICENSE_STRING ") \n"
121121

122122

123123
/* ========================================================================== */

test/saf_test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ UnityConcludeTest(); timerResult();
6060
/* Main test program */
6161
int main_test(void) {
6262
printf("%s", SAF_VERSION_BANNER);
63+
printf("%s\n", SAF_EXTERNALS_CONFIGURATION_STRING);
6364
printf("Executing the Spatial_Audio_Framework unit testing program");
6465
#ifdef NDEBUG
65-
printf(" (Release):\n\n");
66+
printf(" (Release):\n");
6667
#else
67-
printf(" (Debug):\n\n");
68+
printf(" (Debug):\n");
6869
#endif
69-
printf("%s\n", SAF_EXTERNALS_CONFIGURATION_STRING);
7070

7171
/* initialise */
7272
timer_lib_initialize();

0 commit comments

Comments
 (0)