From: Timothy S. <pe...@us...> - 2005-12-16 17:07:01
|
Update of /cvsroot/pyode/pyode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13593 Modified Files: ChangeLog INSTALL setup.py Log Message: Updated setup script and updated tutorial3.py with Pierre Gay's changes. Index: setup.py =================================================================== RCS file: /cvsroot/pyode/pyode/setup.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** setup.py 8 Jul 2005 08:56:37 -0000 1.9 --- setup.py 16 Dec 2005 17:06:48 -0000 1.10 *************** *** 8,11 **** --- 8,14 ---- #ODE_BASE = '../ode' + # Set to the location of your ODE user-settings file. + #USER_SETTINGS = '../ode/config/user-settings' + # Set to True or False to force trimesh support to be enabled or disabled. #TRIMESH_SUPPORT_OVERRIDE = True *************** *** 18,32 **** from stat import * # Windows? if sys.platform=="win32": try: ! base = ODE_BASE except NameError: ! ODE_BASE = "../ode_single_trimesh" ! #ODE_BASE = "../ode_double_notrimesh" ! ! INC_DIRS = [os.path.join(ODE_BASE, "include")] ! LIB_DIRS = [os.path.join(ODE_BASE, "lib")] LIBS = ["ode", "user32"] # user32 because of the MessageBox() call CC_ARGS = ["/ML"] --- 21,37 ---- from stat import * + + base = [] + # Windows? if sys.platform=="win32": try: ! base = [ODE_BASE] except NameError: ! base = [] ! base.append("../ode_single_trimesh") ! base.append("../ode_double_notrimesh") ! LIBS = ["ode", "user32"] # user32 because of the MessageBox() call CC_ARGS = ["/ML"] *************** *** 36,55 **** try: ! base = ODE_BASE except NameError: ! ODE_BASE = "../ode" - INC_DIRS = [os.path.join(ODE_BASE, "include")] - LIB_DIRS = [os.path.join(ODE_BASE, "lib")] LIBS = ["ode", "stdc++"] CC_ARGS = [] ###################################################################### def readODEConfig(): config = {} ! ! filename = os.path.normpath(os.path.join(ODE_BASE, "config", "user-settings")) ! print 'Reading ODE configuration "%s"...' % filename try: --- 41,122 ---- try: ! base = [ODE_BASE] except NameError: ! base = [] ! base.append("/usr") ! base.append("/usr/local") ! base.append("../ode") LIBS = ["ode", "stdc++"] CC_ARGS = [] + + # Look for an ODE user-settings file. + def findODEConfig(prefix): + try: + suffix = [USER_SETTINGS] + prefix = '' + except NameError: + suffix = [os.path.join('config', 'user-settings'), + os.path.join('include', 'ode', 'config', 'user-settings'), + os.path.join('share', 'ode-0.5', 'config', 'user-settings')] + + for s in suffix: + path = os.path.normpath(os.path.join(prefix, s)) + if (os.path.exists(path)): + return path + + return None + + # Find an ODE installation. + ODE_BASE = None + for path in base: + if (not os.path.exists(path)): + continue + + c = findODEConfig(path) + if (c is None): + continue + + if (not os.path.exists(os.path.join(path, 'include'))): + continue + + if (not os.path.exists(os.path.join(path, 'lib'))): + continue + + ODE_BASE = path + break + + + if (ODE_BASE is None): + print + print "Error: ODE installation not found." + print + print "The following installation bases were checked:" + for path in base: + print " -", path + print + print 'This Python ODE wrapper assumes that you have a compiled version of' + print 'the ODE library already somewhere on your system. The path to the' + print 'ODE installation has to be set in the setup script via the variable' + print 'ODE_BASE and the path to the user-settings file has to be set via' + print 'the variable USER_SETTINGS. Please change these variables so that' + print 'they point to the actual location of your ODE installation.' + sys.exit(1) + + + print 'Using "%s" as base of ODE installation.' % ODE_BASE + + + INC_DIRS = [os.path.join(ODE_BASE, "include")] + LIB_DIRS = [os.path.join(ODE_BASE, "lib")] + ###################################################################### def readODEConfig(): config = {} ! ! filename = findODEConfig(ODE_BASE) ! print 'Reading ODE user-settings from "%s".' % filename try: *************** *** 58,62 **** print "ERROR:", e raise RuntimeError ! for line in f.readlines(): s = line.strip() --- 125,129 ---- print "ERROR:", e raise RuntimeError ! for line in f.readlines(): s = line.strip() *************** *** 103,107 **** def generate(name, trimesh_support): # Generate the trimesh_switch file ! f = file("_trimesh_switch.pyx", "wt") print >>f, '# This file was generated by the setup script and is included in ode.pyx.\n' --- 170,174 ---- def generate(name, trimesh_support): # Generate the trimesh_switch file ! f = file("_trimesh_switch.pyx", "wt") print >>f, '# This file was generated by the setup script and is included in ode.pyx.\n' *************** *** 112,116 **** print >>f, 'include "trimesh_dummy.pyx"' f.close() ! cmd = "pyrexc -o %s -I. -Isrc src/ode.pyx" % name pyrex_out = name --- 179,183 ---- print >>f, 'include "trimesh_dummy.pyx"' f.close() ! cmd = "pyrexc -o %s -I. -Isrc src/ode.pyx" % name pyrex_out = name *************** *** 141,153 **** sys.exit(err) - # Check if the ODE_BASE path does exist - if not os.path.exists(ODE_BASE): - print """This Python ODE wrapper assumes that you have a compiled version of - the ODE library already somewhere on your system. The path to the ODE - distribution has to be set in the setup script via the variable - ODE_BASE. Currently it points to "%s". - However, that path does not exist. So please change the variable inside the - script so that it points to the actual location of the ODE directory."""%ODE_BASE - sys.exit() config = readODEConfig() --- 208,211 ---- *************** *** 181,184 **** ,include_dirs=INC_DIRS ,library_dirs=LIB_DIRS ! ,extra_compile_args=CC_ARGS) ]) --- 239,242 ---- ,include_dirs=INC_DIRS ,library_dirs=LIB_DIRS ! ,extra_compile_args=CC_ARGS) ]) Index: INSTALL =================================================================== RCS file: /cvsroot/pyode/pyode/INSTALL,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** INSTALL 30 Nov 2004 08:00:21 -0000 1.4 --- INSTALL 16 Dec 2005 17:06:48 -0000 1.5 *************** *** 2,9 **** ========================================= ! Requirements: ------------- ! - Python v2.2 (or higher) http://www.python.org/ --- 2,9 ---- ========================================= ! Requirements: ------------- ! - Python v2.2 (or higher) http://www.python.org/ *************** *** 11,15 **** http://ode.org/ ! - Pyrex 0.9.3 (or higher) http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/ This is only required for PyODE development; you don't need it to install --- 11,15 ---- http://ode.org/ ! - Pyrex 0.9.3 (or higher) http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/ This is only required for PyODE development; you don't need it to install *************** *** 27,32 **** python setup.py install ! which installs the package on your system. ! See the "Installing Python Modules" manual inside your Python documentation or at http://docs.python.org/inst/inst.html if you want to customize the build process or the target location. --- 27,32 ---- python setup.py install ! which installs the package on your system. ! See the "Installing Python Modules" manual inside your Python documentation or at http://docs.python.org/inst/inst.html if you want to customize the build process or the target location. *************** *** 34,41 **** Note: It is assumed that the ODE library is already compiled and installed ! somewhere on your system. In the setup script there's a variable ODE_BASE ! that points to the base ODE directory. It might be possible that you have ! to modify this variable so that it points to the actual location on your ! system. ODE can either be compiled with or without trimesh support. The setup script --- 34,42 ---- Note: It is assumed that the ODE library is already compiled and installed ! somewhere on your system. The setup script will try to find the ODE ! installation on your system by trying several common locations. However, if the ! installation can not be found, you will have to modify the variables ODE_BASE ! and/or USER_SETTINGS at the top of the setup.py script to point to the ! installation. ODE can either be compiled with or without trimesh support. The setup script Index: ChangeLog =================================================================== RCS file: /cvsroot/pyode/pyode/ChangeLog,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ChangeLog 20 Sep 2005 15:34:17 -0000 1.7 --- ChangeLog 16 Dec 2005 17:06:48 -0000 1.8 *************** *** 1,2 **** --- 1,10 ---- + 2005-12-16 Timothy Stranex <tim...@gm...> + * setup.py: Modified setup to look for ODE installations in common + locations. + * examples/tutorial3.py: Updated with Pierre Gay's changes so that it + does not depend on cgkit or pygame. + * tests/test_xode.py: Fixed some instances of testing floats for + equality. + 2005-09-20 Matthias Baas <ba...@ir...> |