{"id":13676890,"url":"https://github.com/JuliaMath/openlibm","last_synced_at":"2025-04-29T07:33:46.530Z","repository":{"id":38328896,"uuid":"2198696","full_name":"JuliaMath/openlibm","owner":"JuliaMath","description":"High quality system independent, portable, open source libm implementation","archived":false,"fork":false,"pushed_at":"2025-03-07T21:05:45.000Z","size":4328,"stargazers_count":538,"open_issues_count":31,"forks_count":143,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-04-26T07:03:25.721Z","etag":null,"topics":["c","cross-platform","math-library","openlibm"],"latest_commit_sha":null,"homepage":"https://openlibm.org","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JuliaMath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["JuliaLang"]}},"created_at":"2011-08-12T18:58:51.000Z","updated_at":"2025-04-21T07:36:39.000Z","dependencies_parsed_at":"2023-11-12T15:06:11.762Z","dependency_job_id":"45e24198-55c5-490c-9eba-93716a7a03e5","html_url":"https://github.com/JuliaMath/openlibm","commit_stats":{"total_commits":440,"total_committers":69,"mean_commits":"6.3768115942028984","dds":0.7113636363636364,"last_synced_commit":"b3a6e991a4f51c6c87a2e1fda12a1f05e38f5b80"},"previous_names":["julialang/openlibm"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaMath%2Fopenlibm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaMath%2Fopenlibm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaMath%2Fopenlibm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaMath%2Fopenlibm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuliaMath","download_url":"https://codeload.github.com/JuliaMath/openlibm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251456068,"owners_count":21592287,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cross-platform","math-library","openlibm"],"created_at":"2024-08-02T13:00:34.375Z","updated_at":"2025-04-29T07:33:41.521Z","avatar_url":"https://github.com/JuliaMath.png","language":"C","funding_links":["https://github.com/sponsors/JuliaLang"],"categories":["C"],"sub_categories":[],"readme":"# OpenLibm\n\n[![codecov](https://codecov.io/gh/JuliaMath/openlibm/graph/badge.svg?token=eTAdN7d9cg)](https://codecov.io/gh/JuliaMath/openlibm)\n\n[OpenLibm](https://openlibm.org/) is an effort to have a high quality, portable, standalone\nC mathematical library ([`libm`](http://en.wikipedia.org/wiki/libm)).\nIt can be used standalone in applications and programming language\nimplementations.\n\nThe project was born out of a need to have a good `libm` for the\n[Julia programming language](http://www.julialang.org) that worked\nconsistently across compilers and operating systems, and in 32-bit and\n64-bit environments.\n\n## Platform support\n\nOpenLibm builds on Linux, macOS, Windows, FreeBSD, OpenBSD, NetBSD, and\nDragonFly BSD.  It builds with both GCC and clang. Although largely\ntested and widely used on the x86 and x86-64 architectures, OpenLibm\nalso supports arm, aarch64, ppc64le, mips, wasm32, riscv, s390(x) and\nloongarch64.\n\n## Build instructions\n\n### GNU Make\n\n1. Use GNU Make to build OpenLibm. This is `make` on most systems, but `gmake` on BSDs.\n2. Use `make USEGCC=1` to build with GCC. This is the default on\n   Linux and Windows.\n3. Use `make USECLANG=1` to build with clang. This is the default on OS X, FreeBSD,\n   and OpenBSD.\n4. Use `make ARCH=wasm32` to build the wasm32 library with clang.\n5. Architectures are auto-detected. Use `make ARCH=i386` to force a\n   build for i386. Other supported architectures are i486, i586, and\n   i686. GCC 4.8 is the minimum requirement for correct codegen on\n   older 32-bit architectures.\n\n\n**Cross Build**\nTake `riscv64` as example:\n1. install `qemu-riscv64-static`, `gcc-riscv64-linux-gnu`\n2. Cross build:\n```sh\nARCH=riscv64\nTRIPLE=$ARCH-linux-gnu\nmake ARCH=$ARCH TOOLPREFIX=$TRIPLE-  -j\nmake -C test ARCH=$ARCH TOOLPREFIX=$TRIPLE-  -j\n```\n\n3. Run test with qemu:\n```sh\nqemu-$ARCH-static -L . -L /usr/$TRIPLE/  test/test-float\nqemu-$ARCH-static -L . -L /usr/$TRIPLE/  test/test-double\n```\n\n\n### CMake\n\n1. Create build directory with `mkdir build` and navigate into it with `cd build`.\n2. Run CMake to configure project and generate native build system with `cmake /path/to/openlibm/`\nor generate project with build system of choice e.g. `cmake /path/to/openlib/ -G \"MinGW Makefiles\"`.\n3. Build with the build system with `cmake --build .`.\n\nDefault CMake configuration builds a shared library, this can easily be configured using\n[BUILD_SHARED_LIBS](https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html)\nconfiguration option.\n\n\n## Acknowledgements\n\nPowerPC support for openlibm was graciously sponsored by IBM.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJuliaMath%2Fopenlibm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJuliaMath%2Fopenlibm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJuliaMath%2Fopenlibm/lists"}