File:  [CENS] / python / pyGiNaC / setup.py
Revision 1.9: download - view: text, annotated - select for diffs - revision graph
Mon Mar 26 05:38:25 2001 UTC (16 years, 8 months ago) by pearu
Branches: MAIN
CVS tags: HEAD
Finished matrix, impl.ncmul, more cleanup

#!/usr/bin/env python

import sys,os,string,time

if eval(sys.version[0])<2:
    print "You'll need Python 2.0 or higher to build PyGiNaC"
    sys.exit()

#++++++++++++++++++++ boost +++++++++++++++++++++
boost_dir = '/home/pearu/cvs/boost'
boost_dir = '/usr/local/share/boost'

bpl_dir = os.path.join(boost_dir,'libs/python/src')
bpl_src = map(lambda f:os.path.join(bpl_dir,f),
              ['classes.cpp','conversions.cpp','extension_class.cpp',
               'functions.cpp','init_function.cpp','module_builder.cpp',
               'objects.cpp','types.cpp'])

#++++++++++++++++++++ GiNaC +++++++++++++++++++++

#ginac = '/usr/local'

#ginac_lib = 


#++++++++++++++++++++++++++++++++++++++++++++++++
from distutils.core import setup, Extension

#+++++++++++++ replace gcc with g++ +++++++++++++
from distutils import sysconfig
save_init_posix = sysconfig._init_posix
def my_init_posix():
    save_init_posix()
    g = sysconfig._config_vars
    if g['LDSHARED'][:3]=='gcc':
        print 'my_init_posix: changing LDSHARED =',`g['LDSHARED']`,
        g['LDSHARED'] = 'g++'+g['LDSHARED'][3:]
        print 'to',`g['LDSHARED']`
sysconfig._init_posix = my_init_posix

#++++++++++++++++++++ GiNaC._ginac +++++++++++++++++++++

ginac_cpp = os.path.join('src','_ginac.cpp')
ginac_cpp = os.path.join('tools','wrappers','ginac.cpp')

cppsrc = [ginac_cpp]

if 1:
    wrap_input = ['symbol','numeric','constant','relational',
                  'lst','idx','varidx','power','add','mul']
    wrap_input = ['ncmul']
    execfile(os.path.join('tools','wrappers','build.py'))
    wrapper_dir = os.path.join('tools','wrappers')
    build_ginac_cpp(wrap_input,ginac_cpp)

ginac_ext = Extension('GiNaC._ginac',
                      sources=cppsrc+bpl_src,
                      include_dirs=[boost_dir],
                      libraries=['ginac','cln'],
                      library_dirs=[],
                      define_macros=[('DEBUG_PYGINAC', None)],
                     )


#++++++++++++++++++++ setup +++++++++++++++++++++

setup (name = "PyGiNaC",
       version = "0.0.0",
       description = "",
       author = "Pearu Peterson",
       author_email = "pearu@cens.ioc.ee",
       licence = "LGPL",
       long_description= "",
       url = "",
       ext_modules = [ ginac_ext ],
       packages = ['GiNaC'],
       package_dir = {'GiNaC': 'lib'},
       )

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