SLEEF is a library that implements vectorized versions of C standard math functions. This library also includes DFT subroutines.
- Web Page: https://sleef.org/
- Sources: https://github.com/shibatch/sleef
Due to limited test capacities, SLEEF is currently only officially supported on Linux with gcc or llvm/clang. This issue 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.
π’ : Tested extensively in CI.
β : Currently failing some tests in CI.
βͺ : Not tested in CI. Might have passed tests in previous CI framework.
OS/Compiler | |||||||||
---|---|---|---|---|---|---|---|---|---|
Linux | MacOS | Windows | |||||||
Arch. | Vector Extensions | gcc | llvm | icc | gcc | llvm | gcc | llvm | msvc |
x86_64 | SSE2, SSE4, AVX, AVX2, AVX512F |
π’ | π’ | βͺ | βͺ | βͺ | βͺ | βͺ | βͺ |
x86 32bit (i386) | SSE | π’ | π’ | βͺ | βͺ | βͺ | βͺ | βͺ | βͺ |
AArch64 (arm) | Neon, SVE | π’ | π’ | N/A | Preliminary | N/A | |||
AArch32 (armhf) | NEON | π’ | π’ | N/A | Preliminary | N/A | |||
PowerPC (ppc64el) | VSX, VSX3 | π’ | π’ | N/A | N/A | N/A | |||
IBM/Z (s390x) | VXE, VXE2 | π’ | π’ | N/A | N/A | N/A | |||
RISC-V (riscv64) | RVV1, RVV2 | N/A (14+) | π’ | N/A | N/A | N/A |
The above table is valid for libm in single, double and quadruple precision, as well as fast Discrete Fourier Transform (DFT).
Generation of inline headers is also supported for most vector extensions.
- DFT, Quad. and inline headers generations are not supported with RISC-V yet.
- LTO is not tested in CI yet.
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.
Only Linux distributions are currently tested in CI and thus officially supported.
Building SLEEF for MacOS and Windows on x86 machines was officially supported ( βͺ ), as of 3.5.1, however it is not currently tested.
Refer to our web page for more on supported environment.
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.
We recommend relying on CMake as much as possible in the build process to ensure portability. CMake 3.18+ is the minimum required.
- Check out the source code from our GitHub repository
git clone https://github.com/shibatch/sleef
- Make a separate directory to create an out-of-source build
cd sleef && mkdir build
- Run cmake to configure the project
cmake -S . -B build
- Run make to build the project
cmake --build build -j --clean-first
- Run tests using ctests
ctest --test-dir build -j
For more detailed build instructions please refer to the dedicated section on CMake or to our web page.
Assuming following instructions were followed.
- Install to specified directory
<prefix>
cmake --install build --prefix=<prefix>
SLEEF can also be directly installed using Spack.
spack install sleef@master
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. Contributions to this project are accepted under the same license.
Copyright Β© 2010-2024 SLEEF Project, Naoki Shibata and contributors.