[Distutils] Linking C++ under Linux

Bill Spotz wfspotz at sandia.gov
Mon Jan 12 12:49:54 EST 2004


On Monday, January 12, 2004, at 09:55  AM, Bill Spotz wrote:

> Here is the link line generated by distutils on the Linux platform:
>
> gcc -shared build/temp.linux-i686-2.2/Epetra_wrap.o -LCommon 
> -L/usr/netpub/Trilinos-10_31_03/lib -L/usr/netpub/swig-1.3.19/lib 
> -L/usr/local/python-2.2.1/lib/python2.2/config -lcommon -lswigpy 
> -lepetra -lblas -llapack -lg2c -lpython2.2 -o 
> build/lib.linux-i686-2.2/PyTrilinos/_Epetra.so
>
> What surprises me is that the command is gcc rather than c++ (as it is 
> on the mac) and that, given this fact, there are no c++ libraries 
> included in the command line.

OK, on the PythonMac-SIG list, Jack Jansen wrote

> Distutils doesn't properly support C++ until Python 2.3; for earlier
> versions you have to do various bizarre things to force it to link on
> various platforms.

Which would seem to be the answer to my problem.  And in fact, 
upgrading to python 2.3 and recompiling, the link command from 
distutils changes from gcc to c++, which is what I was hoping for.  Now 
it is not finding SWIG_TypeClientData, so I may be switching over to a 
SWIG mailing list.

** Bill Spotz                                              **
** Sandia National Laboratories  Voice: (505)845-0170      **
** P.O. Box 5800                 Fax:   (505)284-5451      **
** Albuquerque, NM 87185-0316    Email: wfspotz at sandia.gov **





More information about the Distutils-SIG mailing list