Building PythonNURBS-0.3 on Ubuntu 12.04

This package which provides Python bindings for the nurbs++ library is quite straightforward to build. I obtained the tarball from the project homepage but when I built it I got lots of errors about not being able to find the correct .h files.

I ended up changing the path in the setup.p file from /usr/include to /usr/local/include which is where the default installation of Nurbs++ ended up from yesterday’s post. A simple python setup.py install then did the trick. This seemed to get the thing to build and the examples now run, so it may actually work.

I include the patch if anyone wants it:
--- setup.py.old 2012-08-02 22:05:59.000000000 +0100
+++ setup.py 2012-08-02 22:06:24.000000000 +0100
@@ -43,18 +43,18 @@
ext_package='pythonnurbs',
package_dir={'pythonnurbs':'src'},
package_data={'pythonnurbs':['src/__init__.py']},
- ext_modules = [ Extension("_NurbsColor", ["src/color.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/include"]),
- Extension("_NurbsCurve", ["src/curve.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/include"]),
- Extension("_NurbsMatrix", ["src/matrix.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/include"]),
- Extension("_NurbsBasicArray", ["src/barray.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/include"]),
- Extension("_NurbsArray2D", ["src/barray2d.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/include"]),
- Extension("_NurbsCoordinate", ["src/coordinate.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/include"]),
- Extension("_NurbsHPoint", ["src/hpoint_nd.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/include"]),
- Extension("_NurbsPoint", ["src/point_nd.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/include"]),
- Extension("_NurbsBasicList", ["src/list.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/include"]),
- Extension("_NurbsSurface", ["src/surface.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/include"]),
- Extension("_NurbsVector", ["src/vector.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/include"]),
- Extension("_NurbsMatrixRT", ["src/matrixRT.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/include"])],
+ ext_modules = [ Extension("_NurbsColor", ["src/color.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/local/include"]),
+ Extension("_NurbsCurve", ["src/curve.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/local/include"]),
+ Extension("_NurbsMatrix", ["src/matrix.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/local/include"]),
+ Extension("_NurbsBasicArray", ["src/barray.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/local/include"]),
+ Extension("_NurbsArray2D", ["src/barray2d.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/local/include"]),
+ Extension("_NurbsCoordinate", ["src/coordinate.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/local/include"]),
+ Extension("_NurbsHPoint", ["src/hpoint_nd.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/local/include"]),
+ Extension("_NurbsPoint", ["src/point_nd.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/local/include"]),
+ Extension("_NurbsBasicList", ["src/list.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/local/include"]),
+ Extension("_NurbsSurface", ["src/surface.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/local/include"]),
+ Extension("_NurbsVector", ["src/vector.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/local/include"]),
+ Extension("_NurbsMatrixRT", ["src/matrixRT.i"], libraries=["nurbsd", "matrixN", "matrixI", "matrix"], swig_opts=["-c++", "-I/usr/local/include"])],
data_files = [('share/doc/pythonnurbs-'+Version+'/examples', ['examples/curve01.py', 'examples/interpolation01.py',
'examples/interpolation02.py', 'examples/surface01.py', 'examples/surface02.py', 'examples/test.py',
'examples/vector_double.py']),

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s