473,624 Members | 2,186 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using boost to extend python with c++

Hi,

I've been trying for days to make either boost.python or swig to
work for me. The one I have gotten the closest to is boost. Note that
this is for windows XP. I'm not much of an unix person besides doing
simple ls and copy paste.

What I have done is to download the boost library: C:\boost_1_34_0
I downloaded the bjam library: C:\boost-jam-3.1.14-1-ntx86

I then set up the path so that I could do bjam from anywhere suing the
coomand prompt. Did the same for python and g++. I'm using the g++
that came with bloodshed DevC++ compiler.

So, I navigated myself to the tutorial example in the boost library.
C:\boost_1_34_0 \libs\python\ex ample\tutorial

In the command prompt I typed bjam and I got the following error message.

C:\boost_1_34_0 \libs\python\ex ample\tutorial> bjam
Jamroot:17: in modules.load
rule python-extension unknown in module
Jamfile</C:/boost_1_34_0/libs/python/example/tutorial>.
C:/boost_1_34_0/tools/build/v2/build\project.j am:312: in load-jamfile
C:/boost_1_34_0/tools/build/v2/build\project.j am:68: in load
C:/boost_1_34_0/tools/build/v2/build\project.j am:170: in project.find
C:/boost_1_34_0/tools/build/v2\build-system.jam:237: in load
C:\boost_1_34_0 \libs\python\ex ample\..\..\..\ tools\build\v2/kernel\modules. jam:261:
in import
C:\boost_1_34_0 \libs\python\ex ample\..\..\..\ tools\build\v2/kernel/bootstrap.jam:1 32:
in boost-build
C:\boost_1_34_0 \libs\python\ex ample\boost-build.jam:7: in module scope
I've have been trying desperately for 3 days. I also tried swig with
similar results but I feel I'm closer to solving the issue with boost
than with swig. I'm at a total lost here. I have tried the tutorials
in the boost web page but I just don't get anywhere.

http://www.boost.org/libs/python/doc...hon/hello.html

May 6 '07 #1
2 2909
On May 6, 4:12 pm, "mr_gees100_pea s" <mr_gees100_p.. .@yahoo.com>
wrote:
Hi,

I've been trying for days to make either boost.python or swig to
work for me. The one I have gotten the closest to is boost. Note that
this is for windows XP. I'm not much of an unix person besides doing
simple ls and copy paste.

What I have done is to download the boost library: C:\boost_1_34_0
I downloaded the bjam library: C:\boost-jam-3.1.14-1-ntx86

I then set up the path so that I could do bjam from anywhere suing the
coomand prompt. Did the same for python and g++. I'm using the g++
that came with bloodshed DevC++ compiler.

So, I navigated myself to the tutorial example in the boost library.
C:\boost_1_34_0 \libs\python\ex ample\tutorial

In the command prompt I typed bjam and I got the following error message.

C:\boost_1_34_0 \libs\python\ex ample\tutorial> bjam
Jamroot:17: in modules.load
rule python-extension unknown in module
Jamfile</C:/boost_1_34_0/libs/python/example/tutorial>.
C:/boost_1_34_0/tools/build/v2/build\project.j am:312: in load-jamfile
C:/boost_1_34_0/tools/build/v2/build\project.j am:68: in load
C:/boost_1_34_0/tools/build/v2/build\project.j am:170: in project.find
C:/boost_1_34_0/tools/build/v2\build-system.jam:237: in load
C:\boost_1_34_0 \libs\python\ex ample\..\..\..\ tools\build\v2/kernel\modules. jam:261:
in import
C:\boost_1_34_0 \libs\python\ex ample\..\..\..\ tools\build\v2/kernel/bootstrap.jam:1 32:
in boost-build
C:\boost_1_34_0 \libs\python\ex ample\boost-build.jam:7: in module scope

I've have been trying desperately for 3 days. I also tried swig with
similar results but I feel I'm closer to solving the issue with boost
than with swig. I'm at a total lost here. I have tried the tutorials
in the boost web page but I just don't get anywhere.

http://www.boost.org/libs/python/doc...hon/hello.html
I think your paste is incomplete.

May 6 '07 #2
Please see http://lists.boost.org/boost-build/2007/05/16666.php -- the
solution is to add "using python ;" to tools/build/v2/user-config.jam.

Jul 4 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2278
by: Natsu Mizutani | last post by:
Hello, I'm trying to wrap a c++ library using MPI inside with boost.python (or SWIG). I managed to find that calling `MPI::Init()` embeded in a c++ funtion would not work. So, I decided to use `pyMPI`. To avoid overhead of pickling and unpickling while calling `mpi.send` in Python, I'd rather call c++ functions `MPI::Isend()` etc. embeded in a c++ function.
2
1416
by: Squirrel Havoc | last post by:
Hello. I am sorry if this has been asked before, but I am new here. If I recall correctly, Python can be used as a scripting language for other programs, as if the program had a builtin Python interpreter. I wish to extend my programs by making them scriptable with Python scripts. Is this possible? If so, does anyone know where
2
3095
by: lallous | last post by:
Hello Many are saying that Boost will be included in the c++ standard...Does that mean that every new compiler release will have Boost included with it in order conform to portability? Does Boost use/is based on the STL? -- Elias
0
1921
by: Andrew Ayre | last post by:
Hi, I can't seem to get the library built, and any help is greatly appreciated. Here is the info: Windows XP Borland C++ Builder 5 Latest Boost source code (downloaded at the weekend) Windows binary bjam 3.1.11 Command line:
1
1357
by: KraftDiner | last post by:
Hi, I'm trying to call a C++ class from python. I've looked around and the solution would appear to be boost. I'm not sure but maybe I've downloaded and installed the entire boost library, when there is probably a separate tar ball for python / C++ integration. Can someone please point me to a tar ball for mac os x so that I can call my C++ class from Python?
3
5627
by: TonyHa | last post by:
Hello I try to install boost_1_33_1 on RedHat Linux. I have downloaded boost into /user/dtgtools/tmp and I try to install it into /user/dtgtools/packages/boost. I use the following commands: export PYTHON_ROOT="/user/dtgtools/packages/python/2.5"
11
4902
by: Osiris | last post by:
I have these pieces of C-code (NOT C++ !!) I want to call from Python. I found Boost. I have MS Visual Studio 2005 with C++. is this the idea: I write the following C source file: ============================ #include <iostream> #include <stdafx.h>
4
4232
by: Shawn McGrath | last post by:
Hi, I'm trying to expose a C++ class' internals to python via boost::python. I can do integer/boolean functions fine, but as soon as I do a string get/set it craps out. boost::python::class_<Entity, std::auto_ptr<pyEntity("Entity") //publics .def("isActive", &Entity::isActive) //bool .def("activate", &Entity::activate) //bool .def("deactivate", &Entity::deactivate) //bool //...
6
7666
by: Soren | last post by:
Hi! I'm trying to extend my python program with some C++ code. Right now I've spent hours just trying to get boost to work! I'm trying to get the example hello.cpp to work. Using Windows XP and Visual Studio 8 (.NET 2005) I've set BOOST_BUILD_PATH = C:\boost\boost_1_33_1 (where i installed
0
8173
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8679
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8621
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7159
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5563
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4079
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.