473,473 Members | 1,994 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

changing build order for SWIG extensions

Hi all.
How do I tell distutils to run build_ext before build_py when I try to
do a

'python setup.py build' ?

I have a C extension using SWIG, and when I build with setup.py,
build_py runs on the current module.py file before swig
creates/recreates it. I got around it by just putting in another call
to setup for the py_module, but if I try to create a bdist, the second
call to setup over writes the first w/o the _module.so file.

(bottom of setup.py)

# build extension module
setup (name = 'OTB_libs',
version='1.0',
author="Tim Williams",
packages=['OTB_libs'],
package_dir={'OTB_libs':''},
ext_modules=[Extension('OTB_libs._OTB_libs',
sources=['OTB_libs.i'],
include_dirs=INCLDIRS,
library_dirs=LIBDIRS,
libraries=liblist,
extra_compile_args=['-malign-double'],
swig_opts=swig_opts
)
]
)

#this needs to be built after the extension is since OTB_libs.py is
#generated by SWIG
setup (name='OTB_libs',
version='1.0',
author="Tim Williams",
py_modules=['OTB_libs.OTB_libs'],
package_dir={'OTB_libs':''}
)

Am I stuck with just calling running 'python setup.py build' twice?

Thanks for any help.

Jul 19 '05 #1
0 1059

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

Similar topics

6
by: Alexandre Gillet | last post by:
Hi, I am trying to build a python interpreter that is static link. My python interpreter was build on RedHat 8.0 using gcc 2.3 and GLIBC 2.3 When running on other linux flavor that still have...
1
by: Grant Edwards | last post by:
I've been using the pylibpcap extension module for several years, but I can't get it to build under 2.4: $ python setup.py build /usr/lib/python2.4/distutils/dist.py:222: UserWarning: 'licence'...
1
by: superprad | last post by:
Hi I am trying to write a python wrapper for a C code I have using swig. when i try to compile the wrap.c i get a bunch of these warnings and errors can anyone help $swig -python test_hk.c this...
0
by: Roland Hedberg | last post by:
Hi! This involves quite a lot of different system, so I'm not really sure who which would be the right list to query. So, I'm trying a couple, this list being one of them. I'm trying to...
2
by: John Nagle | last post by:
Trying to build M2Crypto on a dedicated server running Red Hat Fedora Core 6. I'm trying to do this right, without manual patching. The error message I'm getting during build is: python...
7
by: John Nagle | last post by:
Back in March, I posted this: That was for M2Crypto 0.17. It's still broken in M2Crypto 0.18. And there's no RPM or Windows binary. Nobody actually uses this stuff, do they?
6
by: Adam C. | last post by:
We have a situation where we want a Swig-generated Python class to have a different base (not object). It doesn't appear that we can coerce Swig into generating the class we want at present (but we...
2
by: mk | last post by:
Hello, I'm having terrible problems building C++ extension to Python 2.4 using SWIG. I'd appreciate if somebody knowledgeable at the subject took a look at it. swig-1.3.29, g++ (GCC) 4.1.1...
3
by: code_berzerker | last post by:
Hi i'm relatively new to Python and my C/C++ knowledge is near to None. Having said that I feel justified to ask stupid questions :) Ok now more seriously. I have question refering to char* used...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
1
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
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.