|
From: Hart's A. <bha...@ya...> - 2005-01-16 01:16:21
|
I might have missed a step in the install process... please somebody double check me.
I changed my setup.py so that Trimesh is dissabled but i still get this error when trying to run
one of the examples:
bash-2.05b# python transforms.py
Traceback (most recent call last):
File "transforms.py", line 33, in ?
import ode
ImportError: /usr/lib/python2.3/site-packages/ode.so: undefined symbol: dGeomTriMeshGetTriangle
Below is my complete setup.py file:
######################################################################
# setup script for the Python wrapper of ODE
######################################################################
# ODE itself must already be compiled
from distutils.core import setup, Extension
import distutils.sysconfig
import shutil, os, os.path, sys, glob
from stat import *
# Should the wrapper support trimesh geoms?
TRIMESH_SUPPORT = False
# Windows?
if sys.platform=="win32":
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"]
# Linux (and other)
else:
ODE_BASE = "/usr/local/include/ode"
INC_DIRS = [os.path.join(ODE_BASE, "include")]
LIB_DIRS = [os.path.join(ODE_BASE, "lib")]
LIBS = ["ode", "stdc++"]
CC_ARGS = []
######################################################################
def determinePrecision():
filename = os.path.normpath(os.path.join(ODE_BASE, "config", "user-settings"))
print 'Reading "%s" to determine precision...'%filename
precision = None
try:
for s in file(filename):
s = s.strip()
a = s.split("=")
if len(a)==2 and a[0].upper()=="PRECISION":
precision = a[1]
except IOError, e:
print "ERROR:",e
raise RuntimeError
if precision==None:
print "ERROR: No precision setting found."
raise RuntimeError
if precision not in ["SINGLE", "DOUBLE"]:
print 'ERROR: Invalid precision setting: "%s"'%precision
raise RuntimeError
return precision
######################################################################
# Determine the precision setting (SINGLE or DOUBLE?)
#try:
# precisionfile = "_precision.pyx"
# precision = determinePrecision()
# print "Precision:",precision
# print 'Creating file "%s"...'%precisionfile
# f = file(precisionfile, "wt")
# f.write("# This file was automatically generated by the setup script\n\n")
# f.write('cdef extern from "ode/ode.h":\n')
# f.write(' # Define the basic floating point type used in ODE\n')
# f.write(' ctypedef %s dReal\n'%{"SINGLE":"float", "DOUBLE":"double"}[precision])
# f.close()
#except RuntimeError:
# print "Aborting!"
# sys.exit()
# 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()
# 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'
if TRIMESH_SUPPORT:
print >>f, 'include "trimeshdata.pyx"'
print >>f, 'include "trimesh.pyx"'
else:
print >>f, 'include "trimesh_dummy.pyx"'
f.close()
# Generate the C source file (if necessary)
cmd = "pyrexc -o ode.c -I. -Isrc src/ode.pyx"
pyrex_out = "ode.c"
# Check if the pyrex output is still up to date or if it has to be generated
# (ode.c will be updated if any of the *.pyx files in the directory "src"
# is newer than ode.c)
if os.access(pyrex_out, os.F_OK):
ctime = os.stat(pyrex_out)[ST_MTIME]
for pyx in glob.glob("src/*.pyx"):
pytime = os.stat(pyx)[ST_MTIME]
if pytime>ctime:
print "Updating",pyrex_out
print cmd
err = os.system(cmd)
break
else:
print pyrex_out,"is up to date"
err = 0
else:
print "Creating",pyrex_out
print cmd
err = os.system(cmd)
# Check if calling pyrex produced an error
if err!=0:
print "An error occured while generating the C source file."
sys.exit(err)
# Compile the module
setup(name = "PyODE",
version = "1.0.0",
description = "Python wrapper for the Open Dynamics Engine",
author = "see file AUTHORS",
author_email = "ti...@st...",
license = "BSD or LGPL",
url = "http://pyode.sourceforge.net/",
packages = ["xode"],
ext_modules = [Extension("ode", ["ode.c"]
,libraries=LIBS
,include_dirs=INC_DIRS
,library_dirs=LIB_DIRS
,extra_compile_args=CC_ARGS)
])
__________________________________
Do you Yahoo!?
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250
|