Using SunOS 5.7, Python 1.5.2, Distutils 1.0.1, wxGTK 2.2.2
I'm using WorkShop Compilers 5.0 98/12/15 C 5.0 which I have used to
build everything else.
Everything is fine other than the build insists in compiling with cc.
Since .cpp files are being compiled, cc objects. It should be
compiling with the C++ compiler (/opt/SUNWspro/bin/CC in this case)
instead. It works fine if I cut and paste the compile commands and
substitute the CC.
Anyone know how do I tell distutils to use the C++ compiler?
I don't really know anything about distutils...
I tried to put the following at the top of setup.py
form distutils import ccompiler
ccompiler.default_compiler['posix'] = 'CC'
but distutils said it didn't know how to compile with CC
and died horribly.
Anyone have any advice?
TIA...
Miguel
C. Miguel Marques, York University, Computing & Network Services
e-mail: miguel@yorku.ca, voice: (416)736-2100x22684, fax: (416)736-5830
I've forwarded our message to the distutils-sig, hopefully there will be
more help from there, and an official way to do what you need...
Anyone know how do I tell distutils to use the C++ compiler?
I don't really know anything about distutils...
I tried to put the following at the top of setup.py
form distutils import ccompiler
ccompiler.default_compiler['posix'] = 'CC'
default_compiler is just a way of mapping from platform to a specific class
derived from CCompiler. If you look at the next dictionary in ccompiler.py
you'll see that 'unix' is then mapped to the unixccompiler.UnixCCompiler
class, which is where you should look for adding hacks.
IIRC, UnixCCompiler makes a lot of guesses and also extracts some
information from the Makefile generated for Python (located in
.../python1.5/config/Makefile) so one way to hack distutils is to change the
values there. If there is a value in the Makefile for CCC then change it to
"CC", if it's not there then add it as distutils is probably falling back to
the value for CC. Try changing it to have these lines:
CCC=CC
CC=cc
BTW, the build process for Python 2.0 has been improved so (theoretically)
these kinds of hacks for distutils should not be needed as much anymore.
On Fri, 3 Nov 2000 09:43:06 -0800, "Robin Dunn" <robin@alldunn.com> wrote:
I've forwarded our message to the distutils-sig, hopefully there will be
more help from there, and an official way to do what you need...
>
> Anyone know how do I tell distutils to use the C++ compiler?
> I don't really know anything about distutils...
>
> I tried to put the following at the top of setup.py
>
> form distutils import ccompiler
> ccompiler.default_compiler['posix'] = 'CC'
>
default_compiler is just a way of mapping from platform to a specific class
derived from CCompiler. If you look at the next dictionary in ccompiler.py
you'll see that 'unix' is then mapped to the unixccompiler.UnixCCompiler
class, which is where you should look for adding hacks.
IIRC, UnixCCompiler makes a lot of guesses and also extracts some
information from the Makefile generated for Python (located in
.../python1.5/config/Makefile) so one way to hack distutils is to change the
values there. If there is a value in the Makefile for CCC then change it to
"CC", if it's not there then add it as distutils is probably falling back to
the value for CC. Try changing it to have these lines:
CCC=CC
CC=cc
Didn't work. I changed CC to CC=CC for the duration of the compile.
Unfortunately the demo core dumps when I start it. Sigh.
Thanks for the help...
Miguel
C. Miguel Marques, York University, Computing & Network Services
e-mail: miguel@yorku.ca, voice: (416)736-2100x22684, fax: (416)736-5830
_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net http://lists.sourceforge.net/mailman/listinfo/wxpython-users
> Didn't work. I changed CC to CC=CC for the duration of the compile.
> Unfortunately the demo core dumps when I start it. Sigh.
> Thanks for the help...
>
Can you tell how far it is getting? (Does it import wxPython.wx okay?)
Does one of the simpler examples work okay? (Try "run.py wxFrame")
The window with John Cleese shows up then it core dumps.
wxPython.wx imports ok. I've tried compiling with gcc as well and got
the same results.
I'm not sure if what I appended to the message will be very useful
since I didn't compile python with debug. Let me know what other
information would be useful.
Thanks.
Miguel
C. Miguel Marques, York University, Computing & Network Services
e-mail: miguel@yorku.ca, voice: (416)736-2100x22684, fax: (416)736-5830
% python run.py wxFrame.py
Segmentation fault (core dumped)
% gdb `which python` core
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.7"...
(no debugging symbols found)...
Core was generated by `python run.py wxFrame.py'.
Program terminated with signal 9, Killed.
Reading symbols from /usr/lib/libsocket.so.1...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libnsl.so.1...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libdl.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libthread.so.1...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libc.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libmp.so.2...(no debugging symbols found)...done.
Reading symbols from /usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1...
(no debugging symbols found)...done.
Reading symbols from /usr/local/lib/python1.5/site-packages/wxPython/wxc.so...
(no debugging symbols found)...done.
Reading symbols from /usr/local/lib/libwx_gtk.so...done.
Reading symbols from /usr/local/lib/libgtk-1.2.so.0...done.
Reading symbols from /usr/local/lib/libgdk-1.2.so.0...done.
Reading symbols from /usr/local/lib/libgmodule-1.2.so.0...done.
Reading symbols from /usr/local/lib/libgthread-1.2.so.0...done.
Reading symbols from /usr/local/lib/libglib-1.2.so.0...done.
Reading symbols from /usr/local/X11/lib/libXext.so.6.4...done.
Reading symbols from /usr/local/X11/lib/libX11.so.6.1...done.
Reading symbols from /usr/lib/libm.so.1...done.
Reading symbols from /usr/lib/librt.so.1...done.
Reading symbols from /usr/lib/libpthread.so.1...done.
Reading symbols from /usr/lib/libaio.so.1...done.
Reading symbols from /usr/local/lib/python1.5/lib-dynload/stropmodule.so...
done. #0 0xfda91778 in wxWindowBase::SetValidator ()
from /usr/local/lib/libwx_gtk.so
(gdb) where #0 0xfda91778 in wxWindowBase::SetValidator ()
from /usr/local/lib/libwx_gtk.so #1 0xfda90c68 in wxWindowBase::CreateBase () from /usr/local/lib/libwx_gtk.so #2 0xfd9ac448 in wxButton::Create () from /usr/local/lib/libwx_gtk.so #3 0xfe2528d8 in _wrap_new_wxButton ()
from /usr/local/lib/python1.5/site-packages/wxPython/wxc.so #4 0x1e7d0 in PyEval_CallObjectWithKeywords () #5 0x4ce18 in builtin_apply () #6 0x1e7d0 in PyEval_CallObjectWithKeywords () #7 0x1d050 in eval_code2 () #8 0x1ed70 in call_function () #9 0x1e7ec in PyEval_CallObjectWithKeywords () #10 0x384e4 in PyInstance_New () #11 0x1e7d0 in PyEval_CallObjectWithKeywords () #12 0x1d050 in eval_code2 () #13 0x1ed70 in call_function () #14 0x1e7ec in PyEval_CallObjectWithKeywords () #15 0x384e4 in PyInstance_New () #16 0x1e7d0 in PyEval_CallObjectWithKeywords () #17 0x1d050 in eval_code2 () #18 0x1ceb0 in eval_code2 () #19 0x1ed70 in call_function () #20 0x1e7ec in PyEval_CallObjectWithKeywords () #21 0xfe1e1a4c in __wxStart ()
from /usr/local/lib/python1.5/site-packages/wxPython/wxc.so #22 0x1e7d0 in PyEval_CallObjectWithKeywords () #23 0x1d050 in eval_code2 () #24 0x1ceb0 in eval_code2 () #25 0x1ed70 in call_function () #26 0x1e7ec in PyEval_CallObjectWithKeywords () #27 0x384e4 in PyInstance_New () #28 0x1e7d0 in PyEval_CallObjectWithKeywords () #29 0x1d050 in eval_code2 () #30 0x1ceb0 in eval_code2 () #31 0x19f70 in PyEval_EvalCode () #32 0x2ef0c in run_node () #33 0x2e2e8 in PyRun_SimpleFile () #34 0x1804c in Py_Main ()
(gdb)
···
On Mon, 6 Nov 2000 09:11:48 -0800, "Robin Dunn" <robin@alldunn.com> wrote:
_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net http://lists.sourceforge.net/mailman/listinfo/wxpython-users