Personal tools
You are here: Home Pivy Wiki Build Instructions
Views

If all Pivy's dependencies are met

As with all good Python modules, just do the usual after unpacking the source files, in a terminal:

Step 1:

python setup.py build

If all went well (no errors), then proceed to the second step:

Step 2:

python setup.py install

If you want to install somewhere else, e.g. in /usr/local, then do:

python setup.py install --prefix=/usr/local

For Ubuntu/Kubuntu/Xubuntu users, step 2 would be:

sudo python setup.py install

Again, if you want to install somewhere else:

sudo python setup.py install --prefix=/usr/local

The above assumes you have met all Pivy's dependencies. Some nice examples can be found in <your Pivy source directory>/examples/Mentor/

Installing the dependencies (in this case SoQt and Coin) on *ubuntu (Feisty Fawn)

(NOTE: The following works on Edgy too -- I tried installing the prerequisites using Synaptic but got errors with Pivy trying to find SoQt?. Ignore Synaptic and follow these instructions!) (NOTE: for GUTSY see the bugfix at bottom of this page)

Some of this might be a bit obvious for experienced users... We're going to build the latest Coin (2.4.6) and SoQt (1.4.1) from source with some help from 'apt-get'. Why? Well, the ones in the apt repositories are a bit behind in terms of their versions. Feisty comes with Python 2.5 and if you get SWIG via apt-get, it'll get version 1.3.31 (at the time of writing this).

Start by downloading Pivy, get the latest svn version by following the steps below.

Step 1:

Open a new terminal (or console). Check whether you have Subversion installed, type:

svn --version

If you don't have it, err, get it. On *ubuntu, type:

sudo apt-get install subversion

OK. Now create a directory named Pivy (or whatever else you want to name it):

mkdir Pivy

Just above this directory (don't cd...) type:

svn co https://svn.coin3d.org/repos/Pivy/trunk Pivy

If you named your directory something else, then replace 'Pivy' above with the name you chose for the directory you just created. Once Subversion has done its thing, you'll see something like this:

$ svn co https://svn.coin3d.org/repos/Pivy/trunk Pivy
    A    Pivy/SoPyScript
    A    Pivy/SoPyScript/SoPyScript.cpp
    A    Pivy/SoPyScript/SoPyScript.h
    A    Pivy/SoPyScript/SConstruct
    A    Pivy/SoPyScript/swigpyrun.h
    A    Pivy/LICENSE
    A    Pivy/interfaces
    ...
    Checked out revision 624.

Your revision may be different.

You can also check your revision by cd ing into the Pivy directory and typing:

svn info

In which case you'll see (more or less):

william@olien:~/Downloads/Pivy$ svn info
Path: .
URL: https://svn.coin3d.org/repos/Pivy/trunk
Repository Root: https://svn.coin3d.org/repos/Pivy
Repository UUID: c796dcfc-2adf-0310-8df0-e95b6e8825db
Revision: 624
Node Kind: directory
Schedule: normal
Last Changed Author: autosvn
Last Changed Rev: 624
Last Changed Date: 2007-05-11 01:39:56 +0200 (Fri, 11 May 2007)

Later, if you want to update your Pivy source files, in your Pivy directory, just type:

svn up

Step 2:

Now download Coin and SoQt to some directory of your choice, and unpack the two files from http://www.coin3d.org/lib/coin/releases/2.4.6 and http://www.coin3d.org/lib/soqt

tar xvfz Coin-2.4.6.tar.gz

tar xvfz SoQt?-1.4.1.tar.gz

Make sure you meet all Coin's dependencies (mostly OpenGL and X stuff), this is very easy to accomplish using apt-get:

sudo apt-get build-dep libcoin40c2
(If you get an error about adding files to source repositories:
Run synaptic (System->Administration->Synaptic) Go to Settings->Repositories Tick Source Code

In Synaptic, click RELOAD)

Enter the Coin-2.4.6 directory, and type:

mkdir coin-build
cd coin-build
../configure

If everything went OK, you'll see something like this once configure has finished:

Coin configuration settings:
  Library version:              2.4.6
  New in-development features:  No (default)
  Generate Java wrapper:        No (default)
  3ds import capabilities:      No (enable with --enable-3ds-import)
  javascript capabilities:      No (enable with --enable-javascript-api)
  VRML97 support:               Yes
  System threads API:           POSIX
  Thread safe traversals:       No (enable with --enable-threadsafe)
  simage linkage:               run-time binding
  OpenAL support:               Yes, run-time binding
  Sound support:                Yes
  Fontconfig support:           Yes, run-time binding
  FreeType library:             Yes, run-time binding
  zlib support:                 Yes, run-time binding
  bzip2 support:                Yes, run-time binding
  GLU linkage:                  run-time binding
  Installation prefix:          /usr/local

Then do the following:

make
sudo make install

When finished, do a simple check to see what version you have:

coin-config --version

Which should return:

2.4.6

Step 3:

Now for SoQt it follows the same recipe as just used for Coin above, but the ingredients are a bit different ;-):

sudo apt-get build-dep libsoqt20

Enter the SoQt-1.4.1 directory, and type:

mkdir soqt-build
cd soqt-build

You have to tell configure where the Qt headers are:

../configure CPPFLAGS=-I/usr/include/qt3

And finally:

make
sudo make install

Let's do a simple check to see what version we have:

soqt-config --version

Which should return:

1.4.1

Step 4:

First, if not on Gutsy, add the following directory to /etc/ld.so.conf

/usr/local/lib 

Then do:

sudo /sbin/ldconfig

Also everyone including Gutsy users need now to install python2.5-dev and swig through synaptic:

sudo apt-get install swig python2.5-dev

Go to your Pivy directory and do the usual:

python setup.py build
sudo python setup.py install

Or alternatively:

sudo python setup.py install --prefix=/usr/local

(If you get a build error from gcc, see the Gutsy fix at the end of this page.)

Step 5:

Start fiddling with the examples in the examples/Mentor directory and have fun!

Installing on Kubuntu 7.10 (Gutsy Gibbon)

Swig is still at 1.3.31 (Oct 2007). I just did Step 2 and Step 4 (did however delete my build directory before doing python setup.py build) above and ran pivy_tests.py and no complaints. Here's the output:

Ran 93 tests in 0.017s

OK

BUG and FIX for installing on Ubuntu Gutsy 7.10

BUG:

Just upgraded to Ubuntu Gutsy

Ensured that Coin and SoQt? were not installed by syanptic (ie removed packages)

Followed the download and install instructions from the Ubuntu section of the Pivy wiki (ie tar xvf Coin-2.4.6.tar.gz tar xvf SoQt?-1.4.1.tar.gz)

The following error occurs at step python setup.py build:

> pivy/gui/soqt_wrap.cpp: In function 'void initialize_pyqt_module_import_name()':
> pivy/gui/soqt_wrap.cpp:3267: error: 'getVersionToolkitString' is not a
> member of 'SoQt'
> pivy/gui/soqt_wrap.cpp:3268: error: 'getVersionToolkitString' is not a
> member of 'SoQt'
> error: command 'gcc' failed with exit status 1

SOLUTION: In file Pivy/pivy/gui/soqt_wrap.cpp, comment out the four lines as shown below, then rerun setup:

static void
initialize_pyqt_module_import_name()
{
  /* determine the Qt version SoQt has been compiled with for correct
   * PyQt module import */
  if (!PYQT_MODULE_IMPORT_NAME) {
    PYQT_MODULE_IMPORT_NAME = "qt";
      
    //if (strlen(SoQt::getVersionToolkitString()) >= 1 &&
    //       SoQt::getVersionToolkitString()[0] == '4') {
    //  PYQT_MODULE_IMPORT_NAME = "PyQt4.Qt";
    //}
  }
}

COMMENT: Looks like that getVersionToolkitString function has been removed from the Coin API -- funny though as I installed from the same Coin and SoQt? versions as on Edgy. Maybe the Gutsy upgrade is clobbering some other dependency somewhere??