All Projects → zpoint → Boost-Python-Examples

zpoint / Boost-Python-Examples

Licence: other
Implementation of C++ Boost Python Examples, With python3.5+ support

Labels

Projects that are alternatives of or similar to Boost-Python-Examples

developkit set
2021年最新总结,值得推荐的c/c++开源框架与库。持续更新中。
Stars: ✭ 654 (+1823.53%)
Mutual labels:  boost
cpp-code-snippets
Some useful C++ code snippets
Stars: ✭ 35 (+2.94%)
Mutual labels:  boost
ZeroMQ
🚀 Client/Server & Pub/Sub Examples with ZeroMQ & Boost
Stars: ✭ 33 (-2.94%)
Mutual labels:  boost
HyperGraphLib
C++ Hypergraph modelling Library using Boost and OpenMP with some algorithms, including isomorphism using Gecode.
Stars: ✭ 19 (-44.12%)
Mutual labels:  boost
gtkmm-plplot
a scientific plotting library for Gtkmm leveraging the power of PLplot
Stars: ✭ 59 (+73.53%)
Mutual labels:  boost
Boost.toml
header-only C++(98|11|14|17) TOML v0.5.0 parser/encoder depending on Boost
Stars: ✭ 26 (-23.53%)
Mutual labels:  boost
Stacktrace
C++ library for storing and printing backtraces.
Stars: ✭ 250 (+635.29%)
Mutual labels:  boost
build-scripts
Utility scripts for building of 3rd-party libraries
Stars: ✭ 33 (-2.94%)
Mutual labels:  boost
SierraChartZorroPlugin
A Zorro broker API plugin for Sierra Chart, written in Win32 C++.
Stars: ✭ 22 (-35.29%)
Mutual labels:  boost
boost
Boost Maven and Gradle plugins for MicroProfile development
Stars: ✭ 27 (-20.59%)
Mutual labels:  boost
boost
🚀 A collection of type-safe cross-platform packages for building robust server-side and client-side systems.
Stars: ✭ 97 (+185.29%)
Mutual labels:  boost
poly collection
Fast containers of polymorphic objects.
Stars: ✭ 58 (+70.59%)
Mutual labels:  boost
lexical cast
General literal text conversions, such as an int represented as a string, or vice versa
Stars: ✭ 23 (-32.35%)
Mutual labels:  boost
HPX Projects
⚡ High-Performance-Computing with C++
Stars: ✭ 15 (-55.88%)
Mutual labels:  boost
boost-wintls
Native Windows TLS stream wrapper for use with boost::asio
Stars: ✭ 24 (-29.41%)
Mutual labels:  boost
boost-reflection
This library provides Java-like Reflection API to C++ language.
Stars: ✭ 16 (-52.94%)
Mutual labels:  boost
textTinyR
Text Processing for Small or Big Data Files in R
Stars: ✭ 32 (-5.88%)
Mutual labels:  boost
axmldec
Stand-alone binary AndroidManifest.xml decoder
Stars: ✭ 151 (+344.12%)
Mutual labels:  boost
Boost-for-Android-Prebuilt
boost for android
Stars: ✭ 58 (+70.59%)
Mutual labels:  boost
type index
Runtime/Compile time copyable type info.
Stars: ✭ 20 (-41.18%)
Mutual labels:  boost

Boost Python Examples



C++ Boost Python

Boost Installation with python3 support
  • OS Ubuntu 16.10

  • From source

    • Download the latest version here

    • Description of user-config.jam please refer to here

        tar -xzvf boost_1_65_1.tar.gz
        cd boost_1_65_1
      
        # sudo find / -name "python3.5m" # If you don't know where python3.5m is
        # which python3 # If you don't know your python3 install directory
        echo "using mpi ;
        using gcc :  : g++ ;
        using python : 3.5 : /usr/bin/python3 : /usr/include/python3.5m : /usr/local/lib ;" > ~/user-config.jam
      
        ./bootstrap.sh --with-python=/usr/bin/python3 --with-python-version=3.5 --with-python-root=/usr/local/lib/python3.5 --prefix=/usr/local
        sudo ./b2 install -a --with=all
        sudo ldconfig
      
  • From apt

    sudo apt-get install libboost-all-dev
    # link libboost_python3.so
    sudo find / -name "libboost_python-py35.so"
    # cd to where you find it
    cd /usr/lib/x86_64-linux-gnu/
    sudo ln -s libboost_python-py35.so libboost_python3.so
    
  • OS Mac

      brew install boost-python --with-python3
      # if your python version or lib path is different from mine, please change
      # INCLUDE_PATH and LIBPYTHON_PATH in makefile
    
      # INCLUDE_PATH:
      # shold be the path contains "pyconfig.h", below two command can help you find the path
      # sudo find / -name "pyconfig.h"
      # python3 -c "import sys; print('\n'.join(sys.path))"
    
      # LIBPYTHON_PATH:
      # on mac, with version python3.6, lib name is: libpython3.6.dylib
      # sudo find / -name "libpython3.6"
    
Demo
  • If you install from source, and you change the prefix path when install, you need also change the BOOST_INC and BOOST_LIB in makefile
  • My default python version is python3.5 on Ubuntu, python3.6 on Mac, if you want to use with python 2.7, change "PYTHON_VERSION" in makefile
python3 hello_ext
git clone https://github.com/zpoint/Boost-Python-Examples.git
cd Boost-Python-Examples/Examples/hello_ext
make

python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hello_ext
>>> hello_ext.greet()
'hello, world'
python2 hello_ext
git clone https://github.com/zpoint/Boost-Python-Examples.git
cd Boost-Python-Examples/Examples/hello_ext
vim makefile # change the first line "PYTHON_VERSION = None" to "PYTHON_VERSION = 2.7"
make

python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import hello_ext
>>> hello_ext.greet()
'hello, world'
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].