From 9cb796edcd5bc46328cf1c16d30018873fd562d9 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Sun, 1 Dec 2019 23:54:45 +0100 Subject: [PATCH] update docs --- docs/cpp_standards.md | 31 +++++++++++++++++++++++++++++++ docs/options.md | 18 +++++++++--------- mkdocs.yml | 1 + 3 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 docs/cpp_standards.md diff --git a/docs/cpp_standards.md b/docs/cpp_standards.md new file mode 100644 index 00000000..aac299cb --- /dev/null +++ b/docs/cpp_standards.md @@ -0,0 +1,31 @@ +--- +title: Modern C++ standards +--- + +Building Python wheels with modern C++ (C++11) requires a few tricks. + +Creating wheel for python 2.7 which need c++17 needs special configuration because python 2.7 header files using `register` keyword. +In c++17 this keyword is reserved ((see)[https://en.cppreference.com/w/cpp/keyword/register]) +It is possible to allow usage of `register` using proper flag `-Wno-register` for gcc/clang and `/wd5033` for MSVC. + +## Linux +When using default `manylinux1` image it is possible to use only c++11 and earlier standards. +This is about how you can make C++14 wheels in `manylinux1`, through some tricks https://github.com/pypa/manylinux/issues/118 + +`manylinux2010` supports all C++ standards (up to c++17). + +## MacOS + +To get C++11 and C++14 support, set `MACOSX_DEPLOYMENT_TARGET` variable to `"10.9"`. + +To get C++17 support, set `MACOSX_DEPLOYMENT_TARGET` variable to `"10.13"` or `"10.14"`. (`"10.13"` supports C++17 partially, e.g. the filesystem header is in experimental: `#include ` -> `#include `) + +For more details see https://en.cppreference.com/w/cpp/compiler_support and https://xcodereleases.com/ +(Xcode 10 needs MacOs 10.13 and Xcode 11 needs MacOS 10.14) + +## Windows + +Visual C++ for Python 2.7 does not support modern standards of C++. +When building on Appveyor, you'll need to use either the 'Visual Studio 2017' or 'Visual Studio 2019' image. Note that Python 2.7 isn't supported on these images - you should skip it using `CIBW_SKIP=cp27-win*`. + +There is option for workaround this limitation. PyBind project has in documentation example how to compile python 2.7 extension with newer compiler https://github.com/pybind/python_example \ No newline at end of file diff --git a/docs/options.md b/docs/options.md index da407032..df7d1a2a 100644 --- a/docs/options.md +++ b/docs/options.md @@ -64,7 +64,7 @@ This option can also be set using the command-line option `--platform`. > Choose the Python versions to build -Space-separated list of builds to build and skip. Each build has an identifier like `cp27-manylinux_x86_64` or `cp35-macosx_10_6_intel` - you can list specific ones to build and `cibuildwheel` will only build those, and/or list ones to skip and `cibuildwheel` won't try to build them. +Space-separated list of builds to build and skip. Each build has an identifier like `cp27-manylinux_x86_64` or `cp35-macosx_intel` - you can list specific ones to build and `cibuildwheel` will only build those, and/or list ones to skip and `cibuildwheel` won't try to build them. When both options are specified, both conditions are applied and only builds with a tag that matches `CIBW_BUILD` and does not match `CIBW_SKIP` will be built. @@ -72,13 +72,13 @@ When setting the options, you can use shell-style globbing syntax (as per `fnmat
-| | macOS 64bit | macOS 32/64bit | Manylinux 64bit | Manylinux 32bit | Windows 64bit | Windows 32bit | -|------------|-------------------------|------------------------|------------------------|----------------------|-----------------|----------------| -| Python 2.7 | | cp27-macosx_10_6_intel | cp27-manylinux_x86_64 | cp27-manylinux_i686 | cp27-win_amd64 | cp27-win32 | -| Python 3.5 | | cp35-macosx_10_6_intel | cp35-manylinux_x86_64 | cp35-manylinux_i686 | cp35-win_amd64 | cp35-win32 | -| Python 3.6 | | cp36-macosx_10_6_intel | cp36-manylinux_x86_64 | cp36-manylinux_i686 | cp36-win_amd64 | cp36-win32 | -| Python 3.7 | | cp37-macosx_10_6_intel | cp37-manylinux_x86_64 | cp37-manylinux_i686 | cp37-win_amd64 | cp37-win32 | -| Python 3.8 | cp38-macosx_10_9_x86_64 | | cp38-manylinux_x86_64 | cp38-manylinux_i686 | cp38-win_amd64 | cp38-win32 | +| | macOS 64bit | macOS 32/64bit | Manylinux 64bit | Manylinux 32bit | Windows 64bit | Windows 32bit | +|------------|--------------------|-------------------|------------------------|----------------------|-----------------|----------------| +| Python 2.7 | | cp27-macosx_intel | cp27-manylinux_x86_64 | cp27-manylinux_i686 | cp27-win_amd64 | cp27-win32 | +| Python 3.5 | | cp35-macosx_intel | cp35-manylinux_x86_64 | cp35-manylinux_i686 | cp35-win_amd64 | cp35-win32 | +| Python 3.6 | | cp36-macosx_intel | cp36-manylinux_x86_64 | cp36-manylinux_i686 | cp36-win_amd64 | cp36-win32 | +| Python 3.7 | | cp37-macosx_intel | cp37-manylinux_x86_64 | cp37-manylinux_i686 | cp37-win_amd64 | cp37-win32 | +| Python 3.8 | cp38-macosx_x86_64 | | cp38-manylinux_x86_64 | cp38-manylinux_i686 | cp38-win_amd64 | cp38-win32 | The list of supported and currently selected build identifiers can also be retrieved by passing the `--print-build-identifiers` flag to `cibuildwheel`. The format is `python_tag-platform_tag`, with tags similar to those in [PEP 425](https://www.python.org/dev/peps/pep-0425/#details). @@ -90,7 +90,7 @@ The format is `python_tag-platform_tag`, with tags similar to those in [PEP 425] CIBW_BUILD: cp36-* # Skip building on Python 2.7 on the Mac -CIBW_SKIP: cp27-macosx_10_6_intel +CIBW_SKIP: cp27-macosx_intel # Skip building on Python 3.8 on the Mac CIBW_SKIP: cp38-macosx_10_9_x86_64 diff --git a/mkdocs.yml b/mkdocs.yml index 43e5be2d..5c12f501 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -18,6 +18,7 @@ nav: - setup.md - options.md - deliver-to-pypi.md + - cpp_standards.md - faq.md - contributing.md