Compiling the Numbers example under Linux

From DANSE

If you're using the Caltech build system (config), type mm, sit back, relax. Hey you've had a rough day.

Otherwise, here's a way to compile the Numbers example under Linux. You'll need files with the Numbers source code (PUT LINK HERE). To compile, compile each source file:

g++ -I. -fpic -c Numbers.cpp
g++ -I/usr/include/python2.2 -I. -fpic -c PyNumbers.cpp

and link them into a shared library:

g++ Numbers.o PyNumbers.o -fpic -shared -o _PyNumbers.so

In the compile lines, you'll of course need to make sure that you've pointed to the directory where your Python.h file lives. The "-fpic" specifies position independent code, "-shared" a shared library that can be dynamically linked.

Once you've compiled PyNumbers.so, move it into a place on your system's PYTHON_PATH and enjoy.

Personal tools
Document Uploads/Links