Problems building and testing CXX demo
[g++ 2.95.2 on solaris 2.5.1] I'm trying to build the latest CXX demonstration module 'example' and run its test suite. Seeing that CXX ships with a 'setup.py' file, I used Distutils to build and install the module. I was also careful to follow the Readme file's warnings about first building Python with the LINKCC and LDSHARED environmental variables set. Python built fine, and the 'example' module builds fine - though it takes about 30 minutes to build! Once I install the built 'example' module, I can fire up the python interpreter and type
from example import * ... (an 'r' gets created and destroyed) test()
At that point, python aborts and dumps core. The stack trace looks like a thrown exception is leaking out and aborting the program. Has anyone else noticed this problem? I can provide a stack trace if necessary. Can anyone provide some advice on how to build the 'python.cxx' sample interpreter that's supposed to link with the 'example' module? I've tried to work through adding this module to a 'Setup.in' file and going through the 'Makefile.pre.in' steps to build an embedded interpreter, but that all seems like overkill for such a deceptively simple task. Any input would be appreciated. -- Steven E. Harris Primus Knowledge Solutions, Inc. http://www.primus.com
Steve Harris writes: [snip]
Can anyone provide some advice on how to build the 'python.cxx' sample interpreter that's supposed to link with the 'example' module?
I can't help with most of this, but here's an example of a successful build of python.o using KCC under solaris 2.6 (note that this takes less that 2 minutes on an Ultra 1 -- anyone know whether recent gcc snapshots are doing a better job on templates?) <peacock ~/mail/cxx-barry-2000-04-30/CXX> time bash -v testit.sh KCC -c -I/nfs/brant/local1/lib/python/solaris/include/python1.5 -IInclude \ -I/nfs/brant/local1/lib/python/include/python1.5 -O Demo/python.cxx -o python.o KCC -c -I/nfs/brant/local1/lib/python/solaris/include/python1.5 -IInclude \ -I/nfs/brant/local1/lib/python/include/python1.5 -O Src/cxxsupport.cxx -o cxxsupport.o KCC -c -I/nfs/brant/local1/lib/python/solaris/include/python1.5 -IInclude \ -I/nfs/brant/local1/lib/python/include/python1.5 -O Demo/example.cxx -o example.o KCC -c -I/nfs/brant/local1/lib/python/solaris/include/python1.5 -IInclude \ -I/nfs/brant/local1/lib/python/include/python1.5 -O Demo/rtest.cxx -o rtest.o KCC -c -I/nfs/brant/local1/lib/python/solaris/include/python1.5 -IInclude \ -I/nfs/brant/local1/lib/python/include/python1.5 -O Demo/r.cxx -o r.o KCC -c -I/nfs/brant/local1/lib/python/solaris/include/python1.5 -IInclude \ -I/nfs/brant/local1/lib/python/include/python1.5 -O Src/cxx_extensions.cxx -o cxx_extensions.o cc -c -I/nfs/brant/local1/lib/python/solaris/include/python1.5 -IInclude \ -I/nfs/brant/local1/lib/python/include/python1.5 -O Src/cxxextensions.c -o cxxextensions.o KCC -G example.o cxxsupport.o cxx_extensions.o cxxextensions.o r.o rtest.o -o libcxx.so C++ prelinker: Recompiling Demo/example.cxx C++ prelinker: Recompiling Src/cxx_extensions.cxx KCC python.o -o mypython -L/nfs/brant/local1/lib/python/solaris/lib/python1.5/config \ -lpython1.5 -lm -lnsl -lsocket -ldl ./libcxx.so 71.57u 4.94s 1:33.04 82.2% <peacock ~/mail/cxx-barry-2000-04-30/CXX> mypython Greetings. Type from example import *; test() Python 1.5.2 (#2, Aug 26 1999, 22:59:52) [C] on sunos5 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
from example import * test() Correctly caught CXX: type error. Exception value: CXX: type error. Exception traceback: None Numbers: ok String: ok List: ok Dict: ok Tuple: ok STL test: ok Extension object test: ok. Module test ok.
Steve Harris wrote:
[g++ 2.95.2 on solaris 2.5.1]
I used to fail to compile CXX with Gcc 2.95.2 ;) It fails either on Sun/Solaris and SGI/Irix. The first Gcc snapshot that can compile CXX is 20/03/2000 you can find it (and newer snapshots) at http://www.fsf.org/software/gcc/gcc.html This leads to no problem, AFAIK...
Any input would be appreciated.
Here's the makefile, with both Gcc and SGI compiler (you have to set your own paths): # # INCS=-I./Include -I/tools/py/include/python1.5 # CCC=g++ #CCC=CC -64 -LANG:std -woff 1401,1069 # use special ar to instanciate templates (pre-linker) AR=ar clq #AR=CC -woff 1401 -ar -o # OBJST=Demo/arraytest.o Demo/example.o Demo/python.o Demo/r.o Demo/rtest.o OBJSL=Src/cxx_extensions.o Src/cxxextensions.o Src/cxxsupport.o LIBS=libCXX.a -L/tools/py/64/lib/python1.5/config -lpython1.5 # # .c.o: $(CCC) $(INCS) -c $< -o $@ .cxx.o: $(CCC) $(INCS) -c $< -o $@ all: libs demos demos: libs $(OBJST) $(CCC) $(LIBS) $(OBJS) -o rtest libs: $(OBJSL) $(AR) libCXX.a Src/*.o clean: rm -f libCXX.a Src/*.o Demo/*.o Marcvs [alias Our extensions are also working fine, but we are NOT using all functionnalities of CXX 4.2 ] ----------------------------------------------------------------------- Marc POINOT Alias: marcvs Email: poinot@onera.fr ONERA -MFE/DSNA/ELSA Tel: 01.46.73.42.84 Info: elsa-info@onera.fr 29, Div. Leclerc Fax: 01.46.73.41.66 Site: 92322 Chatillon FRANCE Project: elsA Web: http://www.onera.fr
Steve Harris writes:
Python built fine, and the 'example' module builds fine - though it takes about 30 minutes to build!
Out of curiosity, are you still having to live with 30 minute compile times, or did you find a way to speed things up? Regards, Phil
participants (3)
-
Marc Poinot -
Phil Austin -
Steve Harris