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

version 1.16, 2001/04/01 11:49:59 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 install  #   > python setup.py install  # this will build and install ginac
 #  #   > python setup.py test -v  # this will run doctests.
 # In Python `import ginac'. Module `ginac' contains number of extension classes.  
 # About their usage, see GiNaC docs (http://www.ginac.de/tutorial/)  
 #  #
 # Note:  # In Python `import ginac'. See doc/ginac.doc.html for examples.
 #   Compilation of PyGiNaC requires more than 160MB memory (with gcc  # See GiNaC documentation (http://www.ginac.de/tutorial/) for
 #   on Intel Linux). However, if you don't need all the GiNaC classes  # capabilities and limitations.
 #   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
   
 import sys,os,string,time  import sys,os
   
 #++++++++++++++ Require Python 2.x +++++++++++++  gentest = 0
   if 'test' in sys.argv:
 if eval(sys.version[0])<2:      i = sys.argv.index('test')
     print "You'll need Python 2.0 or higher to build PyGiNaC"      gentest = 1
     sys.exit()      if len(sys.argv)>i+1 and sys.argv[i+1]=='-v':
           gentest = 2
 #++++++++++++++ Rebuild ++++++++++++++++++++++++          del sys.argv[i+1]
 rebuild = 0      del sys.argv[i]
   
 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 = '/usr/local/share/boost'  boost_dir = '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_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 70  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 83  sysconfig._init_posix = my_init_posix Line 58  sysconfig._init_posix = my_init_posix
   
 #+++++++++++++++++ PyGiNaC version ++++++++++++++  #+++++++++++++++++ PyGiNaC version ++++++++++++++
   
   wrapper_dir = 'wrappers3'
   lib_dir = 'lib3'
   
 major_version = 0  major_version = 0
 minor_version = 0  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 = [
       os.path.join(wrapper_dir,'ginac_enhancements.cpp'),
 cppsrc = [ginac_cpp]      os.path.join(wrapper_dir,'ex_py.cpp'),
       os.path.join(wrapper_dir,'python_repr.cpp'),
       os.path.join(wrapper_dir,'python_str.cpp'),
       os.path.join(wrapper_dir,'pyfunc.cpp'),
       os.path.join(wrapper_dir,'slice.c'),
       ]
   
   if gentest:
       fon = os.path.join(lib_dir,'doc','__init__.py')
       if gentest==2:
           os.system('%s %s -v'%(sys.executable,fon))
       elif gentest==1:
           os.system('%s %s'%(sys.executable,fon))
   
 if rebuild or not os.path.exists(ginac_cpp):  if len(sys.argv)==1:
     execfile(os.path.join('tools','wrappers','build.py'))      print "PyGiNaC Version",version
     wrapper_dir = os.path.join('tools','wrappers')      sys.exit()
     build_ginac_cpp(wrap_input,ginac_cpp)  
   
 ginac_ext = Extension('ginac._ginac',  ginac_ext = Extension('ginac._ginac',
                       sources=cppsrc+bpl_src,                        sources=ex_src+bpl_src,
                       include_dirs=[boost_dir],                        include_dirs=[boost_dir,wrapper_dir],
                       libraries=['ginac','cln'],                        libraries=['ginac','cln'],
                       library_dirs=[],  # Add here the paths to the location
                       define_macros=[('DEBUG_PYGINAC', None)],  # of ginac and cln libraries:
                      )                        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 121  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,  
   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'],         packages = ['ginac','ginac.doc'],
        package_dir = {'ginac': 'lib'},         package_dir = {'ginac': lib_dir,
                         'ginac.doc':os.path.join(lib_dir,'doc') },
        )         )
   
 print "PyGiNaC Version",version  print "PyGiNaC Version",version

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


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