[wxPython] Compile problems on FreeBSD

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] Compile problems on FreeBSD

Stephen Pitts
I'm trying to compile wxWindows 2.1b9 and wxPython on FreeBSD. wxWindows
compiles file (and a sample app runs fine), and once I hand-edit
/usr/local/bin/wx-config (-ldl doesn't exist on FreeBSD), I can compile
wxPython fine. When I try to import wxPython (running "from wxPython.wx
import *" in the python command-line editor), my memory usage keeps
spiralling upward until all memory and swap is exhausted and FreeBSD
kills the process.

I'm running FreeBSD 3.3-RC-19990909 and built python, GTK, wxGTK, and
wxPython with gcc 2.95.1. I used "-O2" and "-mpentiumpro", if that makes
a difference. I build wxGTK with "--enable-gtk --disable-shared
--enable-optimise". Does anyone have any idea what's wrong or what I
should do?
--
Stephen Pitts
[hidden email]
webmaster - http://www.mschess.org

_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] Compile problems on FreeBSD

Robin Dunn
> I'm trying to compile wxWindows 2.1b9 and wxPython on FreeBSD. wxWindows
> compiles file (and a sample app runs fine), and once I hand-edit
> /usr/local/bin/wx-config (-ldl doesn't exist on FreeBSD), I can compile
> wxPython fine. When I try to import wxPython (running "from wxPython.wx
> import *" in the python command-line editor), my memory usage keeps
> spiralling upward until all memory and swap is exhausted and FreeBSD
> kills the process.
>

So much for FreeBSD being more memory and I/O efficient thatn linux, eh?
<grin>


> I'm running FreeBSD 3.3-RC-19990909 and built python, GTK, wxGTK, and
> wxPython with gcc 2.95.1. I used "-O2" and "-mpentiumpro", if that makes
> a difference. I build wxGTK with "--enable-gtk --disable-shared
> --enable-optimise". Does anyone have any idea what's wrong or what I
> should do?

Is python able to load other dynamic extension modules?  Does it do the same
thing if you just "import wxc" (while you are in the wxPython directory or
it is in your PYTHONPATH)?  There is a loop in the initialization function
for each module that adds items to a table that SWIG uses.  The array of
items is terminated with null values, and if the nulls got lost the loop
could conceivably go on forever until memory ran out, although I would
expect it to seg fault before that.  You might try turning off the
optimizations to see if that makes a difference.

Another alternative is to try building Python with wxPython linked
statically.  Unfortunately the current wxPython build system doesn't support
this.  The old one did but it was getting too bug and ugly and so it got
tossed...  If you are familiar with how Python extension modules are built
you can probably recreate what you need to do this.  Just get a copy of
Makefile.pre.in from /usr/local/lib/python15/config and make a Setup.in file
listing all the wxPython modules with their sources, and follow the
directions in Makefile.pre.in.

Robin


_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] Compile problems on FreeBSD

Harm van der Heijden
In reply to this post by Stephen Pitts
Stephen Pitts wrote:
>
> I'm trying to compile wxWindows 2.1b9 and wxPython on FreeBSD. wxWindows
> compiles file (and a sample app runs fine), and once I hand-edit
> /usr/local/bin/wx-config (-ldl doesn't exist on FreeBSD), I can compile
> wxPython fine. When I try to import wxPython (running "from wxPython.wx
> import *" in the python command-line editor), my memory usage keeps
> spiralling upward until all memory and swap is exhausted and FreeBSD
> kills the process.

Do you have the time to look at wxWindows/configure.in, to see if you can
fix this FreeBSD -ldl flag? Configure is supposed to check for this kind of
stuff... It'd be much appreciated.

> I'm running FreeBSD 3.3-RC-19990909 and built python, GTK, wxGTK, and
> wxPython with gcc 2.95.1. I used "-O2" and "-mpentiumpro", if that makes
> a difference. I build wxGTK with "--enable-gtk --disable-shared
> --enable-optimise". Does anyone have any idea what's wrong or what I
> should do?

You create a wxGTK library for static use, yet link it into wxcmodule.so
which is a dynamic library. Static library code is compiled without the
-fPIC flag (to generate relocatable code) and using such objects in a dynamic
library can cause weird problems on Linux (and presumably FreeBSD). I
suggest you try using a shared wxGTK library, or at least make sure your
static lib is compiled with -fPIC.

Harm

_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users