![tests](https://github.com/JGoutin/compilertools/workflows/tests/badge.svg)
[![codecov](https://codecov.io/gh/JGoutin/compilertools/branch/master/graph/badge.svg)](https://codecov.io/gh/JGoutin/compilertools)
[![PyPI](https://img.shields.io/pypi/v/compilertools.svg)](https://pypi.org/project/compilertools)
Python uses the Wheel format for simplified package distribution. However,
it does not allow distributing packages optimized for each machine but highly compatible ones.
The user must compile the package himself to take advantage of optimization like SIMD (SSE, AVX, FMA, ...).
Compilertools allows working around this problem and distributing optimized packages for several machines while keeping
the simplicity of Wheel. It works in the background and has been created with the aim of being easy to use.
Package maintainer requires only importing it at runtime and buildtime. Everything is transparent for the end user.
Its secondary objective is also to help the package maintainer to optimally compile its package with multiple compilers
by configuring options for him.
Documentation:
--------------
[**Compilertools Documentation**](https://jgoutin.github.io/compilertools/)
Features:
---------
* Compiles and distributes optimized binaries for a variety of machines in a single Wheel package.
* Helps to build optimized package from sources for current machine.
* Handles automatically compiling and linking options for a variety of compilers.
* Autodetects openMP, OpenACC or Intel Cilk Plus in source code and automatically sets related compiling and linking
options.
* Support extra compiling options like fast math.
* Provides build time settings for package maintainer to tweak compilation.
* Provides API for getting information on current machine CPU.
* Lightweight pure Python module with no dependency that uses lazy import and evaluation as possible.
How that works ?
================
Compilertools dynamically sets link options and compiles options depending on the currently used compiler and targeted
architecture.
This avoids having to specify compiler-specific options in sources or setup files.
Multi-architecture optimized compilation for distribution
---------------------------------------------------------
**At build time:**
Compilertools helps to make optimized ".so"/".pyd" for each architecture and name files with tagged suffixes :
Example:
* *module.avx2.cp36-win_amd64.pyd* -> Optimized variant for AVX2 SIMD Extensions
* *module.avx.cp36-win_amd64.pyd* -> Optimized variant for AVX SIMD Extensions
* *module.cp36-win_amd64.pyd* -> Classic highly-compatible variant
These optimized files are packaged in the same wheel when distributing (Don't need to create a wheel by variant).
Requirement:
* Import ``compilertools.build`` before build module normally.
* Options can easily be changed directly in ``compilertools.build.CONFIG_BUILD`` dictionary.
**At runtime:**
Compilertools detects and chooses the best optimized ".so"/".pyd" to run based on CPU information.
If the best file not exists, search for the second best file, etc... If nothing found, use the highly-compatible one.
Requirement:
* Import ``compilertools`` one time before import-optimized modules (This adds a new import hook to Python).
Current-architecture optimized compilation
------------------------------------------
Compilertools finds the best compiler options for the current architecture and current compiler and build only one
optimized ".so"/".pyd" with classic name.
Requirement:
* Import ``compilertools.build`` before build module normally.
And also...
-----------
openMP, OpenACC, Intel Cilk Plus API auto-detection:
Compilertools searches in source files for API ``pragma`` preprocessor calls and enables compiler and linker options
if needed.
Extra generic compilers options:
Compilertools can enable or disable generic extra compiler options like fast math.
Compatibility
=============
Supported Compilers
-------------------
Compilertools implements support for the following compilers:
* GCC
* LLVM Clang
* Microsoft Visual C++
Supported Processors
--------------------
Compilertools implements support for the following CPU:
* x86 (32 and 64 bits)
Build tools compatibility
-------------------------
Compilertools has been tested with the following build tools:
* Distutils
* Setuptools
* Numpy.distutils
* Cython
Raw data
{
"_id": null,
"home_page": "https://github.com/JGoutin/compilertools",
"name": "compilertools",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "compiler,distutils,setuptools,build_ext,wheels,setup,build",
"author": "J.Goutin",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/25/f1/e0585f2ba2c25ff2fda63d144efc2da7e0163f1d68bd3a9319df1f96abe7/compilertools-1.1.5.tar.gz",
"platform": null,
"description": "![tests](https://github.com/JGoutin/compilertools/workflows/tests/badge.svg)\n[![codecov](https://codecov.io/gh/JGoutin/compilertools/branch/master/graph/badge.svg)](https://codecov.io/gh/JGoutin/compilertools)\n[![PyPI](https://img.shields.io/pypi/v/compilertools.svg)](https://pypi.org/project/compilertools)\n\nPython uses the Wheel format for simplified package distribution. However,\nit does not allow distributing packages optimized for each machine but highly compatible ones.\nThe user must compile the package himself to take advantage of optimization like SIMD (SSE, AVX, FMA, ...).\n\nCompilertools allows working around this problem and distributing optimized packages for several machines while keeping\nthe simplicity of Wheel. It works in the background and has been created with the aim of being easy to use.\nPackage maintainer requires only importing it at runtime and buildtime. Everything is transparent for the end user.\n\nIts secondary objective is also to help the package maintainer to optimally compile its package with multiple compilers\nby configuring options for him.\n\nDocumentation:\n--------------\n[**Compilertools Documentation**](https://jgoutin.github.io/compilertools/)\n\n\nFeatures:\n---------\n\n* Compiles and distributes optimized binaries for a variety of machines in a single Wheel package.\n* Helps to build optimized package from sources for current machine.\n* Handles automatically compiling and linking options for a variety of compilers.\n* Autodetects openMP, OpenACC or Intel Cilk Plus in source code and automatically sets related compiling and linking\n options.\n* Support extra compiling options like fast math.\n* Provides build time settings for package maintainer to tweak compilation.\n* Provides API for getting information on current machine CPU.\n* Lightweight pure Python module with no dependency that uses lazy import and evaluation as possible.\n\nHow that works ?\n================\n\nCompilertools dynamically sets link options and compiles options depending on the currently used compiler and targeted\narchitecture.\n\nThis avoids having to specify compiler-specific options in sources or setup files.\n\nMulti-architecture optimized compilation for distribution\n---------------------------------------------------------\n\n**At build time:**\n\nCompilertools helps to make optimized \".so\"/\".pyd\" for each architecture and name files with tagged suffixes :\n\nExample:\n\n* *module.avx2.cp36-win_amd64.pyd* -> Optimized variant for AVX2 SIMD Extensions\n* *module.avx.cp36-win_amd64.pyd* -> Optimized variant for AVX SIMD Extensions\n* *module.cp36-win_amd64.pyd* -> Classic highly-compatible variant\n\nThese optimized files are packaged in the same wheel when distributing (Don't need to create a wheel by variant).\n\nRequirement:\n\n* Import ``compilertools.build`` before build module normally.\n* Options can easily be changed directly in ``compilertools.build.CONFIG_BUILD`` dictionary.\n\n**At runtime:**\n\nCompilertools detects and chooses the best optimized \".so\"/\".pyd\" to run based on CPU information.\n\nIf the best file not exists, search for the second best file, etc... If nothing found, use the highly-compatible one.\n\nRequirement:\n\n* Import ``compilertools`` one time before import-optimized modules (This adds a new import hook to Python).\n\nCurrent-architecture optimized compilation\n------------------------------------------\n\nCompilertools finds the best compiler options for the current architecture and current compiler and build only one\noptimized \".so\"/\".pyd\" with classic name.\n\nRequirement:\n\n* Import ``compilertools.build`` before build module normally.\n\nAnd also...\n-----------\n\nopenMP, OpenACC, Intel Cilk Plus API auto-detection:\n Compilertools searches in source files for API ``pragma`` preprocessor calls and enables compiler and linker options\n if needed.\n\nExtra generic compilers options:\n Compilertools can enable or disable generic extra compiler options like fast math.\n\nCompatibility\n=============\n\nSupported Compilers\n-------------------\n\nCompilertools implements support for the following compilers:\n\n* GCC\n* LLVM Clang\n* Microsoft Visual C++\n\nSupported Processors\n--------------------\n\nCompilertools implements support for the following CPU:\n\n* x86 (32 and 64 bits)\n\nBuild tools compatibility\n-------------------------\n\nCompilertools has been tested with the following build tools:\n\n* Distutils\n* Setuptools\n* Numpy.distutils\n* Cython\n",
"bugtrack_url": null,
"license": "BSD-2-Clause",
"summary": "A library for helping optimizing Python extensions compilation.",
"version": "1.1.5",
"project_urls": {
"Documentation": "https://jgoutin.github.io/compilertools/",
"Homepage": "https://github.com/JGoutin/compilertools",
"Repository": "https://github.com/JGoutin/compilertools"
},
"split_keywords": [
"compiler",
"distutils",
"setuptools",
"build_ext",
"wheels",
"setup",
"build"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bc9cd2acf0801738cc64944cf7505eaeb580033d32b114bcf9b48acebdbfe5cb",
"md5": "c21acd7ceb5f9730878b066da8e56ff8",
"sha256": "701d6f4f9884ac606a4e52af2a24fd02f117df2b1da3b01ae1e7050ca2e76a59"
},
"downloads": -1,
"filename": "compilertools-1.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c21acd7ceb5f9730878b066da8e56ff8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 25040,
"upload_time": "2023-05-05T21:34:13",
"upload_time_iso_8601": "2023-05-05T21:34:13.621975Z",
"url": "https://files.pythonhosted.org/packages/bc/9c/d2acf0801738cc64944cf7505eaeb580033d32b114bcf9b48acebdbfe5cb/compilertools-1.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "25f1e0585f2ba2c25ff2fda63d144efc2da7e0163f1d68bd3a9319df1f96abe7",
"md5": "3131aadd1c8b766a53e10d2bcf42b933",
"sha256": "6b516ad32916b8c2fbcd69fd90ab9762dff765a158ae9628a83b9298c3fc7997"
},
"downloads": -1,
"filename": "compilertools-1.1.5.tar.gz",
"has_sig": false,
"md5_digest": "3131aadd1c8b766a53e10d2bcf42b933",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 18396,
"upload_time": "2023-05-05T21:34:15",
"upload_time_iso_8601": "2023-05-05T21:34:15.340219Z",
"url": "https://files.pythonhosted.org/packages/25/f1/e0585f2ba2c25ff2fda63d144efc2da7e0163f1d68bd3a9319df1f96abe7/compilertools-1.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-05 21:34:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "JGoutin",
"github_project": "compilertools",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "compilertools"
}