CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   How to get Python Shell into ParaView 3.8.1? (https://www.cfd-online.com/Forums/openfoam-installation/91769-how-get-python-shell-into-paraview-3-8-1-a.html)

blaise August 22, 2011 10:06

How to get Python Shell into ParaView 3.8.1?
 
Hi all,

I managed to install all ThirdParty thingies coming with OF 1.6-ext using the new rpm based installation scripts. ParaView 3.8.1 runs, but I have no Python Shell built into it, and very likely no MPI for parallel processing too. I need both. I tried to find a solution and read a lot of related pages, but did not find a suitable answer.

So I changed these two lines in the rpmBuild/SPECS/ParaView-3.8.1.spec file for ParaView to:

%{!?_withMPI: %define _withMPI true}
%{!?_withPython: %define _withPython true}

and started the compilation again (both were defined "false" before), but this did not change anything. Then I inserted the compilation options for python and mpi directly into the AllMake.stage4 script:

------- snippet ------------
rpm_make -p ParaView-3.8.1 -s ParaView-3.8.1.spec -u ...paraview.org/.../ParaView-3.8.1.tar.gz -a --define='_qmakePath $QT_BIN_DIR/qmake _withPython=true _withMPI=true'
--------------------------------

Now these options show up in the output of AllMake.stage4 (maybe this was a little bit over the top, but now the options turn up both in the "Additional flags" line and in the optional args):

------------ snippet ------------
Additional flags : --define=_qmakePath $QT_BIN_DIR/qmake _withPython=true _withMPI=true
Updating the ThirdParty environment variables before building package ParaView-3.8.1
Making package ParaView-3.8.1 using RPM.
Building package ParaView-3.8.1 using SPEC file : ParaView-3.8.1.spec. Optional args: --define=_qmakePath $QT_BIN_DIR/qmake _withPython=true _withMPI=true
------------------------------

The compilation runs fine, ParaView can be started, but still no Python Shell integrated!

How can I get the Python Shell into ParaView 3.8.1??????

By the way: Will Paraview-3.10.0 work too?

I am doing this on a CentOS 5.3 system, freshly compiled gcc-4.4.5, and I have installed all the packages from Allwmake.stage3 (but zoltan).

Any hint is warmly welcomed!

Cheers,

Pascal.

----------

Edit:

Just found out that I had to insert
PARAVIEW_ENABLE_PYTHON=true
into Allwmake.stage4 (rpm_make call). To be on the safe side I inserted

addCMakeVariable PARAVIEW_ENABLE_PYTHON:BOOL=ON

into the spec file. Now the Python Shell is there and seems to work. I will find out which setting does the trick. Tomorrow I will try to do the same for MPI support, if necessary. Anyway, the spec file doesn't seem to work as it should, if this kind of hacking is required. Did anybody else experience these problems?

Cheers,

Pascal.

blaise August 23, 2011 05:23

Solved
 
Hi all, myself ;-)

ok, I found out that I have to insert these two lines in the ParaView rpm spec file (ThirdParty-1.6-ext/rpmBuild/SPECS/ParaView-3.8.1.spec, just where the other cmake variables are added):

addCMakeVariable PARAVIEW_ENABLE_PYTHON:BOOL=ON
addCMakeVariable PARAVIEW_USE_MPI:BOOL=ON

With this, the Python Shell and MPI support gets built in when compiling. Just using the "true" flag in the cmake compiling options doesn't seem to help.

Cheers,

Pascal.

flowris July 24, 2012 03:29

Hi Blaise,

Does this also work for Paraview-3.12? I added the cmake variables, deleted the folder ThirdParty/packages/ParaView-3.12.0/ and ran ./Allmake again from within ThirdParty, but the Tools > Python Shell is still not available.

Any tips?

gschaider July 24, 2012 04:58

Quote:

Originally Posted by flowris (Post 373152)
Hi Blaise,

Does this also work for Paraview-3.12? I added the cmake variables, deleted the folder ThirdParty/packages/ParaView-3.12.0/ and ran ./Allmake again from within ThirdParty, but the Tools > Python Shell is still not available.

Any tips?

Haven't used it in a long time, but I think the Allwmake regenerates the CMake-files. There is a specialized Script for generating CMake and compiling paraview (look for it. The name is a strong hint) and that has an option that adds Python


All times are GMT -4. The time now is 09:08.