CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.org] How to install ParaView 5 with OpenFOAM-dev or -3.x.x (https://www.cfd-online.com/Forums/openfoam-installation/166144-how-install-paraview-5-openfoam-dev-3-x-x.html)

zordiack February 3, 2016 06:38

How to install ParaView 5 with OpenFOAM-dev or -3.x.x
 
1 Attachment(s)
Hi, I just finished installing ParaView 5 for OpenFOAM, so I thought I'd share the installation steps with you (OS is Xubuntu 14.04).

1. cd into $WM_THIRD_PARTY_DIR and get the sources from http://www.paraview.org/download/ (ParaView-v5.0.0-source.tar.gz)

2. Unpack and rename the directory to ParaView-5.0.0

3. Edit file ParaView-5.0.0/CMake/ParaViewDetermineVersion.cmake and comment out lines 41-50 (otherwise source version detection fails, this is also a bug in 4.4.0):

Code:

  if (NOT PARAVIEW_GIT_DESCRIBE)
#    if (EXISTS ${git_command})
#      execute_process(
#        COMMAND ${git_command} describe
#        WORKING_DIRECTORY ${source_dir}
#        RESULT_VARIABLE result
#        OUTPUT_VARIABLE output
#        ERROR_QUIET
#        OUTPUT_STRIP_TRAILING_WHITESPACE
#        ERROR_STRIP_TRAILING_WHITESPACE)
#    endif()
  else()

4. Edit file $WM_PROJECT_DIR/etc/config/paraView.sh line 58 to following:

Code:

export ParaView_VERSION=5.0.0
5. Source $WM_PROJECT_DIR/etc/basrc

6. Now let's compile ParaView 5. For this you can use the existing makeParaView4 script, because it has an option to select custom version. Your taste in ParaView options may be different, so adjust the following command accordingly (mpi and python are optional, run in $WM_THIRD_PARTY_DIR):

Code:

./makeParaView4 -version 5.0.0 -mpi -python -python-lib /usr/lib/x86_64-linux-gnu/libpython2.7.so
7. After compiling, export the new environmental settings and remember to use your home directory, ParaView compilation should output the correct lines for you once it's finished (you should also add/update these to your $HOME/.bashrc):

Code:

export ParaView_DIR=/home/YOURUSERNAME/OpenFOAM/ThirdParty-dev/platforms/linux64Gcc/ParaView-5.0.0
export PATH=$ParaView_DIR/bin:$PATH
export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-5.0

8. Copy the attached pv5readers.tar.gz into $FOAM_UTILITIES/postProcessing/graphics/, cd into that directory and unpack the archive.

9. Compile the PV5Readers (it will output some warnings, but it compiles at least with gcc-4.8.4):

Code:

cd PV5Readers
wmSET
./Allwclean
./Allwmake

That's it, you should now have ParaView 5 compiled with OpenFOAM readers :)

zordiack February 8, 2016 06:00

There is now an official commit for -dev by Henry to compile the OpenFOAM readers. This means that steps 8-9 above are not needed anymore and I think one should prefer the official method. Here is the commit:

https://github.com/OpenFOAM/OpenFOAM...800233078d8263

It doesn't duplicate code, it just updates the PV4Readers to compile with ParaView 5 source.

davibarreira February 10, 2016 19:26

I'm trying to follow your tips for setting Paraview 5 to OpenFOAM v3+.

I'm getting an error in the final step (./allwmake for Paraview), that the libPV5FoamReader_SM.so is not compiling. Here is the full error:

Code:

Linking CXX shared library /home/davi/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Opt/lib/paraview-5.0/libPV5FoamReader_SM.so
/usr/bin/ld: cannot find -lvtkPV5Foam
collect2: error: ld returned 1 exit status
CMakeFiles/PV5FoamReader_SM.dir/build.make:457: recipe for target '/home/davi/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Opt/lib/paraview-5.0/libPV5FoamReader_SM.so' failed
make[2]: *** [/home/davi/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Opt/lib/paraview-5.0/libPV5FoamReader_SM.so] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/PV5FoamReader_SM.dir/all' failed
make[1]: *** [CMakeFiles/PV5FoamReader_SM.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2

Any ideas?

Actually manage to fix it by copying the lvtkPV4Foam.so to the /home/davi/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Opt/lib/ and renaming it as lvtkPV5Foam.so. It compiled and the paraFOAM command now works (kinda), but paraview says that "it cannot find the reader" for the case.OpenFOAM file.

I got it to work using the command paraFoam -builtin ... not the ideal, but it's working.

zordiack June 21, 2016 06:33

Just an update to this thread in case someone stumbles here. Compiling ParaView 5 series has been really easy for a while. First make sure you have the latest ThirdParty-dev by running "git pull" in ThirdParty dir, it should pull ParaView-5.0.1 source tree. Then just run

Code:

./makeParaView -version 5.0.1 -mpi -python -python-lib /usr/lib/x86_64-linux-gnu/libpython2.7.so VTK_RENDERING_BACKEND=OpenGL2
Please note that mpi and python and the new rendering backend are totally optional :)

gu1 September 13, 2018 16:47

Hello,

I have a doubt, I have installed on my computer the OF5.0 (Ubuntu 16.04) and recently compiled the OF3.0.x (however, without the paraview). When I want to access the paraview of simulations performed in the older version of OpenFOAM, I use the version of OF5.0 for this (paraFoam). Is it possible to enable paraFoam of OF3.0.x to access the paraview already installed by the latest version (5.0)?

Quote:

cae@cae:~/OpenFOAM/case$ of3x
cae@cae:~/OpenFOAM/case$ paraFoam

FATAL ERROR: ParaView reader module libraries do not exist

Please build the reader module before continuing:
cd $FOAM_UTILITIES/postProcessing/graphics/PV4Readers
./Allwclean
./Allwmake


All times are GMT -4. The time now is 00:19.