C Runtime, Compiler and Build System Generator¶
scikit-build uses sensible defaults allowing to select the C runtime matching the official CPython recommendations. It also ensures developers remain productive by selecting an alternative environment if recommended one is not available.
The table below lists the different C runtime implementations, compilers and their usual distribution mechanisms for each operating systems.
|C runtime||GNU C Library (glibc)||libSystem library||Microsoft C run-time library|
|Compiler||GNU compiler (gcc)||clang||Microsoft C/C++ Compiler (cl.exe)|
|Provenance||Package manager||OSX SDK within XCode|
Build system generator¶
Since scikit-build simply provides glue between setuptools and CMake, it needs to choose a CMake generator to configure the build system allowing to build of CPython C extensions.
The table below lists the generator supported by scikit-build:
When building a project, scikit-build iteratively tries each generator (in the order listed in the table) until it finds a working one.
For more details about CMake generators, see CMake documentation.
- Supported platform(s): Linux, MacOSX and Windows
- If ninja executable is in the
PATH, the associated generator is used to setup the project build system based on
An advantage of ninja is that it automatically parallelizes the build based on the number of CPUs.
Ninja on Windows
When Ninja generator is used on Windows, scikit-build will make sure the
project is configured and built with the appropriate 
environment (equivalent of calling
- Supported platform(s): Linux, MacOSX
- scikit-build uses this generator to generate a traditional
Makefilebased build system.
Visual Studio IDE¶
- Supported platform(s): Windows
- scikit-build uses the generator corresponding to selected version of
Visual Studio and generate a
solution filebased build system.
|CPython Version||x86 (32-bit)||x64 (64-bit)|
|3.5 and above||Visual Studio 14 2015||Visual Studio 14 2008 Win64|
|3.3 to 3.4||Visual Studio 10 2010||Visual Studio 10 2010 Win64|
|2.7 to 3.2||Visual Studio 9 2008||Visual Studio 9 2008 Win64|
- Supported platform(s): Windows
- scikit-build will make sure the project is configured and built with the
appropriate  environment (equivalent of calling
NMake Makefiles JOM
The NMake Makefiles JOM generator is supported but it is not automatically
used by scikit-build (even if jom executable is in the
it always needs to be explicitly specified. For example:
python setup.py build -G "NMake Makefiles JOM"
For more details, see scikit-build options.
scikit-build uses the toolchain set using
CXX) environment variables. If
no environment variable is set, it defaults to
To build compliant Linux wheels, scikit-build also supports the
platform described in PEP-0513. We
recommend the use of dockcross/manylinux-x64 and
dockcross/manylinux-x86. These images are
optimized for building Linux wheels using scikit-build.
To be documented
Microsoft C run-time and Visual Studio version¶
On windows, scikit-build looks for the version of Visual Studio matching the version of CPython being used. The selected Visual Studio version also defines which Microsoft C run-time and compiler are used:
|Python version||2.7 to 3.2||3.3 to 3.4||3.5 and above|
|Microsoft C run-time||msvcr90.dll||msvcr100.dll||ucrtbase.dll|
|Compiler version||MSVC++ 9.0||MSVC++ 10.0||MSVC++ 14.0|
|Visual Studio version||2008||2010||2015|
Installing compiler and Microsoft C run-time¶
As outlined above, installing a given version of Visual Studio will automatically install the corresponding compiler along with the Microsoft C run-time libraries.
This means that if you already have the corresponding version of Visual Studio installed, your environment is ready.
Nevertheless, since older version of Visual Studio are not available anymore, this next table references links for installing alternative environments:
|CPython version||Download links for Windows SDK or Visual Studio|
|3.5 and above||
|3.3 to 3.4||Windows SDK for Windows 7 and .NET 4.0|
|2.7 to 3.2||Microsoft Visual C++ Compiler for Python 2.7|
These links have been copied from the great article  of Steve Dower, engineer at Microsoft.
|||How to deal with the pain of “unable to find vcvarsall.bat”|
|||(1, 2) Implementation details: This is made possible by internally using the function |