From brumfessor at gmx.net Tue Apr 28 13:37:36 2020 From: brumfessor at gmx.net (=?UTF-8?Q?=22Torsten_Kn=C3=BCppel=22?=) Date: Tue, 28 Apr 2020 19:37:36 +0200 Subject: [C++-sig] Compiling boost python Message-ID: An HTML attachment was scrubbed... URL: From jandyman.voelkel at gmail.com Wed Apr 29 10:41:14 2020 From: jandyman.voelkel at gmail.com (Andrew Voelkel) Date: Wed, 29 Apr 2020 14:41:14 +0000 Subject: [C++-sig] Compiling boost python In-Reply-To: References: Message-ID: Have you considered using pybind11? It?s the same basic idea as boost.python, but it is cleaner, much better supported and documented, and has a large user community. I just discovered this lately, have been using it, and I?m thrilled with it. The only catch is that you need to be compiling with at least a C++11 compiler, but that is a pretty low bar these days. * Andy From: Cplusplus-sig on behalf of Torsten Kn?ppel Reply-To: Development of Python/C++ integration Date: Wednesday, April 29, 2020 at 7:34 AM To: "cplusplus-sig at python.org" Subject: [C++-sig] Compiling boost python Dear all, I'm trying to compile boost.python with a version of python, that I've downloaded and built myself. Is the "No-install quickstart"-page (https://www.boost.org/doc/libs/1_73_0/libs/python/doc/html/building/no_install_quickstart.html) still updated, because some of the links are broken and I honestly don't understand what is going on there. Some questions that I have: - What is the bjam "build driver"? When I go to Section 5 of the boost Getting Started page - they mention something about an easy install option and another one for custom binaries. The entire page mentions neither bjam, nor "build driver". - I manage to build boost, by first running the bootstrap script and then calling b2 - if I select e.g. graph - it is built and copied into the correct directory, that I've specified. However, it doesn't work with my own Python folder. I wrote a small script to automate all steps: #wget https://dl.bintray.com/boostorg/release/1.73.0/source/boost_1_73_0.tar.gz #tar -xvf boost_1_73_0.tar.gz cd boost_1_73_0 ./bootstrap.sh --prefix=../build_boost --with-libraries=python -with-python-root=../Python-3.6.10 --with-python-version=3.6 ./b2 install -d+2 echo "using python : : ../Python-3.6.10/python ;" > user-config.jam My folder structure is as follows: buildBoost.sh (the script above) /Python-3.6.10 (contains the python source code and binaries that I've build myself) /boost_1_73_0 (boost source code as downloaded by the script) /build_boost (output folder as specified by prefix) When do I need to write this user-config.jam file? What are the compilation scripts looking for - can this process be debugged? I also have boost installed via apt - now I think that everytime I call b2 or bjam it uses the global versions of these programs, instead of the ones contained in the boost-directory I'm compiling - is that an issue? Thanks in advance. torsten -------------- next part -------------- An HTML attachment was scrubbed... URL: From brumfessor at gmx.net Wed Apr 29 11:14:25 2020 From: brumfessor at gmx.net (=?UTF-8?Q?Torsten_Kn=C3=BCppel?=) Date: Wed, 29 Apr 2020 17:14:25 +0200 Subject: [C++-sig] =?utf-8?q?Re=3A__Compiling_boost_python?= Message-ID: An HTML attachment was scrubbed... URL: From jandyman.voelkel at gmail.com Wed Apr 29 14:09:52 2020 From: jandyman.voelkel at gmail.com (Andrew Voelkel) Date: Wed, 29 Apr 2020 18:09:52 +0000 Subject: [C++-sig] Compiling boost python In-Reply-To: References: Message-ID: This blurb might help with that question: The main issue with Boost.Python?and the reason for creating such a similar project?is Boost. Boost is an enormously large and complex suite of utility libraries that works with almost every C++ compiler in existence. This compatibility has its cost: arcane template tricks and workarounds are necessary to support the oldest and buggiest of compiler specimens. Now that C++11-compatible compilers are widely available, this heavy machinery has become an excessively large and unnecessary dependency. Think of this library as a tiny self-contained version of Boost.Python with everything stripped away that isn?t relevant for binding generation. Without comments, the core header files only require ~4K lines of code and depend on Python (2.7 or 3.x, or PyPy2.7 >= 5.7) and the C++ standard library. This compact implementation was possible thanks to some of the new C++11 language features (specifically: tuples, lambda functions and variadic templates). Since its creation, this library has grown beyond Boost.Python in many ways, leading to dramatically simpler binding code in many common situations. * Andy From: Cplusplus-sig on behalf of Torsten Kn?ppel Reply-To: Development of Python/C++ integration Date: Wednesday, April 29, 2020 at 8:15 AM To: Development of Python/C++ integration Subject: Re: [C++-sig] Re: Compiling boost python Hi Andy, thanks for the quick reply. I only came across pybind recently when I was encountering some dependency issues with boost.python and looked for an alternative. It looks really useful, but I hesitated to make the switch - but I think I will do it sooner or later. Maybe one question regarding pybind - is it easy to create bindings for different Python versions? Am 29.04.20, 16:42 schrieb Andrew Voelkel : Have you considered using pybind11? It?s the same basic idea as boost.python, but it is cleaner, much better supported and documented, and has a large user community. I just discovered this lately, have been using it, and I?m thrilled with it. The only catch is that you need to be compiling with at least a C++11 compiler, but that is a pretty low bar these days. * Andy From: Cplusplus-sig on behalf of Torsten Kn?ppel Reply-To: Development of Python/C++ integration Date: Wednesday, April 29, 2020 at 7:34 AM To: "cplusplus-sig at python.org" Subject: [C++-sig] Compiling boost python Dear all, I'm trying to compile boost.python with a version of python, that I've downloaded and built myself. Is the "No-install quickstart"-page (https://www.boost.org/doc/libs/1_73_0/libs/python/doc/html/building/no_install_quickstart.html) still updated, because some of the links are broken and I honestly don't understand what is going on there. Some questions that I have: - What is the bjam "build driver"? When I go to Section 5 of the boost Getting Started page - they mention something about an easy install option and another one for custom binaries. The entire page mentions neither bjam, nor "build driver". - I manage to build boost, by first running the bootstrap script and then calling b2 - if I select e.g. graph - it is built and copied into the correct directory, that I've specified. However, it doesn't work with my own Python folder. I wrote a small script to automate all steps: #wget https://dl.bintray.com/boostorg/release/1.73.0/source/boost_1_73_0.tar.gz #tar -xvf boost_1_73_0.tar.gz cd boost_1_73_0 ./bootstrap.sh --prefix=../build_boost --with-libraries=python -with-python-root=../Python-3.6.10 --with-python-version=3.6 ./b2 install -d+2 echo "using python : : ../Python-3.6.10/python ;" > user-config.jam My folder structure is as follows: buildBoost.sh (the script above) /Python-3.6.10 (contains the python source code and binaries that I've build myself) /boost_1_73_0 (boost source code as downloaded by the script) /build_boost (output folder as specified by prefix) When do I need to write this user-config.jam file? What are the compilation scripts looking for - can this process be debugged? I also have boost installed via apt - now I think that everytime I call b2 or bjam it uses the global versions of these programs, instead of the ones contained in the boost-directory I'm compiling - is that an issue? Thanks in advance. torsten _______________________________________________ Cplusplus-sig mailing list Cplusplus-sig at python.org https://mail.python.org/mailman/listinfo/cplusplus-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: From alain.miniussi at oca.eu Thu Apr 30 03:20:39 2020 From: alain.miniussi at oca.eu (Alain O' Miniussi) Date: Thu, 30 Apr 2020 09:20:39 +0200 (CEST) Subject: [C++-sig] Compiling boost python In-Reply-To: References: Message-ID: <317588285.74748.1588231239968.JavaMail.zimbra@oca.eu> But having one more lib outside boost means one more dependency. The sad thing is that dropping support for "the oldest and buggiest of compiler specimens" in Boost would be rational to do, there are plenty of old Boost releases for those. How the cmake support for pybind ? ----- On 29 Avr 20, at 20:09, Andrew Voelkel wrote: > This blurb might help with that question: > The main issue with Boost.Python?and the reason for creating such a similar > project?is Boost. Boost is an enormously large and complex suite of utility > libraries that works with almost every C++ compiler in existence. This > compatibility has its cost: arcane template tricks and workarounds are > necessary to support the oldest and buggiest of compiler specimens. Now that > C++11-compatible compilers are widely available, this heavy machinery has > become an excessively large and unnecessary dependency. Think of this library > as a tiny self-contained version of Boost.Python with everything stripped away > that isn?t relevant for binding generation. Without comments, the core header > files only require ~4K lines of code and depend on Python (2.7 or 3.x, or > PyPy2.7 >= 5.7) and the C++ standard library. This compact implementation was > possible thanks to some of the new C++11 language features (specifically: > tuples, lambda functions and variadic templates). Since its creation, this > library has grown beyond Boost.Python in many ways, leading to dramatically > simpler binding code in many common situations. > * Andy > From: Cplusplus-sig > on behalf of > Torsten Kn?ppel > Reply-To: Development of Python/C++ integration > Date: Wednesday, April 29, 2020 at 8:15 AM > To: Development of Python/C++ integration > Subject: Re: [C++-sig] Re: Compiling boost python > Hi Andy, > thanks for the quick reply. I only came across pybind recently when I was > encountering some dependency issues with [ http://boost.python/ | boost.python > ] and looked for an alternative. It looks really useful, but I hesitated to > make the switch - but I think I will do it sooner or later. Maybe one question > regarding pybind - is it easy to create bindings for different Python versions? > Am 29.04.20, 16:42 schrieb Andrew Voelkel : >> Have you considered using pybind11? It?s the same basic idea as boost.python, >> but it is cleaner, much better supported and documented, and has a large user >> community. I just discovered this lately, have been using it, and I?m thrilled >> with it. The only catch is that you need to be compiling with at least a C++11 >> compiler, but that is a pretty low bar these days. >> * Andy >> From: Cplusplus-sig >> on behalf of >> Torsten Kn?ppel >> Reply-To: Development of Python/C++ integration >> Date: Wednesday, April 29, 2020 at 7:34 AM >> To: "cplusplus-sig at python.org" >> Subject: [C++-sig] Compiling boost python >> Dear all, >> I'm trying to compile boost.python with a version of python, that I've >> downloaded and built myself. >> Is the "No-install quickstart"-page >> (https://www.boost.org/doc/libs/1_73_0/libs/python/doc/html/building/no_install_quickstart.html) >> still updated, because some of the links are broken and >> I honestly don't understand what is going on there. >> Some questions that I have: >> - What is the bjam "build driver"? When I go to Section 5 of the boost Getting >> Started page - they mention something about an easy install option and another >> one for custom binaries. >> The entire page mentions neither bjam, nor "build driver". >> - I manage to build boost, by first running the bootstrap script and then >> calling b2 - if I select e.g. graph - it is built and copied into the correct >> directory, that I've specified. However, >> it doesn't work with my own Python folder. >> I wrote a small script to automate all steps: >> #wget https://dl.bintray.com/boostorg/release/1.73.0/source/boost_1_73_0.tar.gz >> #tar -xvf boost_1_73_0.tar.gz >> cd boost_1_73_0 >> ./bootstrap.sh --prefix=../build_boost --with-libraries=python >> -with-python-root=../Python-3.6.10 --with-python-version=3.6 >> ./b2 install -d+2 >> echo "using python : : ../Python-3.6.10/python ;" > user-config.jam >> My folder structure is as follows: >> buildBoost.sh (the script above) >> /Python-3.6.10 (contains the python source code and binaries that I've build >> myself) >> /boost_1_73_0 (boost source code as downloaded by the script) >> /build_boost (output folder as specified by prefix) >> When do I need to write this user-config.jam file? What are the compilation >> scripts looking for - can this process be debugged? >> I also have boost installed via apt - now I think that everytime I call b2 or >> bjam it uses >> the global versions of these programs, instead of the ones contained in the >> boost-directory I'm compiling - is that an issue? >> Thanks in advance. >> torsten >> _______________________________________________ Cplusplus-sig mailing list >> Cplusplus-sig at python.org https://mail.python.org/mailman/listinfo/cplusplus-sig > _______________________________________________ > Cplusplus-sig mailing list > Cplusplus-sig at python.org > https://mail.python.org/mailman/listinfo/cplusplus-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: From skip.montanaro at gmail.com Thu Apr 30 11:36:33 2020 From: skip.montanaro at gmail.com (Skip Montanaro) Date: Thu, 30 Apr 2020 08:36:33 -0700 Subject: [C++-sig] Compiling boost python In-Reply-To: <317588285.74748.1588231239968.JavaMail.zimbra@oca.eu> References: <317588285.74748.1588231239968.JavaMail.zimbra@oca.eu> Message-ID: > How the cmake support for pybind ? I don't know cmake, but I did use pybind11 at my last job. It's nothing more than header files (no libraries to link). I doubt it would be difficult to support. Skip From jandyman.voelkel at gmail.com Thu Apr 30 12:05:39 2020 From: jandyman.voelkel at gmail.com (Andrew Voelkel) Date: Thu, 30 Apr 2020 16:05:39 +0000 Subject: [C++-sig] Compiling boost python In-Reply-To: <317588285.74748.1588231239968.JavaMail.zimbra@oca.eu> References: <317588285.74748.1588231239968.JavaMail.zimbra@oca.eu> Message-ID: The examples all use cmake, and there is a cmake extension for pybind11 that takes care of a number of things for you. From the docs: For C++ codebases that have an existing CMake-based build system, a Python extension module can be created with just a few lines of code: cmake_minimum_required(VERSION 2.8.12) project(example) add_subdirectory(pybind11) pybind11_add_module(example example.cpp) More here: https://pybind11.readthedocs.io/en/stable/compiling.html#building-with-cmake From: Cplusplus-sig on behalf of Alain O' Miniussi Reply-To: Development of Python/C++ integration Date: Thursday, April 30, 2020 at 8:30 AM To: Development of Python/C++ integration Subject: Re: [C++-sig] Compiling boost python But having one more lib outside boost means one more dependency. The sad thing is that dropping support for "the oldest and buggiest of compiler specimens" in Boost would be rational to do, there are plenty of old Boost releases for those. How the cmake support for pybind ? ----- On 29 Avr 20, at 20:09, Andrew Voelkel wrote: This blurb might help with that question: The main issue with Boost.Python?and the reason for creating such a similar project?is Boost. Boost is an enormously large and complex suite of utility libraries that works with almost every C++ compiler in existence. This compatibility has its cost: arcane template tricks and workarounds are necessary to support the oldest and buggiest of compiler specimens. Now that C++11-compatible compilers are widely available, this heavy machinery has become an excessively large and unnecessary dependency. Think of this library as a tiny self-contained version of Boost.Python with everything stripped away that isn?t relevant for binding generation. Without comments, the core header files only require ~4K lines of code and depend on Python (2.7 or 3.x, or PyPy2.7 >= 5.7) and the C++ standard library. This compact implementation was possible thanks to some of the new C++11 language features (specifically: tuples, lambda functions and variadic templates). Since its creation, this library has grown beyond Boost.Python in many ways, leading to dramatically simpler binding code in many common situations. * Andy From: Cplusplus-sig on behalf of Torsten Kn?ppel Reply-To: Development of Python/C++ integration Date: Wednesday, April 29, 2020 at 8:15 AM To: Development of Python/C++ integration Subject: Re: [C++-sig] Re: Compiling boost python Hi Andy, thanks for the quick reply. I only came across pybind recently when I was encountering some dependency issues with boost.python and looked for an alternative. It looks really useful, but I hesitated to make the switch - but I think I will do it sooner or later. Maybe one question regarding pybind - is it easy to create bindings for different Python versions? Am 29.04.20, 16:42 schrieb Andrew Voelkel : Have you considered using pybind11? It?s the same basic idea as boost.python, but it is cleaner, much better supported and documented, and has a large user community. I just discovered this lately, have been using it, and I?m thrilled with it. The only catch is that you need to be compiling with at least a C++11 compiler, but that is a pretty low bar these days. * Andy From: Cplusplus-sig on behalf of Torsten Kn?ppel Reply-To: Development of Python/C++ integration Date: Wednesday, April 29, 2020 at 7:34 AM To: "cplusplus-sig at python.org" Subject: [C++-sig] Compiling boost python Dear all, I'm trying to compile boost.python with a version of python, that I've downloaded and built myself. Is the "No-install quickstart"-page (https://www.boost.org/doc/libs/1_73_0/libs/python/doc/html/building/no_install_quickstart.html) still updated, because some of the links are broken and I honestly don't understand what is going on there. Some questions that I have: - What is the bjam "build driver"? When I go to Section 5 of the boost Getting Started page - they mention something about an easy install option and another one for custom binaries. The entire page mentions neither bjam, nor "build driver". - I manage to build boost, by first running the bootstrap script and then calling b2 - if I select e.g. graph - it is built and copied into the correct directory, that I've specified. However, it doesn't work with my own Python folder. I wrote a small script to automate all steps: #wget https://dl.bintray.com/boostorg/release/1.73.0/source/boost_1_73_0.tar.gz #tar -xvf boost_1_73_0.tar.gz cd boost_1_73_0 ./bootstrap.sh --prefix=../build_boost --with-libraries=python -with-python-root=../Python-3.6.10 --with-python-version=3.6 ./b2 install -d+2 echo "using python : : ../Python-3.6.10/python ;" > user-config.jam My folder structure is as follows: buildBoost.sh (the script above) /Python-3.6.10 (contains the python source code and binaries that I've build myself) /boost_1_73_0 (boost source code as downloaded by the script) /build_boost (output folder as specified by prefix) When do I need to write this user-config.jam file? What are the compilation scripts looking for - can this process be debugged? I also have boost installed via apt - now I think that everytime I call b2 or bjam it uses the global versions of these programs, instead of the ones contained in the boost-directory I'm compiling - is that an issue? Thanks in advance. torsten _______________________________________________ Cplusplus-sig mailing list Cplusplus-sig at python.org https://mail.python.org/mailman/listinfo/cplusplus-sig _______________________________________________ Cplusplus-sig mailing list Cplusplus-sig at python.org https://mail.python.org/mailman/listinfo/cplusplus-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.huebl at hzdr.de Thu Apr 30 17:21:40 2020 From: a.huebl at hzdr.de (Axel Huebl) Date: Thu, 30 Apr 2020 14:21:40 -0700 Subject: [C++-sig] Compiling boost python In-Reply-To: References: <317588285.74748.1588231239968.JavaMail.zimbra@oca.eu> Message-ID: <6C53894D-D06A-4F18-AE8E-0C479DA9B201@hzdr.de> Hi, Check out the bazel example or the plain build with setuptools: https://github.com/pybind/ https://github.com/pybind/python_example Axel On April 30, 2020 9:05:39 AM PDT, Andrew Voelkel wrote: >The examples all use cmake, and there is a cmake extension for pybind11 >that takes care of a number of things for you. From the docs: > >For C++ codebases that have an existing CMake-based build system, a >Python extension module can be created with just a few lines of code: >cmake_minimum_required(VERSION 2.8.12) >project(example) > >add_subdirectory(pybind11) >pybind11_add_module(example example.cpp) > >More here: > >https://pybind11.readthedocs.io/en/stable/compiling.html#building-with-cmake > > >From: Cplusplus-sig > on behalf >of Alain O' Miniussi >Reply-To: Development of Python/C++ integration > >Date: Thursday, April 30, 2020 at 8:30 AM >To: Development of Python/C++ integration >Subject: Re: [C++-sig] Compiling boost python > >But having one more lib outside boost means one more dependency. > >The sad thing is that dropping support for "the oldest and buggiest of >compiler specimens" in Boost would be rational to do, there are plenty >of old Boost releases for those. >How the cmake support for pybind ? > >----- On 29 Avr 20, at 20:09, Andrew Voelkel > wrote: > >This blurb might help with that question: > >The main issue with Boost.Python?and the reason for creating such a >similar project?is Boost. Boost is an enormously large and complex >suite of utility libraries that works with almost every C++ compiler in >existence. This compatibility has its cost: arcane template tricks and >workarounds are necessary to support the oldest and buggiest of >compiler specimens. Now that C++11-compatible compilers are widely >available, this heavy machinery has become an excessively large and >unnecessary dependency. Think of this library as a tiny self-contained >version of Boost.Python with everything stripped away that isn?t >relevant for binding generation. Without comments, the core header >files only require ~4K lines of code and depend on Python (2.7 or 3.x, >or PyPy2.7 >= 5.7) and the C++ standard library. This compact >implementation was possible thanks to some of the new C++11 language >features (specifically: tuples, lambda functions and variadic >templates). Since its creation, this library has grown beyond >Boost.Python in many ways, leading to dramatically simpler binding code >in many common situations. > > > * Andy > >From: Cplusplus-sig > on behalf >of Torsten Kn?ppel >Reply-To: Development of Python/C++ integration > >Date: Wednesday, April 29, 2020 at 8:15 AM >To: Development of Python/C++ integration >Subject: Re: [C++-sig] Re: Compiling boost python > >Hi Andy, > >thanks for the quick reply. I only came across pybind recently when I >was encountering some dependency issues with >boost.python and looked for an alternative. It >looks really useful, but I hesitated to make the switch - but I think I >will do it sooner or later. Maybe one question regarding pybind - is it >easy to create bindings for different Python versions? >Am 29.04.20, 16:42 schrieb Andrew Voelkel : >Have you considered using pybind11? It?s the same basic idea as >boost.python, but it is cleaner, much better supported and documented, >and has a large user community. I just discovered this lately, have >been using it, and I?m thrilled with it. The only catch is that you >need to be compiling with at least a C++11 compiler, but that is a >pretty low bar these days. > > > * Andy > >From: Cplusplus-sig > on behalf >of Torsten Kn?ppel >Reply-To: Development of Python/C++ integration > >Date: Wednesday, April 29, 2020 at 7:34 AM >To: "cplusplus-sig at python.org" >Subject: [C++-sig] Compiling boost python > >Dear all, > >I'm trying to compile boost.python with a version of python, that I've >downloaded and built myself. >Is the "No-install quickstart"-page >(https://www.boost.org/doc/libs/1_73_0/libs/python/doc/html/building/no_install_quickstart.html) >still updated, because some of the links are broken and >I honestly don't understand what is going on there. >Some questions that I have: >- What is the bjam "build driver"? When I go to Section 5 of the boost >Getting Started page - they mention something about an easy install >option and another one for custom binaries. > The entire page mentions neither bjam, nor "build driver". >- I manage to build boost, by first running the bootstrap script and >then calling b2 - if I select e.g. graph - it is built and copied into >the correct directory, that I've specified. However, > it doesn't work with my own Python folder. > I wrote a small script to automate all steps: > >#wget >https://dl.bintray.com/boostorg/release/1.73.0/source/boost_1_73_0.tar.gz >#tar -xvf boost_1_73_0.tar.gz >cd boost_1_73_0 >./bootstrap.sh --prefix=../build_boost --with-libraries=python >-with-python-root=../Python-3.6.10 --with-python-version=3.6 >./b2 install -d+2 >echo "using python : : ../Python-3.6.10/python ;" > user-config.jam > >My folder structure is as follows: > >buildBoost.sh (the script above) >/Python-3.6.10 (contains the python source code and binaries that I've >build myself) > /boost_1_73_0 (boost source code as downloaded by the script) > /build_boost (output folder as specified by prefix) > >When do I need to write this user-config.jam file? What are the >compilation scripts looking for - can this process be debugged? >I also have boost installed via apt - now I think that everytime I call >b2 or bjam it uses >the global versions of these programs, instead of the ones contained in >the boost-directory I'm compiling - is that an issue? > >Thanks in advance. >torsten >_______________________________________________ Cplusplus-sig mailing >list Cplusplus-sig at python.org >https://mail.python.org/mailman/listinfo/cplusplus-sig > >_______________________________________________ >Cplusplus-sig mailing list >Cplusplus-sig at python.org >https://mail.python.org/mailman/listinfo/cplusplus-sig -- Sent from my smartphone. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: