Newer
Older

[](https://ieeexplore.ieee.org/document/8936472)
[](https://www.boost.org/LICENSE_1_0.txt)

[](https://spack.readthedocs.io/en/v0.16.2/package_list.html#sleef)
SLEEF is a library that implements vectorized versions of C standard math functions. This library also includes DFT subroutines.
- **Web Page:** [https://sleef.org/][webpage_url]
- **Sources:** [https://github.com/shibatch/sleef][repo_url]
Due to limited test capacities, SLEEF is currently only officially supported on Linux with gcc or llvm/clang.
[This issue](https://github.com/shibatch/sleef/issues/481) tracks progress on improving test coverage.
Compilation of SLEEF on previously supported environments might still be safe, we just cannot verify it yet.
The following table summarises currently supported vector extensions, compilers and OS-es.
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
:white_circle: : Not tested in CI. Might have passed tests in previous CI framework.
<table>
<tr>
<th colspan="2" rowspan="2"></th>
<th colspan="8">OS/Compiler</th>
</tr>
<tr>
<th colspan="3">Linux</th>
<th colspan="2">MacOS</th>
<th colspan="3">Windows</th>
</tr>
<tr>
<th>Arch.</th>
<th>Vector Extensions</th>
<th>gcc</th><th>llvm</th><th>icc</th>
<th>gcc</th><th>llvm</th>
<th>gcc</th><th>llvm</th><th>msvc</th>
</tr>
<tr align="center"><th>x86_64</th><th>SSE2, SSE4,<br>AVX, AVX2, AVX512F</th>
<td>:green_circle:</td><td>:green_circle:</td><td>:white_circle:</td>
<td>:white_circle:</td><td>:white_circle:</td>
<td>:white_circle:</td><td>:white_circle:</td><td>:white_circle:</td>
</tr>
<tr align="center"><th>x86 32bit<br>(i386)</th><th>SSE</th>
<td>:green_circle:</td><td>:green_circle:</td><td>:white_circle:</td>
<td>:white_circle:</td><td>:white_circle:</td>
<td>:white_circle:</td><td>:white_circle:</td><td>:white_circle:</td>
</tr>
<tr align="center"><th>AArch64<br>(arm)</th><th>Neon, SVE</th>
<td>:green_circle:</td><td>:x:</td><td>N/A</td>
<td colspan="2">Preliminary</td>
<td colspan="3">N/A</td>
</tr>
<tr align="center"><th>AArch32<br>(armhf)</th><th>NEON</th>
<td>:green_circle:</td><td>:green_circle:</td><td>N/A</td>
<td colspan="2">Preliminary</td>
<td colspan="3">N/A</td>
</tr>
<tr align="center"><th>PowerPC<br>(ppc64el)</th><th>VSX, VSX3</th>
<td>:green_circle:</td><td>:green_circle:</td><td>N/A</td>
<td colspan="2">N/A</td>
<td colspan="3">N/A</td>
</tr>
<tr align="center"><th>IBM/Z<br>(s390x)</th><th>VXE, VXE2</th>
<td>:green_circle:</td><td>:green_circle:</td><td>N/A</td>
<td colspan="2">N/A</td>
<td colspan="3">N/A</td>
</tr>
<tr align="center"><th>Risc-V<br>(riscv64)</th><th>RVV1, RVV2</th>
<td>N/A (14+)</td><td>:green_circle:</td><td>N/A</td>
<td colspan="2">N/A</td>
<td colspan="3">N/A</td>
</tr>
</table>
### Compiler support
Results are displayed for gcc 11 and llvm 17, the compiler versions used in CI tests with GitHub Actions.
Older versions should be supported too, while newer ones are either not tested or have known issues.
### OS support
Only Linux distributions are currently tested in CI and thus officially supported.
Building SLEEF for MacOS and Windows on x86 machines was officially supported (:white_circle:), as of 3.5.1, however it is not currently tested.
### More on supported environment
Refer to our web page for [more on supported environment][supported_env_url].
## Install SLEEF dependencies
The library itself does not have any additional dependency.
However some tests require:
- libssl and libcrypto, that can be provided by installing openssl.
- libm, libgmp and libmpfr
- libfftw.
These tests can be disabled if necessary.
## How to build SLEEF
We recommend relying on CMake as much as possible in the build process to ensure portability.
CMake 3.18+ is the minimum required currently.
1. Check out the source code from our GitHub repository
```
git clone https://github.com/shibatch/sleef
```
2. Make a separate directory to create an out-of-source build
```
cd sleef && mkdir build
```
3. Run cmake to configure the project
```
cmake -S . -B build
```
4. Run make to build the project
```
cmake --build build -j --clean-first
```
5. Run tests using ctests
```
ctest --test-dir build -j
```
Refer to our web page for [detailed build instructions][build_info_url].
## Install SLEEF
### From source
Assuming following instructions were followed.
6. Install to specified directory `<prefix>`
```
cmake --install build --prefix=<prefix>
```
### Using Spack
SLEEF can also be directly installed using Spack.
```
spack install sleef@master
```
## License
The software is distributed under the Boost Software License, Version 1.0.
See accompanying file LICENSE.txt or copy at [http://www.boost.org/LICENSE_1_0.txt][license_url].
Contributions to this project are accepted under the same license.
Copyright Naoki Shibata and contributors 2010 - 2024.
<!-- Repository links -->
[webpage_url]: https://sleef.org/
[build_info_url]: https://sleef.org/compile.xhtml
[supported_env_url]: https://sleef.org/index.xhtml#environment
[repo_url]: https://github.com/shibatch/sleef
[repo_license_url]: https://github.com/shibatch/sleef/blob/main/LICENSE.txt
[license_url]: http://www.boost.org/LICENSE_1_0.txt