{"id":15426772,"url":"https://github.com/porges/gmp-mpfr-sys","last_synced_at":"2025-04-05T21:46:40.467Z","repository":{"id":66289418,"uuid":"282728163","full_name":"Porges/gmp-mpfr-sys","owner":"Porges","description":null,"archived":false,"fork":false,"pushed_at":"2020-07-26T20:31:11.000Z","size":12252,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"windows-mpir-support","last_synced_at":"2025-02-12T02:55:35.508Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Porges.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-GPL.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}},"created_at":"2020-07-26T20:30:20.000Z","updated_at":"2020-07-26T20:31:51.000Z","dependencies_parsed_at":"2023-05-01T22:47:55.625Z","dependency_job_id":null,"html_url":"https://github.com/Porges/gmp-mpfr-sys","commit_stats":{"total_commits":427,"total_committers":5,"mean_commits":85.4,"dds":0.00936768149882905,"last_synced_commit":"87e6a385c1a7f57432ed1017909aecae4915120e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Porges%2Fgmp-mpfr-sys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Porges%2Fgmp-mpfr-sys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Porges%2Fgmp-mpfr-sys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Porges%2Fgmp-mpfr-sys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Porges","download_url":"https://codeload.github.com/Porges/gmp-mpfr-sys/tar.gz/refs/heads/windows-mpir-support","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406072,"owners_count":20933802,"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":[],"created_at":"2024-10-01T17:58:01.405Z","updated_at":"2025-04-05T21:46:40.446Z","avatar_url":"https://github.com/Porges.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- Copyright © 2017–2020 University of Malta --\u003e\n\n\u003c!-- Copying and distribution of this file, with or without\nmodification, are permitted in any medium without royalty provided the\ncopyright notice and this notice are preserved. This file is offered\nas-is, without any warranty. --\u003e\n\n# Rust low-level bindings for GMP, MPFR and MPC\n\nThe gmp-mpfr-sys crate provides Rust FFI bindings to the following\n[GNU] arbitrary-precision libraries:\n\n  * [GMP] for integers and rational numbers,\n  * [MPFR] for floating-point numbers, and\n  * [MPC] for complex numbers.\n\nThe source of the three libraries is included in the package.\n\nThe gmp-mpfr-sys crate is free software: you can redistribute it\nand/or modify it under the terms of the GNU Lesser General Public\nLicense as published by the Free Software Foundation, either version 3\nof the License, or (at your option) any later version. See the full\ntext of the [GNU LGPL] and [GNU GPL] for details.\n\n## What’s new\n\n### Version 1.3.1 news (2020-07-17)\n\n  * Fixed MSYS2 build for rustc 1.46.0.\n\n### Version 1.3.0 news (2020-07-13)\n\n  * [MPFR] was updated from version 4.0.2-p9 to 4.1.0.\n  * The internal details of\n    \u003ccode\u003e[gmp][gmp-1-3]::[mpz\\_t][gmp-mpz-1-3]\u003c/code\u003e,\n    \u003ccode\u003e[gmp][gmp-1-3]::[mpf\\_t][gmp-mpf-1-3]\u003c/code\u003e,\n    \u003ccode\u003e[gmp][gmp-1-3]::[randseed\\_t][gmp-randseed-1-3]\u003c/code\u003e and\n    \u003ccode\u003e[mpfr][mpfr-1-3]::[mpfr\\_t][mpfr-mpfr-1-3]\u003c/code\u003e have been\n    changed to use [`NonNull`] instead of [mutable pointers][pointer].\n  * The internal details of\n    \u003ccode\u003e[gmp][gmp-1-3]::[randfnptr\\_t][gmp-randfnptr-1-3]\u003c/code\u003e\n    have been changed to reflect that its functions are not nullable.\n  * Cross compilation will now fail if the experimental feature\n    `force-cross` is not enabled, because cross compilation is not\n    tested or supported and can lead to silent failures that are hard\n    to debug, especially if this crate is an indirect dependency.\n\n[gmp-1-3]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/gmp/index.html\n[gmp-mpf-1-3]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/gmp/struct.mpf_t.html\n[gmp-mpz-1-3]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/gmp/struct.mpz_t.html\n[gmp-randfnptr-1-3]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/gmp/struct.randfnptr_t.html\n[gmp-randseed-1-3]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/gmp/struct.randseed_t.html\n[mpfr-1-3]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/mpfr/index.html\n[mpfr-mpfr-1-3]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/mpfr/struct.mpfr_t.html\n\n[`NonNull`]: https://doc.rust-lang.org/nightly/std/ptr/struct.NonNull.html\n[pointer]: https://doc.rust-lang.org/nightly/std/primitive.pointer.html\n\n### Other releases\n\nDetails on other releases can be found in [*RELEASES.md*].\n\n## Basic features\n\nThis crate contains three modules:\n\n  * [`gmp`] provides external FFI bindings to [GMP].\n  * [`mpfr`] provides external FFI bindings to [MPFR].\n  * [`mpc`] provides external FFI bindings to [MPC].\n\nThe versions provided by this crate release are [GMP] version 6.2.0,\n[MPFR] version 4.1.0, and [MPC] version 1.1.0.\n\nIf you want a high-level API, consider using [Rug][rug crate], a crate\nwhich provides integers and floating-point numbers with arbitrary\nprecision and correct rounding:\n\n  * [`Integer`] is a bignum integer with arbitrary precision,\n  * [`Rational`] is a bignum rational number with arbitrary precision,\n  * [`Float`] is a multi-precision floating-point number with correct\n    rounding, and\n  * [`Complex`] is a multi-precision complex number with correct\n    rounding.\n\n### Name prefixes\n\nSince modules and enumerated types provide namespacing, most prefixes\nin the C names are removed. However, when the prefix is not a whole\nword it is not removed. For example [`mp_set_memory_functions`]\nbecomes [`gmp::set_memory_functions`], but [`mpz_init`] becomes\n[`gmp::mpz_init`] not `gmp::z_init`, and [`MPFR_RNDN`] in\n[`enum MPFR_RND_T`] becomes [`mpfr::rnd_t::RNDN`] not\n`mpfr::rnd_t::N`. Also, the types [`mpfr::mpfr_t`] and [`mpc::mpc_t`]\nare *not* shortened to `mpfr::t` or `mpc::t`.\n\n### Types\n\nUnlike in the C libraries, the types [`gmp::mpz_t`], [`gmp::mpq_t`],\n[`gmp::mpf_t`], [`gmp::randstate_t`], [`mpfr::mpfr_t`] and\n[`mpc::mpc_t`] are defined directly as structs, not as single-element\narrays.\n\n### Undocumented or obsolete functions\n\nThe bindings do not cover undocumented or obsolete functions and\nmacros.\n\n## Using gmp-mpfr-sys\n\nThe gmp-mpfr-sys crate is available on [crates.io][sys crate]. To use\ngmp-mpfr-sys in your crate, add it as a dependency inside\n[*Cargo.toml*]:\n\n```toml\n[dependencies]\ngmp-mpfr-sys = \"1.3\"\n```\n\nThis crate required rustc version 1.37.0 or later.\n\nIf the C libraries have a major version bump with some deprecated\nfunctions removed, but no features are removed in the Rust bindings,\nthen gmp-mpfr-sys will have a minor version bump rather than a major\nversion bump. This allows more compatiblity across crates that use the\nRust bindings but do not use the C libraries directly.\n\nIf on the other hand a dependent crate makes use of internal\nimplementation details, or includes a C library that directly uses the\nheader (*.h*) and library (*.a*) files built using C, it can be a good\nidea to depend on version `\"~1.3\"` instead of version `\"1.3\"` in order\nto ensure backwards compatibility at the C level as well.\n\n## Optional features\n\nThe gmp-mpfr-sys crate has two optional features:\n\n 1. `mpfr`, enabled by default. Required to include the [MPFR]\n    library.\n 2. `mpc`, enabled by default. Required to include the [MPC] library.\n    This feature requires the `mpfr` feature.\n\nThe [GMP] library is always included.\n\nThe two optional features are enabled by default; to use features\nselectively, you can add the dependency like this to [*Cargo.toml*]:\n\n```toml\n[dependencies.gmp-mpfr-sys]\nversion = \"1.3\"\ndefault-features = false\nfeatures = [\"mpfr\"]\n```\n\nHere only the `mpfr` feature is selected.\n\n## Experimental optional features\n\nIt is not considered a breaking change if experimental features are\nremoved. The removal of experimental features would however require a\nminor version bump.\n\nExperimental features may also not work on all platforms.\n\nThere are two experimental feature:\n\n 1. `use-system-libs`, disabled by default. Using this feature, the\n    system libraries for [GMP], and [MPFR] and [MPC] if enabled, will\n    be used instead of building them from source. The versions must be\n    compatible with the versions provided by the crate.\n 2. `force-cross`, disabled by default. Without this feature, the\n    build will fail if cross compilation is detected, because cross\n    compilation is not tested or supported and can lead to silent\n    failures that are hard to debug, especially if this crate is an\n    indirect dependency. As an exception, cross compiling from x86_64\n    to i686 does not need this feature.\n\n## Metadata\n\nThe gmp-mpfr-sys crate passes some metadata to its dependents:\n\n 1. `DEP_GMP_LIMB_BITS` contains the number of bits per limb, which is\n    32 or 64.\n 2. `DEP_GMP_OUT_DIR` contains the path of a directory that contains\n    two subdirectories: the first subdirectory is named *lib* and\n    contains the generated library (*.a*) files, and the second\n    subdirectory is named *include* and contains the corresponding\n    header (*.h*) files.\n 3. `DEP_GMP_LIB_DIR` contains the path of the *lib* subdirectory of\n    the `DEP_GMP_OUT_DIR` directory.\n 4. `DEP_GMP_INCLUDE_DIR` contains the path of the *include*\n    subdirectory of the `DEP_GMP_OUT_DIR` directory.\n\nA dependent crate can use these environment variables in its build\nscript.\n\n## Building on GNU/Linux\n\nTo build on GNU/Linux, simply make sure you have `diffutils`, `gcc`,\n`make` and `m4` installed on your system. For example on Fedora:\n\n```sh\nsudo dnf install diffutils gcc make m4\n```\n\n## Building on macOS\n\nTo build on macOS, you need the command-line developer tools. To\ninstall them, run the following command in a terminal:\n\n```sh\nxcode-select --install\n```\n\n## Building on Windows\n\nYou can build on Windows with the Rust GNU toolchain and an up-to-date\nMSYS2 installation. Some steps for a 64-bit environment are listed\nbelow. (32-bit: Changes for a 32-bit environment are written in\nbrackets like this comment.)\n\nTo install MSYS2:\n\n 1. Install MSYS2 using the [installer][msys].\n\n 2. Launch the MSYS2 MinGW 64-bit terminal from the start\n    menu. (32-bit: Launch the MSYS2 MinGW 32-bit terminal instead.)\n\n 3. Install the required tools.\n\n    ```sh\n    pacman -S pacman-mirrors\n    pacman -S diffutils make mingw-w64-x86_64-gcc\n    ```\n\n    (32-bit: Install `mingw-w64-i686-gcc` instead of\n    `mingw-w64-x86_64-gcc`.)\n\nThen, to build a crate with a dependency on this crate:\n\n 1. Launch the MSYS2 MinGW 64-bit terminal from the start menu.\n    (32-bit: Launch the MSYS2 MinGW 32-bit terminal instead.)\n\n 2. Change to the crate directory.\n\n 3. Build the crate using `cargo`.\n\n## Cross compilation\n\nWhile some cross compilation is possible, it is not tested\nautomatically, and may not work. Merge requests that improve cross\ncompilation are accepted.\n\nFrom the next minor version 1.3 onwards, the experimental feature\n`force-cross` must be enabled for cross compilation. There is one case\nwhich is allowed even without the feature: when the only difference\nbetween host and target is that the host is x86_64 and the target is\ni686.\n\n## Caching the built C libraries\n\nBuilding the C libraries can take some time. In order to save\ncompilation time, the built libraries are cached in the user’s cache\ndirectory as follows:\n\n  * on GNU/Linux: inside `$XDG_CACHE_HOME/gmp-mpfr-sys` or\n    `$HOME/.cache/gmp-mpfr-sys`\n  * on macOS: inside `$HOME/Library/Caches/gmp-mpfr-sys`\n  * on Windows: inside `{FOLDERID_LocalAppData}\\gmp-mpfr-sys`\n\nTo use a different directory, you can set the environment variable\n`GMP_MPFR_SYS_CACHE` to the desired cache directory. Setting the\n`GMP_MPFR_SYS_CACHE` variable to an empty string will disable caching.\n\n[*Cargo.toml*]: https://doc.rust-lang.org/cargo/guide/dependencies.html\n[*RELEASES.md*]: https://gitlab.com/tspiteri/gmp-mpfr-sys/blob/master/RELEASES.md\n[GMP]: https://gmplib.org/\n[GNU GPL]: https://www.gnu.org/licenses/gpl-3.0.html\n[GNU LGPL]: https://www.gnu.org/licenses/lgpl-3.0.en.html\n[GNU]: https://www.gnu.org/\n[MPC]: http://www.multiprecision.org/mpc/\n[MPFR]: https://www.mpfr.org/\n[`Complex`]: https://docs.rs/rug/*/rug/struct.Complex.html\n[`Float`]: https://docs.rs/rug/*/rug/struct.Float.html\n[`Integer`]: https://docs.rs/rug/*/rug/struct.Integer.html\n[`MPFR_RNDN`]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/C/MPFR/constant.MPFR_Basics.html#Rounding-Modes\n[`Rational`]: https://docs.rs/rug/*/rug/struct.Rational.html\n[`enum MPFR_RND_T`]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/C/MPFR/constant.MPFR_Basics.html#index-mpfr_005frnd_005ft\n[`gmp::mpf_t`]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/gmp/struct.mpf_t.html\n[`gmp::mpq_t`]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/gmp/struct.mpq_t.html\n[`gmp::mpz_init`]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/gmp/fn.mpz_init.html\n[`gmp::mpz_t`]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/gmp/struct.mpz_t.html\n[`gmp::randstate_t`]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/gmp/struct.randstate_t.html\n[`gmp::set_memory_functions`]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/gmp/fn.set_memory_functions.html\n[`gmp`]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/gmp/index.html\n[`mp_set_memory_functions`]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/C/GMP/constant.Custom_Allocation.html#index-mp_005fset_005fmemory_005ffunctions\n[`mpc::mpc_t`]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/mpc/struct.mpc_t.html\n[`mpc`]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/mpc/index.html\n[`mpfr::mpfr_t`]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/mpfr/struct.mpfr_t.html\n[`mpfr::rnd_t::RNDN`]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/mpfr/enum.rnd_t.html#variant.RNDN\n[`mpfr`]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/mpfr/index.html\n[`mpz_init`]: https://docs.rs/gmp-mpfr-sys/~1.3/gmp_mpfr_sys/C/GMP/constant.Integer_Functions.html#index-mpz_005finit\n[msys]: https://www.msys2.org/\n[rug crate]: https://crates.io/crates/rug\n[sys crate]: https://crates.io/crates/gmp-mpfr-sys\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fporges%2Fgmp-mpfr-sys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fporges%2Fgmp-mpfr-sys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fporges%2Fgmp-mpfr-sys/lists"}