[PYTHON C++-SIG] LLNL Python/C++ integration: current status

Geoffrey Furnish furnish at laura.llnl.gov
Fri Feb 14 18:47:37 CET 1997


Harri Pasanen writes:
 > Geoffrey Furnish writes:
 > > 
 > > One of the first things which has to be faced is how to build a Python
 > > which can support C++.  On most systems, this means in particular,
 > > that "main" must be compiled with the C++ compiler.  Moreover, lacking
 > > platform ABI's for C++, python must be built with a particular C++
 > > compiler--the one you will use for your extension work.  You can't mix
 > > and match .o's from C++ compilers the way you (often) can with .o's
 > > from C compilers.
 > 
 > Just a sidetracked field-report here:
 > 
 > Under Linux, with g++, it is possible to build dynamic C++ extension
 > modules that run fine under the vanilla autoconf built python.

Yes, but this is because of the ELF file format, and is not really a
general capability for systems XYZ.  Also, you are probably not using
templates, or are using one of the <adjective omitted> instantiation
models which result in severe code bloat through replicate
instantiation with static linkage.  More sophisticated template
closure schemes generally involve a speculative link phase with some
sort of auto-construction technique for missing templates, finalized
by a real link.  For such models, you really do have to link with the
C++ compiler.

 > For instance, I have libwxmodule.so, which wraps large parts of the
 > wxWindows C++ class library for wxPython.
 > 
 > I would imagine this would work on other platforms with gcc/g++.

Not necessary.  You are depending on a feature of the ELF system,
which the Linux developers (HJ and co) worked hard to perfect.

 > Back to mainstream:
 > 
 > I took a look at KAI C++ compiler page, and it seemed a Unix only
 > product.   Have you tried your stuff on NT platform?

Send them email, you might be pleasantly surprised.

 > All in all, looks Cool.
 > 
 > Harri
 > 
 > PS. Have you tracked Jim Fulton's work on extension classes
 > <http://www.digicool.com/papers/ExtensionClass.html>
 > 
 > PSS. Are there any C++ compilers for Linux that are 'up to snuff'?

I am under the impression that KCC is supposed to be out for Linux
sometime this spring, but that is rumor, I am not representing this
statement as fact.

 > If not, your stuff won't be usable on Beowulf clusters until g++
 > catches up... ;-)   
 > <http://cesdis.gsfc.nasa.gov/linux-web/beowulf/beowulf.html>

I would like to respond to this again, even though there was quite a
bit of discussion about it yesterday.

The bottom line is that we at LLNL are building this C++ interface
/because we need it/.  We will build it whether other people like it
or not.  :-).  However, if in the fortuitous event that it is useful
to other people, we will be happy to make it available.  We are
willing to do what we can /reasonably/ do to facilitate use by others,
but there are some sorts of actions which don't qualify under the
"reasonable" rubric:

1) Expending lots of staff time to dumb down the interface so it will
   compile on standards-nonconformant compilers that we won't be using
   internally anyway.

2) Expending staff time to test these patches on every compiler on
   every OS on every hardware platform under the sun, etc.

It is our belief that by writing it to the language standard, which
will be ratified by ANSI and ISO imminently, that we will in so doing,
create a package which is by definition, portable to every system of
interest.  If it happens that you have no way to get an ANSI C++
compiler on your computer, we're sorry.  But we do not believe this is
really a situation which will be of much /true/ concern, for very many
people for very much longer.  C++ is maturing rapidly.  The last year
in particular has seen dramatic improvements in the quality of
compiler offerings by all the significant vendors.  Many of them still
have territory to make up, but we are sure they will.  

Barry asked about a survey of compiler vendors.  We have effectively
done this, although we don't have a written comparison chart.  What we
have are industry contacts in most of the major software houses, and
pretty uniformly, vendors are promising support for conformance to the
ANSI C++ standard, soon after ratification.  Many vendors are
currently, or will be shortly, shipping compilers with "draft standard
conformance", which is a huge step up over the "barely better than
Cfront" condition of the market only 1 year ago.

I know it is tough when you're sitting in a degree program, strapped
for cash, working for neandrathal advisors who claim that don't have
money to buy you a single solitary commercial software product.  There
are tactics for coping with such situations, which ultimately have a
lot to do with your personality and stamina for politics.  Write a
departmental memo to your academic dean, telling them your university
is pathetically behind the times for not having modern language
compilers.  Go to faculty staff meetings and criticize in a public
forum, the spending choices the faculty are making.  Call up your
vendor and ask about student specials, beta programs, and outright
grants-to-the-poor.  SGI has a really stupdendous program for academic
support, called the "Varsity program".  Get  on it.  If you school has
other kinds of machines, call up your CS dept industry liason, and
paint them into a corner if they don't have a site license agreement
with every major workstation vendor.  Bottom line, you don't have to
take it sitting down.  

With specific reference to g++, don't tell me, tell Cygnus.  They
listen.  G++ is under rapid development, and has led the industry in
feature support for most of its product life.  It happens to be a
little behind the ball right now, since the vendors are finally
starting to get serious, but this is no reason to give up hope for
g++.  It may be a reason to find an interim alternative.

-- 
Geoffrey Furnish		email: furnish at llnl.gov
LLNL X/ICF			phone: 510-424-4227	fax: 510-423-0925

_______________
C++-SIG - SIG for Development of a C++ Binding to Python

send messages to: c++-sig at python.org
administrivia to: c++-sig-request at python.org
_______________



More information about the Cplusplus-sig mailing list