{"id":40339712,"url":"https://github.com/numpy/numpy-quaddtype","last_synced_at":"2026-01-22T11:01:44.820Z","repository":{"id":333551454,"uuid":"1135618271","full_name":"numpy/numpy-quaddtype","owner":"numpy","description":"A cross-platform Quad (128-bit) float Data-Type for NumPy.","archived":false,"fork":false,"pushed_at":"2026-01-21T18:06:54.000Z","size":916,"stargazers_count":3,"open_issues_count":10,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-01-21T19:42:51.495Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/numpy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"open_collective":"numpy","tidelift":"pypi/numpy","custom":"https://numpy.org/about/#donate"}},"created_at":"2026-01-16T10:57:56.000Z","updated_at":"2026-01-21T18:06:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/numpy/numpy-quaddtype","commit_stats":null,"previous_names":["numpy/numpy-quaddtype"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/numpy/numpy-quaddtype","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numpy%2Fnumpy-quaddtype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numpy%2Fnumpy-quaddtype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numpy%2Fnumpy-quaddtype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numpy%2Fnumpy-quaddtype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numpy","download_url":"https://codeload.github.com/numpy/numpy-quaddtype/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numpy%2Fnumpy-quaddtype/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28661882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2026-01-20T09:00:32.049Z","updated_at":"2026-01-22T11:01:44.802Z","avatar_url":"https://github.com/numpy.png","language":"Python","readme":"# NumPy-QuadDType\n\n[![PyPI](https://img.shields.io/pypi/v/numpy-quaddtype.svg)](https://pypi.org/project/numpy-quaddtype/)\n[![PyPI Downloads](https://static.pepy.tech/badge/numpy-quaddtype/month)](https://pepy.tech/project/numpy-quaddtype)\n[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/numpy_quaddtype.svg?label=Conda%20downloads)](https://anaconda.org/conda-forge/numpy_quaddtype)\n[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://numpy.org/numpy-quaddtype/)\n[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat\u0026colorA=E1523D\u0026colorB=007D8A)](https://numfocus.org)\n\nA cross-platform Quad (128-bit) float Data-Type for NumPy.\n\n**[📖 Read the full documentation](https://numpy.org/numpy-quaddtype/)**\n\n## Table of Contents\n\n- [NumPy-QuadDType](#numpy-quaddtype)\n  - [Table of Contents](#table-of-contents)\n  - [Installation](#installation)\n  - [Usage](#usage)\n  - [Installation from source](#installation-from-source)\n    - [Linux/Unix/macOS](#linuxunixmacos)\n    - [Windows](#windows)\n  - [Building with ThreadSanitizer (TSan)](#building-with-threadsanitizer-tsan)\n  - [Building the documentation](#building-the-documentation)\n    - [Serving the documentation](#serving-the-documentation)\n  - [Development Tips](#development-tips)\n    - [Cleaning the Build Directory](#cleaning-the-build-directory)\n\n## Installation\n\n```bash\npip install \"numpy\u003e=2.4\"\npip install numpy-quaddtype\n```\n\n## Usage\n\n```python\nimport numpy as np\nfrom numpy_quaddtype import QuadPrecDType, QuadPrecision\n\n# using sleef backend (default)\nnp.array([1,2,3], dtype=QuadPrecDType())\nnp.array([1,2,3], dtype=QuadPrecDType(\"sleef\"))\n\n# using longdouble backend\nnp.array([1,2,3], dtype=QuadPrecDType(\"longdouble\"))\n```\n\n## Installation from source\n\n### Linux/Unix/macOS\n\n**Prerequisites:** gcc/clang, CMake (≥3.15), Python 3.11+, Git, NumPy ≥ 2.4\n\n```bash\n# setup the virtual env\npython3 -m venv temp\nsource temp/bin/activate\n\n# Install build and test dependencies\npip install pytest meson meson-python \"numpy\u003e=2.4\"\n\n# To build without QBLAS (default for MSVC)\n# export CFLAGS=\"-DDISABLE_QUADBLAS\"\n# export CXXFLAGS=\"-DDISABLE_QUADBLAS\"\n\npython -m pip install \".[test]\" -v\n\n# Run the tests\npython -m pytest tests\n```\n\n### Windows\n\n**Prerequisites:** Visual Studio 2017+ (with MSVC), CMake (≥3.15), Python 3.11+, Git\n\n1. **Setup Development Environment**\n\n   Open a **Developer Command Prompt for VS** or **Developer PowerShell for VS** to ensure MSVC is properly configured.\n\n2. **Setup Python Environment**\n\n   ```powershell\n   # Create and activate virtual environment\n   python -m venv numpy_quad_env\n   .\\numpy_quad_env\\Scripts\\Activate.ps1\n\n   # Install build dependencies\n   pip install -U pip\n   pip install numpy pytest ninja meson\n   ```\n\n3. **Set Environment Variables**\n\n   ```powershell\n   # Note: QBLAS is disabled on Windows due to MSVC compatibility issues\n   $env:CFLAGS = \"/DDISABLE_QUADBLAS\"\n   $env:CXXFLAGS = \"/DDISABLE_QUADBLAS\"\n   ```\n\n4. **Build and Install numpy-quaddtype**\n\n   ```powershell\n   # Build and install the package\n   python -m pip install \".[test]\" -v\n   ```\n\n5. **Test Installation**\n\n   ```powershell\n   # Run tests\n   pytest -s tests\n   ```\n\n6. **QBLAS Disabled**: QuadBLAS optimization is automatically disabled on Windows builds due to MSVC compatibility issues. This is handled by the `-DDISABLE_QUADBLAS` compiler flag.\n\n7. **Visual Studio Version**: The instructions assume Visual Studio 2022. For other versions, adjust the generator string:\n\n   - VS 2019: `\"Visual Studio 16 2019\"`\n   - VS 2017: `\"Visual Studio 15 2017\"`\n\n8. **Architecture**: The instructions are for x64. For x86 builds, change `-A x64` to `-A Win32`.\n\n## Building with ThreadSanitizer (TSan)\n\nThis is a development feature to help detect threading issues. To build `numpy-quaddtype` with TSan enabled, follow these steps:\n\n\u003e Use of clang is recommended with machine NOT supporting `libquadmath` (like ARM64). Set the compiler to clang/clang++ before proceeding.\n\u003e\n\u003e ```bash\n\u003e export CC=clang\n\u003e export CXX=clang++\n\u003e ```\n\n1. Compile free-threaded CPython with TSan support. Follow the [Python Free-Threading Guide](https://py-free-threading.github.io/thread_sanitizer/#compile-free-threaded-cpython-with-tsan) for detailed instructions.\n2. Create and activate a virtual environment using the TSan-enabled Python build.\n3. Installing dependencies:\n\n```bash\npython -m pip install meson meson-python wheel ninja\n# Need NumPy built with TSan as well\npython -m pip install \"numpy @ git+https://github.com/numpy/numpy\" -C'setup-args=-Db_sanitize=thread'\n```\n\n4. Building SLEEF with TSan:\n\n```bash\n# clone the repository\ngit clone https://github.com/shibatch/sleef.git\ncd sleef\ngit checkout 43a0252ba9331adc7fb10755021f802863678c38\n\n# Build SLEEF with TSan\ncmake \\\n-DCMAKE_C_COMPILER=clang \\\n-DCMAKE_CXX_COMPILER=clang++ \\\n-DCMAKE_C_FLAGS=\"-fsanitize=thread -g -O1\" \\\n-DCMAKE_CXX_FLAGS=\"-fsanitize=thread -g -O1\" \\\n-DCMAKE_EXE_LINKER_FLAGS=\"-fsanitize=thread\" \\\n-DCMAKE_SHARED_LINKER_FLAGS=\"-fsanitize=thread\" \\\n-DSLEEF_BUILD_QUAD=ON \\\n-DSLEEF_BUILD_TESTS=OFF \\\n-DCMAKE_INSTALL_PREFIX=/usr/local\n-S . -B build\n\ncmake --build build -j --clean-first\ncmake --install build\n```\n\n5. Build and install `numpy-quaddtype` with TSan:\n\n```bash\n# SLEEF is already installed with TSan, we need to provide proper flags to numpy-quaddtype's meson file\n# So that it does not build SLEEF again and use the installed one.\n\nexport CFLAGS=\"-fsanitize=thread -g -O0\"\nexport CXXFLAGS=\"-fsanitize=thread -g -O0\"\nexport LDFLAGS=\"-fsanitize=thread\"\npython -m pip install . -vv -Csetup-args=-Db_sanitize=thread\n```\n\n## Building the documentation\n\nThe documentation for the `numpy-quaddtype` package is built using Sphinx. To build the documentation, follow these steps:\n\n1. Install the required dependencies:\n\n   ```bash\n   pip install .\"[docs]\"\n   ```\n\n2. Navigate to the `docs` directory and build the documentation:\n\n   ```bash\n   cd docs/\n   make html\n   ```\n\n3. The generated HTML documentation can be found in the `_build/html` directory within the `docs` folder. Open the `index.html` file in a web browser to view the documentation, or use a local server to serve the files:\n\n   ```bash\n   python3 -m http.server --directory _build/html\n   ```\n\n### Serving the documentation\n\nThe documentation is automatically built and served using GitHub Pages. Every time changes are pushed to the `main` branch, the documentation is rebuilt and deployed to the `gh-pages` branch of the repository. You can access the documentation at:\n\n```\nhttps://numpy.org/numpy-quaddtype/\n```\n\nCheck the `.github/workflows/build_docs.yml` file for details.\n\n## Development Tips\n\n### Cleaning the Build Directory\n\nThe subproject folders (`subprojects/sleef`, `subprojects/qblas`) are cloned as git repositories. To fully clean them, use double force:\n\n```bash\ngit clean -ffxd\n```\n","funding_links":["https://opencollective.com/numpy","https://tidelift.com/funding/github/pypi/numpy","https://numpy.org/about/#donate"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumpy%2Fnumpy-quaddtype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumpy%2Fnumpy-quaddtype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumpy%2Fnumpy-quaddtype/lists"}