Keine Beschreibung

Jeremy Soller f5ed774593 Fix missing functions on riscv64 vor 1 Monat
.github 319b5f241c Bump actions/checkout from 4 to 5 (#335) vor 1 Monat
aarch64 9fbeafcd4f Fix BSD-specific types on Linux for aarch64 (#329) vor 5 Monaten
amd64 e2482c959e Add stack markings for GNU to fmod assembly files (#307) vor 1 Jahr
arm 388f0f1d32 Remove unused Symbol.map files. vor 10 Jahren
bsdsrc 57dd0f905d add missing weak references for long double functions vor 4 Jahren
docs 3cfad14805 Update index.html vor 7 Monaten
i387 ae2d916985 Correctly round double precision sqrt (#256) vor 3 Jahren
include 4d375a922f Include cdefs-compat.h on s390 and powerpc vor 4 Monaten
ld128 238a90959f Fix compilation on AArch64 vor 8 Jahren
ld80 aeaf9cefa7 Fix undefined reference to __fpgetprec on i386 vor 9 Jahren
loongarch64 c4667caea2 Fix fenv_t initializer (#308) vor 11 Monaten
mips 4dcc76ed96 Using cdefs-compat.h and stdint.h instead <sys/types.h> vor 7 Jahren
powerpc 63aa8757f3 Make fenv methods static on additional platforms. vor 4 Jahren
riscv64 c9c6fd6ead Update riscv64 fenv.c initialization to fix warnings (#330) vor 4 Monaten
s390 2a1e56858a s390(x) port vor 7 Jahren
src f5ed774593 Fix missing functions on riscv64 vor 1 Monat
test 60dec83e33 msys2 ci (#243) vor 4 Jahren
wasm32 72f33a3bf9 wasm32 support (#192) vor 6 Jahren
.gitignore d463259eaa ci: test with openlibm-test (#327) vor 5 Monaten
.mailmap f5d2bc53f9 Add mailmap vor 13 Jahren
CMakeLists.txt 2fba53e3ec cmake: Fix cmake error for 4.x (#333) vor 2 Monaten
LICENSE.md ce69bf1f32 Update references to JuliaLang to point to JuliaMath (#182) vor 7 Jahren
Make.inc 4d2d83fdec Add a Vim filetype hint for Make.inc alongside that for Emacs vor 9 Monaten
Makefile d463259eaa ci: test with openlibm-test (#327) vor 5 Monaten
README.md 87e5f0b3f2 CMake updates (#302) vor 1 Jahr
openlibm.pc.in acf58d235e build: fix pkgconfig cflags and libdir variables (#284) vor 1 Jahr

README.md

OpenLibm

codecov

OpenLibm is an effort to have a high quality, portable, standalone C mathematical library (libm). It can be used standalone in applications and programming language implementations.

The project was born out of a need to have a good libm for the Julia programming language that worked consistently across compilers and operating systems, and in 32-bit and 64-bit environments.

Platform support

OpenLibm builds on Linux, macOS, Windows, FreeBSD, OpenBSD, NetBSD, and DragonFly BSD. It builds with both GCC and clang. Although largely tested and widely used on the x86 and x86-64 architectures, OpenLibm also supports arm, aarch64, ppc64le, mips, wasm32, riscv, s390(x) and loongarch64.

Build instructions

GNU Make

  1. Use GNU Make to build OpenLibm. This is make on most systems, but gmake on BSDs.
  2. Use make USEGCC=1 to build with GCC. This is the default on Linux and Windows.
  3. Use make USECLANG=1 to build with clang. This is the default on OS X, FreeBSD, and OpenBSD.
  4. Use make ARCH=wasm32 to build the wasm32 library with clang.
  5. Architectures are auto-detected. Use make ARCH=i386 to force a build for i386. Other supported architectures are i486, i586, and i686. GCC 4.8 is the minimum requirement for correct codegen on older 32-bit architectures.

Cross Build Take riscv64 as example:

  1. install qemu-riscv64-static, gcc-riscv64-linux-gnu
  2. Cross build:

    ARCH=riscv64
    TRIPLE=$ARCH-linux-gnu
    make ARCH=$ARCH TOOLPREFIX=$TRIPLE-  -j
    make -C test ARCH=$ARCH TOOLPREFIX=$TRIPLE-  -j
    
  3. Run test with qemu:

    qemu-$ARCH-static -L . -L /usr/$TRIPLE/  test/test-float
    qemu-$ARCH-static -L . -L /usr/$TRIPLE/  test/test-double
    

CMake

  1. Create build directory with mkdir build and navigate into it with cd build.
  2. Run CMake to configure project and generate native build system with cmake /path/to/openlibm/ or generate project with build system of choice e.g. cmake /path/to/openlib/ -G "MinGW Makefiles".
  3. Build with the build system with cmake --build ..

Default CMake configuration builds a shared library, this can easily be configured using BUILD_SHARED_LIBS configuration option.

Acknowledgements

PowerPC support for openlibm was graciously sponsored by IBM.