Diff for /python/pyGiNaC/setup.py between versions 1.27 and 1.28

version 1.27, 2001/04/26 19:44:48 version 1.28, 2001/04/27 11:39:49
Line 3 Line 3
 #   Setup file for building/installing PyGiNaC  #   Setup file for building/installing PyGiNaC
 #  #
 # Requirements:  # Requirements:
 #   Python 2.0 or higher (http://www.python.org/)  #   Python 2.1 or higher (http://www.python.org/)
 #   GiNaC 0.8.0 or higher (http://www.ginac.de/)  #   GiNaC 0.8.1 or higher (http://www.ginac.de/)
 #     For GiNaC, you'll need CLN 1.1 (http://clisp.cons.org/~haible/packages-cln.html)  #     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/)  #       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/)  #   Boost 1.21.1 or higher (http://www.boost.org/)
 #    #  
 # Usage:  # Usage:
 #   > python setup.py doc install  # this will generate ginac.doc, builds _ginac  #   > python setup.py install  # this will build and install ginac
 #                                  # and installs the package.  #   > python setup.py test -v  # this will run doctests.
 #   > python setup.py test -v      # this will generate and run test/test_dt.py  
 #  #
 # In Python `import ginac'. Module `ginac' extension classes exposing  # In Python `import ginac'. See doc/ginac.doc.html for examples.
 # almost all GiNaC classes to Python.  # See GiNaC documentation (http://www.ginac.de/tutorial/) for
 # See GiNaC documentation (http://www.ginac.de/tutorial/) for usage.  # capabilities and limitations.
 #  
 # Notes:  
 # 1. Compilation of PyGiNaC requires more than 160MB memory (with gcc -O2  
 #   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>  # Pearu Peterson <pearu@cens.ioc.ee>
 # 30 March 2001  # 26 April 2001
   
 __credits__ = """\  
 GiNaC people (www.ginac.de), for the GiNaC library.  
 Boost.Python people (www.boost.org), for BPL that considerably  
 simplified the wrapping of GiNaC C++ classes to Python.  
 """  
   
 import sys,os,string,time  import sys,os
   
 #++++++++++++++ Require Python 2.x +++++++++++++  
   
 if eval(sys.version[0])<2:  
     print "You'll need Python 2.0 or higher to build PyGiNaC"  
     sys.exit()  
   
 #++++++++++++++ Rebuild ++++++++++++++++++++++++  
 rebuild = 0  
 gendoc = 0  
 gentest = 0  gentest = 0
 disable_opt = 1 # set 0 for final compilation  
   
 if 'test' in sys.argv:  if 'test' in sys.argv:
     i = sys.argv.index('test')      i = sys.argv.index('test')
     gentest = 1      gentest = 1
Line 57  if 'test' in sys.argv: Line 30  if 'test' in sys.argv:
         gentest = 2          gentest = 2
         del sys.argv[i+1]          del sys.argv[i+1]
     del sys.argv[i]      del sys.argv[i]
 if 'doc' in sys.argv:  
     del sys.argv[sys.argv.index('doc')]  
     gendoc = 1  
   
 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','flags','exvector',  
               'indexed','color','clifford','tensor']  
   
 wrap_input = ['symbol','numeric','constant','relational',  
               'lst','power','add','mul',  
               'ncmul','pseries','matrix','function','inifcns',  
               'function','flags','exvector']  
   
 #wrap_input += ['indexed','color','clifford','tensor']  
   
 #wrap_input = ['function','inifcns']  
 #wrap_input = ['add','mul','power','lst','pseries','relational','matrix','numeric','constant','symbol','varidx']  
 #wrap_input = ['symbol','function']  
 #wrap_input = ['symbol','tensor']  
 #wrap_input = ['symbol','add','mul','lst','numeric','power']  
   
 #++++++++++++++++ Parameters ++++++++++++++++  
 nof_lst_params = 10   # max 15 for ginac, max 10 for boost.python, min 1  
 nof_ncmul_params = 6  # max 6  
 nof_function_params = 9 # max 13 for ginac, max 9 for boost.python, min 1  
 #++++++++++++++++++++ boost +++++++++++++++++++++  
   
 boost_dir = '/usr/local/share/boost'  #++++++++++++++++++++ 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()  
   
   boost_dir = 'boost'
 bpl_dir = os.path.join(boost_dir,'libs','python','src')  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',
Line 110  bpl_src = map(lambda f:os.path.join(bpl_ Line 44  bpl_src = map(lambda f:os.path.join(bpl_
 from distutils.core import setup, Extension  from distutils.core import setup, Extension
   
 #+++HACK: replace linker 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():
Line 119  def my_init_posix(): Line 54  def my_init_posix():
         print 'my_init_posix: changing LDSHARED =',`g['LDSHARED']`,          print 'my_init_posix: changing LDSHARED =',`g['LDSHARED']`,
         g['LDSHARED'] = 'g++'+g['LDSHARED'][3:]          g['LDSHARED'] = 'g++'+g['LDSHARED'][3:]
         print 'to',`g['LDSHARED']`          print 'to',`g['LDSHARED']`
     if disable_opt and g['OPT'][:6]=='-g -O2':  
         print 'my_init_posix: changing OPT =',`g['OPT']`,  
         g['OPT'] = '-g'+g['OPT'][6:]  
         print 'to',`g['OPT']`  
 sysconfig._init_posix = my_init_posix  sysconfig._init_posix = my_init_posix
   
 #+++++++++++++++++ PyGiNaC version ++++++++++++++  #+++++++++++++++++ PyGiNaC version ++++++++++++++
   
   wrapper_dir = 'wrappers3'
   lib_dir = 'lib3'
   
 major_version = 0  major_version = 0
 minor_version = 2  minor_version = 4
 try: execfile(os.path.join('tools','get_revision.py'))  try: execfile(os.path.join('tools','get_revision.py'))
 except: revision_version = 0  except: revision_version = 0
 version='%d.%d.%d'%(major_version,minor_version,revision_version)  version='%d.%d.%d'%(major_version,minor_version,revision_version)
   
 #++++++++++++++++ ginac._ginac +++++++++++++++++++++  #++++++++++++++++ ginac._ginac +++++++++++++++++++++
   
 ginac_cpp = os.path.join('src','_ginac.cpp')  ex_src = [
 wrapper_dir = 'wrappers'      os.path.join(wrapper_dir,'ginac_enhancements.cpp'),
       os.path.join(wrapper_dir,'ex_py.cpp'),
 cppsrc = [os.path.join(wrapper_dir,'ginac_enhancements.cpp'),      os.path.join(wrapper_dir,'python_repr.cpp'),
           os.path.join(wrapper_dir,'slice.c'),      os.path.join(wrapper_dir,'python_str.cpp'),
           ginac_cpp,      os.path.join(wrapper_dir,'pyfunc.cpp'),
           os.path.join(wrapper_dir,'python_repr.cpp'),      os.path.join(wrapper_dir,'slice.c'),
           os.path.join(wrapper_dir,'python_str.cpp'),      ]
           ]  
   
   
 execfile(os.path.join(wrapper_dir,'build.py'))  
   
 if gendoc:  
     build_ginac_cpp(wrap_input,ginac_cpp,wrapper_dir,onlydoc=1,onlytest=0,  
                     vers=version,credits=__credits__)  
   
 if gentest:  if gentest:
     build_ginac_cpp(wrap_input,ginac_cpp,wrapper_dir,onlytest=1)      fon = os.path.join(lib_dir,'doc','__init__.py')
     if gentest==2:      if gentest==2:
         os.system('%s %s -v'%(sys.executable,os.path.join('test','test_dt.py')))          os.system('%s %s -v'%(sys.executable,fon))
     else:      elif gentest==1:
         os.system('%s %s'%(sys.executable,os.path.join('test','test_dt.py')))          os.system('%s %s'%(sys.executable,fon))
   
 if len(sys.argv)==1:  if len(sys.argv)==1:
     print "PyGiNaC Version",version      print "PyGiNaC Version",version
     sys.exit()      sys.exit()
 if rebuild or not os.path.exists(ginac_cpp):  
     build_ginac_cpp(wrap_input,ginac_cpp,wrapper_dir,onlydoc=0,onlytest=0,  
                     vers=version,credits=__credits__)  
   
 ginac_ext = Extension('ginac._ginac',  ginac_ext = Extension('ginac._ginac',
                       sources=cppsrc+bpl_src,                        sources=ex_src+bpl_src,
                       include_dirs=[boost_dir,wrapper_dir],                        include_dirs=[boost_dir,wrapper_dir],
                       libraries=['ginac','cln'],                        libraries=['ginac','cln'],
                       library_dirs=[],  # Add here the paths to the location
                       define_macros=[  # of ginac and cln libraries:
 #    ('DEBUG_PYGINAC', None),                        library_dirs=[], 
     ],  
                       )                        )
   
 #++++++++++++++++++++ setup +++++++++++++++++++++  #++++++++++++++++++++ setup +++++++++++++++++++++
   
 setup (name = "PyGiNaC",  setup (name = "PyGiNaC",
        version = version,         version = version,
        description = "PyGiNaC --- the wrapper of C++ library GiNaC to Python",         description = "PyGiNaC --- Python Interface to GiNaC",
        author = "Pearu Peterson",         author = "Pearu Peterson",
        author_email = "pearu@cens.ioc.ee",         author_email = "pearu@cens.ioc.ee",
        maintainer = "Pearu Peterson",         maintainer = "Pearu Peterson",
Line 189  setup (name = "PyGiNaC", Line 111  setup (name = "PyGiNaC",
        long_description= """         long_description= """
 GiNaC is an open framework for symbolic computation within the C++  GiNaC is an open framework for symbolic computation within the C++
 programming language (http://www.ginac.de/).  programming language (http://www.ginac.de/).
 PyGiNaC is a Python package that provides a transparent interface  PyGiNaC is a Python extension package that provides
 to GiNaC library. Currently the following GiNaC classes are exposed:  an interface to the GiNaC library.
   ex, symbol, numeric, constant, relational, add, mul, power, ncmul,  
   matrix, pseries, function, idx, varidx, tensor, indexed,  
   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/",         url = "http://cens.ioc.ee/projects/pyginac/",
        ext_modules = [ ginac_ext ],         ext_modules = [ ginac_ext ],
        packages = ['ginac','ginac.doc'],         packages = ['ginac','ginac.doc'],
        package_dir = {'ginac': 'lib',         package_dir = {'ginac': lib_dir,
                       'ginac.doc':os.path.join('lib','doc') },                        'ginac.doc':os.path.join(lib_dir,'doc') },
        )         )
   
 print "PyGiNaC Version",version  print "PyGiNaC Version",version

Removed from v.1.27  
changed lines
  Added in v.1.28


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