Diff for /python/pyGiNaC/setup3.py between versions 1.2 and 1.3

version 1.2, 2001/04/21 15:46:35 version 1.3, 2001/04/24 09:01:58
Line 4 Line 4
 #  #
 # Requirements:  # Requirements:
 #   Python 2.0 or higher (http://www.python.org/)  #   Python 2.0 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/)
Line 29 Line 29
 #  #
 # Pearu Peterson <pearu@cens.ioc.ee>  # Pearu Peterson <pearu@cens.ioc.ee>
 # 30 March 2001  # 30 March 2001
   # 23 April 2001
   
 __credits__ = """\  __credits__ = """\
 GiNaC people (www.ginac.de), for the GiNaC library.  GiNaC people (www.ginac.de), for the GiNaC library.
Line 87  wrap_input = ['symbol','numeric','consta Line 88  wrap_input = ['symbol','numeric','consta
 #wrap_input = ['symbol','tensor']  #wrap_input = ['symbol','tensor']
 #wrap_input = ['symbol','add','mul','lst','numeric','power']  #wrap_input = ['symbol','add','mul','lst','numeric','power']
   
 wrap_input = ['ex','symbol','numeric','lst','add','mul','power']  wrap_input = ['ex','symbol','numeric','lst','add','mul','power',
                 'inifcns','function','relational','seq']
   
 #++++++++++++++++ Parameters ++++++++++++++++  #++++++++++++++++ Parameters ++++++++++++++++
 nof_lst_params = 10   # max 15 for ginac, max 10 for boost.python, min 1  #nof_lst_params = 10   # max 15 for ginac, max 10 for boost.python, min 1
 nof_ncmul_params = 6  # max 6  #nof_ncmul_params = 6  # max 6
 nof_function_params = 9 # max 13 for ginac, max 9 for boost.python, min 1  nof_function_params = 12 # max 12 for ginac (depends also on the code in function_py.cpp)
 #++++++++++++++++++++ boost +++++++++++++++++++++  #++++++++++++++++++++ boost +++++++++++++++++++++
   
 boost_dir = '/usr/local/share/boost'  boost_dir = '/usr/local/share/boost'
Line 144  ginac_cpp = os.path.join('src','_ginac.c Line 146  ginac_cpp = os.path.join('src','_ginac.c
   
   
 ex_src = [  ex_src = [
       os.path.join(wrapper_dir,'ginac_enhancements.cpp'),
     os.path.join(wrapper_dir,'ex_py.cpp'),      os.path.join(wrapper_dir,'ex_py.cpp'),
     os.path.join(wrapper_dir,'python_repr.cpp'),      os.path.join(wrapper_dir,'python_repr.cpp'),
     os.path.join(wrapper_dir,'python_str.cpp'),      os.path.join(wrapper_dir,'python_str.cpp'),
       os.path.join(wrapper_dir,'pyfunc.cpp'),
     ]      ]
   
 if gentest:  if gentest:
     #names = ['ex','symbol','numeric','lst','add','mul','power']  
     import re      import re
     dt_match = re.compile(r'\s*/[*]DT(?P<text>.*?)[*]/',re.M|re.S)      dt_match = re.compile(r'\s*/[*]DT(?P<text>.*?)[*]/',re.M|re.S)
     mdt_match = re.compile(r'\s*/[*]M_DT(?P<text>.*?)[*]/',re.M|re.S)      mdt_match = re.compile(r'\s*/[*]M_DT(?P<text>.*?)[*]/',re.M|re.S)
Line 207  if __name__ == "__main__": Line 210  if __name__ == "__main__":
 if len(sys.argv)==1:  if len(sys.argv)==1:
     print "PyGiNaC Version",version      print "PyGiNaC Version",version
     sys.exit()      sys.exit()
   
 if rebuild:  if rebuild:
     print 'Creating file',os.path.join(wrapper_dir,'ex_py_subs.cpp')      print 'Creating file',os.path.join(wrapper_dir,'ex_py_subs.cpp')
     f=open(os.path.join(wrapper_dir,'ex_py_subs.cpp'),'w')      f=open(os.path.join(wrapper_dir,'ex_py_subs.cpp'),'w')
Line 221  if rebuild: Line 225  if rebuild:
     f.write('#undef PYGINAC_DEFS\n#undef PYGINAC_EX_PROTOS\n#undef PYGINAC_PROTOS\n')      f.write('#undef PYGINAC_DEFS\n#undef PYGINAC_EX_PROTOS\n#undef PYGINAC_PROTOS\n')
     f.close()      f.close()
     os.system('touch wrappers3/ex_py.cpp')      os.system('touch wrappers3/ex_py.cpp')
       print 'Creating file',os.path.join(wrapper_dir,'function_py_subs.cpp')
 if 0 and rebuild or not os.path.exists(ginac_cpp):      f=open(os.path.join(wrapper_dir,'function_py_subs.cpp'),'w')
       protos,impl = [],[]
     build_ginac_cpp(wrap_input,ginac_cpp,wrapper_dir,onlydoc=0,onlytest=0,      for k in ['eval','evalf']:
                     vers=version,credits=__credits__)          for i in range(nof_function_params+1):
               a1 = ['const GiNaC::ex & a'+`j` for j in range(i)]+['const GiNaC::ex & ser']
               a2 = ['args.set_item(%s,a%s);'%(j,j) for j in range(i)]
               impl.append('PYGINAC_CB_FUNC(%s,%s,(%s),%s,%s)\n'%(k,i,', '.join(a1),i,' '.join(a2)))
               protos.append('PYGINAC_CB_FUNC_PROTO(%s,%s,(%s));\n'%(k,i,', '.join(a1)))
       if 1:
           k = 'derivative'
           for i in range(nof_function_params+1):
               a1 = ['const GiNaC::ex & a'+`j` for j in range(i)]
               a1 += ['const GiNaC::ex & ser','unsigned n']
               a2 = ['args.set_item(%s,a%s);'%(j,j) for j in range(i)]
               a2 += ['args.set_item(%s,n);'%i]
               impl.append('PYGINAC_CB_FUNC(%s,%s,(%s),%s,%s)\n'%(k,i,', '.join(a1),i+1,' '.join(a2)))
               protos.append('PYGINAC_CB_FUNC_PROTO(%s,%s,(%s));\n'%(k,i,', '.join(a1)))
       if 1:
           k = 'series'
           for i in range(nof_function_params+1):
               a1 = ['const GiNaC::ex & a'+`j` for j in range(i)]
               a1 += ['const GiNaC::ex & ser']
               a1 += ['const GiNaC::relational & rel']
               a1 += ['int order']
               a1 += ['unsigned opt']
               a2 = ['args.set_item(%s,a%s);'%(j,j) for j in range(i)]
               a2+= ['args.set_item(%s,rel);'%i]
               a2+= ['args.set_item(%s,order);'%(i+1)]
               a2+= ['args.set_item(%s,opt);'%(i+2)]
               impl.append('PYGINAC_CB_FUNC(%s,%s,(%s),%s,%s)\n'%(k,i,', '.join(a1),i+3,' '.join(a2)))
               protos.append('PYGINAC_CB_FUNC_PROTO(%s,%s,(%s));\n'%(k,i,', '.join(a1)))
       f.write('#ifdef PYGINAC_PROTOS\n')
       f.write('\n'.join(protos))
       f.write('#else\n')
       f.write('\n'.join(impl))
       f.write('#endif\n')
       f.close() 
              
 ginac_ext = Extension('ginac._ginac3',  ginac_ext = Extension('ginac._ginac3',
                       sources=ex_src+bpl_src,                        sources=ex_src+bpl_src,
                       include_dirs=[boost_dir,wrapper_dir],                        include_dirs=[boost_dir,wrapper_dir],
Line 247  setup (name = "PyGiNaC", Line 284  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 implements a complete
 to GiNaC library. Currently the following GiNaC classes are exposed:  and transparent 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 ],

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


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