[Distutils] sample setup.py for SWIG'd extensions in a package.

Joe Van Andel vanandel@ucar.edu
Wed, 02 Feb 2000 14:44:40 -0700

This is a multi-part message in MIME format.
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

If you are interested in a contribution to a HOWTO type document, here's
a setup.py I wrote for a set of extensions for radar processing.  The
package has 3 sub-packages: 'a1pp','rec', and 'util', with both .py
files and C++ extensions.  I use 'SWIG' to generate wrappers for my C++
classes, which generates a Python wrapper, and an extension.   

I'm definitely not done with this, but I though anyone using SWIG's
wrapped classes would like to see how the extensions are named.  (It
took some experimentation for me to figure it out).

Joe VanAndel  	          
National Center for Atmospheric Research
Internet: vanandel@ucar.edu
Content-Type: text/plain; charset=us-ascii;
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;

#!/usr/bin/env python

# setup script for building Python Environment for Radar Processing
# PERP extensions to Python

# To use:
#   * run this to build :
#       python setup.py build
#     or this to build and install it
#       python setup.py install

# created 01 Feb 2000 Joseph VanAndel

import os
from glob import glob
from distutils.command import install
from distutils.core import setup

# the locate of the RDSS source tree.

# location of include files, based on RDSS
DDU_INC =  RDSS + '/spol/ddutils'
SPOL_INC = RDSS + '/spol/include'

#DDM_LIB =  RDSS + '/spol/ddutils/i386/libddm.a'
DDM_LIB =  RDSS + '/spol/ddutils/i386'

setup (name = "Perp",
       version = "0.2",
       maintainer = "Joseph VanAndel",
       maintainer_email = "vanandel@ucar.edu",
       description = "Python Environment for Radar Processing(PERP)",
#       cmdclass = {'install': Install},
       packages = ['','a1pp','rec','util'],
       install_path = 'Perp',
       include_dirs = ['./include',DDU_INC,SPOL_INC],
#       ext_package = 'Perp',
       ext_modules = [
                       {'sources': ['a1pp/pulsepair.cc',
                       'libraries': ['gcc', 'stdc++','pthread']
                       {'sources': ['a1pp/IIR_Filter.cc',
                       'libraries': ['gcc', 'stdc++','pthread']
                       {'sources': ['rec/RadarFeature.cc',
                       'libraries': ['gcc', 'stdc++','pthread']
                       {'sources': ['util/du_SweepUtil.cc',
                       'library_dirs': [DDM_LIB],
                       'libraries': ['ddm','gcc', 'stdc++','pthread'],
#                       'extra_preargs': [DDM_LIB]