Diff for /python/pyGiNaC/setup.py between versions 1.2 and 1.16

version 1.2, 2001/03/10 06:04:30 version 1.16, 2001/04/01 11:49:59
Line 1 Line 1
 #!/usr/bin/env python  #!/usr/bin/env python
   #
   #   Setup file for building/installing PyGiNaC
   #
   # Requirements:
   #   Python 2.0 or higher (http://www.python.org/)
   #   GiNaC 0.8.0 or higher (http://www.ginac.de/)
   #     For GiNaC, you'll need CLN 1.1 (http://clisp.cons.org/~haible/packages-cln.html)
   #       Optional, but recommended, CLN can use GMP 3.1.1 (http://www.swox.com/gmp/)
   #   Boost 1.21.1 or higher (http://www.boost.org/)
   #
   # Usage:
   #   > python setup.py install
   #
   # In Python `import ginac'. Module `ginac' contains number of extension classes.
   # About their usage, see GiNaC docs (http://www.ginac.de/tutorial/)
   #
   # Note:
   #   Compilation of PyGiNaC requires more than 160MB memory (with gcc
   #   on Intel Linux). However, if you don't need all the GiNaC classes
   #   to be exposed to Python, you can edit the list `wrap_input' below
   #   to indicate your needs, this will decrease also the memory consumption
   #   during the compilation. You don't need to worry about class dependencies
   #   they are solved automatically. After you edit `wrap_input', run
   #  > python setup.py reinstall
   #
   # Pearu Peterson <pearu@cens.ioc.ee>
   # 30 March 2001
   
 import sys,os,string,time  import sys,os,string,time
   
   #++++++++++++++ Require Python 2.x +++++++++++++
   
 if eval(sys.version[0])<2:  if eval(sys.version[0])<2:
     print "You'll need Python 2.0 or higher to build PyGiNaC"      print "You'll need Python 2.0 or higher to build PyGiNaC"
     sys.exit()      sys.exit()
   
   #++++++++++++++ Rebuild ++++++++++++++++++++++++
   rebuild = 0
   
   if 'rebuild' in sys.argv:
       sys.argv[sys.argv.index('rebuild')] = 'build'
       rebuild = 1
   if 'reinstall' in sys.argv:
       sys.argv[sys.argv.index('reinstall')] = 'install'
       rebuild = 1
   
   wrap_input = ['symbol','numeric','constant','relational',
                 'lst','idx','varidx','power','add','mul',
                 'ncmul','pseries','matrix','function','inifcns',
                 'function']
   wrap_input = ['function']
   
 #++++++++++++++++++++ boost +++++++++++++++++++++  #++++++++++++++++++++ boost +++++++++++++++++++++
 boost_dir = '/home/pearu/cvs/boost'  
 bpl_dir = os.path.join(boost_dir,'libs/python/src')  boost_dir = '/usr/local/share/boost'
   
   if not os.path.isdir(boost_dir):
       print 'boost_dir=%s must be existing directory.'%(`boost_dir`)
       print 'Get Boost from http://www.boost.org/ and fix its path in setup.py'
       sys.exit()
   
   bpl_dir = os.path.join(boost_dir,'libs','python','src')
 bpl_src = map(lambda f:os.path.join(bpl_dir,f),  bpl_src = map(lambda f:os.path.join(bpl_dir,f),
               ['classes.cpp','conversions.cpp','extension_class.cpp',                ['classes.cpp','conversions.cpp','extension_class.cpp',
                'functions.cpp','init_function.cpp','module_builder.cpp',                 'functions.cpp','init_function.cpp','module_builder.cpp',
                'objects.cpp','types.cpp'])                 'objects.cpp','types.cpp'])
   
 #++++++++++++++++++++ GiNaC +++++++++++++++++++++  
   
 ginac = '/opt/GiNaC-0.7.3'  
   
 #ginac_lib =   
   
   
 #++++++++++++++++++++++++++++++++++++++++++++++++  #++++++++++++++++++++++++++++++++++++++++++++++++
 from distutils.core import setup, Extension  from distutils.core import setup, Extension
   
 #+++++++++++++ replace gcc with g++ +++++++++++++  #+++HACK: replace linker gcc with g++ +++++++++++
 from distutils import sysconfig  from distutils import sysconfig
 save_init_posix = sysconfig._init_posix  save_init_posix = sysconfig._init_posix
 def my_init_posix():  def my_init_posix():
     print 'my_init_posix: changing gcc to g++'  
     save_init_posix()      save_init_posix()
     g = sysconfig._config_vars      g = sysconfig._config_vars
     g['CC'] = 'g++'      if g['LDSHARED'][:3]=='gcc':
     g['LDSHARED'] = 'g++ -shared'          print 'my_init_posix: changing LDSHARED =',`g['LDSHARED']`,
           g['LDSHARED'] = 'g++'+g['LDSHARED'][3:]
           print 'to',`g['LDSHARED']`
 sysconfig._init_posix = my_init_posix  sysconfig._init_posix = my_init_posix
   
 #++++++++++++++++++++ test a1 +++++++++++++++++++++  #+++++++++++++++++ PyGiNaC version ++++++++++++++
   
 a1_ext = Extension('GiNaC.a1',  
                      sources=[os.path.join('src','a1.cpp')]+bpl_src,  
                      include_dirs=[boost_dir],  
                      libraries=[],  
                      library_dirs=[]  
                      )  
   
 a2_ext = Extension('GiNaC.a2',  
                      sources=[os.path.join('src','a2.cpp')]+bpl_src,  
                      include_dirs=[boost_dir],  
                      libraries=[],  
                      library_dirs=[]  
                      )  
   
   
 a3_ext = Extension('GiNaC.a3',  major_version = 0
                      sources=[os.path.join('src','a3.cpp')]+bpl_src,  minor_version = 0
                      include_dirs=[boost_dir],  try: execfile(os.path.join('tools','get_revision.py'))
                      libraries=['cln','ginac'],  except: revision_version = 0
                      library_dirs=[]  version='%d.%d.%d'%(major_version,minor_version,revision_version)
                      )  
   #++++++++++++++++ ginac._ginac +++++++++++++++++++++
 ginac_ext = Extension('GiNaC._ginac',  
                      sources=[os.path.join('src','_ginac.cpp')]+bpl_src,  ginac_cpp = os.path.join('src','_ginac.cpp')
                      include_dirs=[boost_dir],  
                      libraries=['cln','ginac'],  cppsrc = [ginac_cpp]
                      library_dirs=[]  
                      )  if rebuild or not os.path.exists(ginac_cpp):
 rawginac_ext = Extension('GiNaC.rawginac',      execfile(os.path.join('tools','wrappers','build.py'))
                      sources=[os.path.join('src','rawginac.cpp')]+bpl_src,      wrapper_dir = os.path.join('tools','wrappers')
                      include_dirs=[boost_dir],      build_ginac_cpp(wrap_input,ginac_cpp)
                      libraries=['cln','ginac'],  
                      library_dirs=[]  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 +++++++++++++++++++++
   
 setup (name = "PyGiNaC",  setup (name = "PyGiNaC",
        version = "0.0.0",         version = version,
        description = "",         description = "PyGiNaC --- the wrapper of C++ library GiNaC to Python",
        author = "Pearu Peterson",         author = "Pearu Peterson",
        author_email = "pearu@cens.ioc.ee",         author_email = "pearu@cens.ioc.ee",
          maintainer = "Pearu Peterson",
          maintainer_email = "pearu@cens.ioc.ee",
        licence = "LGPL",         licence = "LGPL",
        long_description= "",         long_description= """
        url = "",  GiNaC is an open framework for symbolic computation within the C++
   programming language (http://www.ginac.de/).
   PyGiNaC is a Python package that provides a transparent interface
   to GiNaC library. Currently the following GiNaC classes are exposed:
     ex, symbol, numeric, constant, relational, add, mul, power, ncmul,
     matrix, pseries, function, idx, varidx,
     lst, exvector, expair, exlist, epvector, etc.
   In addition, PyGiNaC provides wrappers for various elementary functions,
   such as sin, factorial, etc.
   """,
          url = "http://cens.ioc.ee/projects/pyginac/",
        ext_modules = [ ginac_ext ],         ext_modules = [ ginac_ext ],
        packages = ['GiNaC'],         packages = ['ginac'],
        package_dir = {'GiNaC': 'lib'},         package_dir = {'ginac': 'lib'},
        )         )
   
   print "PyGiNaC Version",version

Removed from v.1.2  
changed lines
  Added in v.1.16


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