Dear Paraview Community,

This is mostly just a description of my experience successfully building
Paraview. However there is one outstanding issue involving RPATH (described
at the end) that I would greatly appreciate some advice on.

I use what is probably an increasingly popular platform for scientific
computing: Mac OS plus the excellent Enthought Canopy python environment.
Canopy greatly simplifies the installation of numpy / scipy and related
packages and is free for academic use. Canopy creates a standalone python
installation on Mac OS, completely replacing the system python.

The problem is that the paraview binary distribution for Mac OS links
against the standard system python, meaning that I cannot load scipy
modules from within the paraview python shell, or in pvpython. To fix this,
I decided to build a new paraview from source linking against the Canopy
python.

For the most part, the build was very straightforward following the wiki
instructions http://paraview.org/Wiki/ParaView:Build_And_Install
I installed cmake 2.8.8 from source and QT 4.8.5 from the dmg (
http://qt-project.org/downloads)
I did not install ffmpeg or mesa.
Then I downloaded the Paraview v4.0.1 source. FYI, my Canopy version is
1.1.0 64-bit.

I had to use several custom settings in ccmake. Of course,
PARAVIEW_ENABLE_PYTHON = On
I had to point ccmake at the canopy python enviroment. This took some
figuring out. With canopy, your python executable is
$HOME/Library/Enthought/Canopy_64bit/User/bin/python
Naturally I thought to use the following settings
PYTHON_EXECUTABLE=$HOME/Library/Enthought/Canopy_64bit/User/bin/python
PYTHON_INCLUDE_DIR=$HOME/Library/Enthought/Canopy_64bit/User/include
PYTHON_LIBRARY=$HOME/Library/Enthought/Canopy_64bit/User/Python
However, this caused ccmake to give an error, complaining about a missing
patchlevel.h file in the python include directory. I poked around and found
a different version of the includes inside the Canopy app. The settings
that ended up working were
PYTHON_INCLUDE_DIR=/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/include/python2.7/
PYTHON_LIBRARY=/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/libpython2.7.dylib
After this ccmake was able to finish successfully. Then I built and
installed (make && make install) with no errors.

The only issue I have now is that paraview binaries link to python using
RPATH. Compare the original paraview binary:
$ otool -L /Applications/paraview_original.app/Contents/bin/pvpython
...
/System/Library/Frameworks/Python.framework/Versions/2.7/Python
(compatibility version 2.7.0, current version 2.7.1)
...
with my new paraview binary
$ otool -L /Applications/paraview.app/Contents/bin/pvpython
...
@rpath/Python (compatibility version 2.7.0, current version 2.7.0)
...

The problem is that the linker cannot find the python libraries at runtime
using rpath.
$ Applications/paraview.app/Contents/MacOS/paraview
dyld: Library not loaded: @rpath/Python
  Referenced from: /Applications/paraview.app/Contents/MacOS/paraview
  Reason: image not found
Trace/BPT trap: 5

However, if I pass the library path using DYLD_LIBRARY_PATH, it works fine.
$ DYLD_LIBRARY_PATH=/Users/rpa/Library/Enthought/Canopy_64bit/User
/Applications/paraview.app/Contents/MacOS/paraview

The documentation on ccmake and RPATH is quite overwhelming for a novice
like me. I am content to use my DYLD_LIBRARY_PATH hack, but if anyone knows
how to overcome this issue, my build would be flawless.

In any case, I hope this message will be useful for anyone else interested
in using paraview with a canopy-based python.

Best,
Ryan Abernathey
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to