File:  [CENS] / python / pyGiNaC / setup.py
Revision 1.4: download - view: text, annotated - select for diffs - revision graph
Thu Mar 15 13:48:35 2001 UTC (17 years, 5 months ago) by pearu
Branches: MAIN
CVS tags: HEAD
Major revision, now more explicit wrapping

    1: #!/usr/bin/env python
    2: 
    3: import sys,os,string,time
    4: 
    5: if eval(sys.version[0])<2:
    6:     print "You'll need Python 2.0 or higher to build PyGiNaC"
    7:     sys.exit()
    8: 
    9: #++++++++++++++++++++ boost +++++++++++++++++++++
   10: boost_dir = '/home/pearu/cvs/boost'
   11: boost_dir = '/usr/local/share/boost'
   12: 
   13: bpl_dir = os.path.join(boost_dir,'libs/python/src')
   14: bpl_src = map(lambda f:os.path.join(bpl_dir,f),
   15:               ['classes.cpp','conversions.cpp','extension_class.cpp',
   16:                'functions.cpp','init_function.cpp','module_builder.cpp',
   17:                'objects.cpp','types.cpp'])
   18: 
   19: #++++++++++++++++++++ GiNaC +++++++++++++++++++++
   20: 
   21: #ginac = '/usr/local'
   22: 
   23: #ginac_lib = 
   24: 
   25: 
   26: #++++++++++++++++++++++++++++++++++++++++++++++++
   27: from distutils.core import setup, Extension
   28: 
   29: #+++++++++++++ replace gcc with g++ +++++++++++++
   30: from distutils import sysconfig
   31: save_init_posix = sysconfig._init_posix
   32: def my_init_posix():
   33:     save_init_posix()
   34:     g = sysconfig._config_vars
   35:     if g['LDSHARED'][:3]=='gcc':
   36:         print 'my_init_posix: changing LDSHARED =',`g['LDSHARED']`,
   37:         g['LDSHARED'] = 'g++'+g['LDSHARED'][3:]
   38:         print 'to',`g['LDSHARED']`
   39: sysconfig._init_posix = my_init_posix
   40: 
   41: #++++++++++++++++++++ GiNaC._ginac +++++++++++++++++++++
   42: 
   43: cppsrc = [os.path.join('src','_ginac.cpp')]
   44: cppsrc = [os.path.join('tools','wrappers','ginac.cpp')]
   45: 
   46: ginac_ext = Extension('GiNaC._ginac',
   47:                      sources=cppsrc+bpl_src,
   48:                      include_dirs=[boost_dir],
   49:                      libraries=['cln','ginac'],
   50:                      library_dirs=[]
   51:                      )
   52: 
   53: 
   54: #++++++++++++++++++++ setup +++++++++++++++++++++
   55: 
   56: setup (name = "PyGiNaC",
   57:        version = "0.0.0",
   58:        description = "",
   59:        author = "Pearu Peterson",
   60:        author_email = "pearu@cens.ioc.ee",
   61:        licence = "LGPL",
   62:        long_description= "",
   63:        url = "",
   64:        ext_modules = [ ginac_ext ],
   65:        packages = ['GiNaC'],
   66:        package_dir = {'GiNaC': 'lib'},
   67:        )

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>