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.com] paraFoam cannot open due to Qt issues - [Solved/Information] (https://www.cfd-online.com/Forums/openfoam-installation/203515-parafoam-cannot-open-due-qt-issues-solved-information.html)

u2berggeist June 29, 2018 11:58

paraFoam cannot open due to Qt issues - [Solved/Information]
 
I was originally writing this up as I tried to solve the issue stated below. I'll go ahead and post it as information for any passersby. I've read through and tried to change some present tense to past, but probably missed some stuff.

Huge shoutout to wyldckat and h0y5840, who's thread made this job much easier.

Issue:
I've (tried at least) to compile OpenFOAM v1712 and am running into an issue with ParaView.

Code:

u2berggeist@Exia00:~/OpenFOAM/u2berggeist-v1712/run/tutorials/incompressible/icoFoam/cavity/cavity$ paraFoam
Created temporary 'cavity.OpenFOAM'
/home/u2berggeist/OpenFOAM/ThirdParty-v1712/platforms/linux64Gcc/ParaView-5.4.1/lib/paraview-5.4/paraview: error while loading shared libraries: libQt5Help.so.5: cannot open shared object file: No such file or directory

Author's Note: if you just want to get my solution that worked, jump down to The End Solution Condensed

Solution Attempt 1: Using the -builtin
Originally, I tried to install a builtin version of ParaView and use "paraFoam -builtin" as suggested by the openfoamwiki through Ubuntu repository, but it didn't work. (I'll discuss this more in the Random Possibly-Helpful Stuff).

I gave up on that, so I tried to figure out the issues with the OpenFOAM paraview installation.

I found the following this fantastic forum post/exchange between wyldckat and h0y5840. This was extremely helpful, but I did have to do some translating from what the older versions were talking about to what I needed. All mentions of "post #NN" are referring to this post.

The Source of the Issue is found:

Now I believe the issue is that I ran "./makeParaView" before installing Qt via "./makeQt" as it recommends in the "ThirdParty-v1712/BUILD.md" (Note to self, read all the information before doing anything). This was substantiated from post #22

Solution Attempt 2: No Qt-uite there...
I've now installed qt-5.9.3 per the instructions in "ThirdParty-v1712/BUILD.md". The install is located in "ThirdParty-v1712/platforms/linux64Gcc/qt-5.9.3"

I tried run paraFoam after that, but no dice.

Following post #20, I unpacked "ThirdParty-v1712.tgz" into the "$HOME/OpenFOAM directory".

I ran paraview again, but got the exact same error as initially.

There were several mentions of changing a "settings.sh" file, but I didn't find such a thing (I did later, but I'll tackle that in the Random Possibly-Helpful Stuff).

Solution Attempt 3: A two pronged attack

With that new failure, I decided to investigate why simply using "paraFoam -builtin" wasn't working.

This was also right around the time I was contemplating deleting and rebuilding the OpenFOAM installation of paraview per post #24, so I decided to tackle them together.

I downloaded ParaView straight from their site, unpacked it, and added it to my "~/.bashrc" per the openfoamwiki.

Trying "paraFoam -builtin" at this stage resulted in the same as usual.

So I then deleted the ParaFoam Installation: "rm -rf ThirdParty_v1712/platforms/linux64Gcc/ParaView-5.4.1/" (Note: DO NOT delete ThirdParty_v1712/PararView-v5.4.1 like the Original Post as I believe this houses the installation files, not the compiled files).

I tried again and voia-la!! It finally worked!!

The End Solution Condensed:

So the end solution goes something like this for me:
  1. Delete the failed OpenFOAM-based paraview installation via:
    Code:

    rm -rf $WM_THIRD_PARTY_DIR/platforms/linux64Gcc/ParaView-5.4.1/
  1. Follow the instructions from the openfoamwiki which I'll quote below for posterity's sake:

    Quote:

    When it comes to ParaView, it's possible to avoid the need to build it from source code. If your Linux Distribution provides ParaView 5.4.0 or newer, you don't need to build ParaView from source code. Simply run:

    Code:

    paraFoam -builtin
    and it will open the case in ParaView.

    If the previous command worked, you can add the following alias command in your ~/.bashrc file:

    Code:

    alias paraFoam='paraFoam -builtin'
    In case you have an old Linux Distribution and still don't want to build ParaView from source code, get the latest binary version for Linux from ParaView's official website. Then add to your ~/.bashrc file the following line (adapt accordingly):

    Code:

    export PATH=$HOME/Downloads/ParaView-5.5.0/bin:$PATH


Now it should be able to run perfectly fine via "paraFoam -builtin"

Random Possibly-Helpful Stuff:
Note: Much of this kinda some educated guesswork and things I have necessarily tried. I'm just putting this hear as A) a reminder to myself should I encounter these kind of issues again and B) some alternatives should people find this in the future.

Some Translations of the Original Thread:

The Original Thread references a "settings.sh" several times, but on the newer installations, there's none to be found. I believe those settings are now in "OpenFOAM-v1712/etc/config.sh/" which has a bunch of files that seem to be setups for individual programs. Additionally, "OpenFOAM-v1712/etc/basrc" seems to reference those quite a bit.

The Original Thread discusses deleting the OpenFOAM-based paraview installation as "$WM_THIRD_PARTY_DIR/ParaView-5.4.1/" when it is not stored in "$WM_THIRD_PARTY_DIR/platforms/linux64Gcc/ParaView-5.4.1/"

The Original Thread discusses using "./makeParaView" to install the OpenFOAM-based paraview. I believe this must have the "-qt" flags that are referenced in "ThirdParty-v1712/BUILD.md" in order to work correctly. I think. I'm not super sure about it, but the current documentation conflicts with the Original Thread, so I figured I'd mention it.

Making Solution 2 Work (I think):

So the issue with solution 2 I believe (the reinstallation of Qt inside the OpenFOAM directory) was that ParaView was still referencing the system Qt, not the newly installed Qt.

The reasoning behind this is the contents of "OpenFOAM-v1712/etc/config.sh/paraview" contain user editable lines the reference what Qt should be referenced. The default is "qt-system", not a locally installed version of Qt. The Original Thread's changes to the "settings.sh" changed the Qt directory variable to point to the newly installed version. I would test it now, so that may be what I needed to do here.

Complete conjecture here, but maybe if you run "./makeParaView -qt 5.9.3" it will automatically be changed to point to the version in the OpenFOAM directory? It doesn't really matter for this discussion, but I figured I mention it.

olesen July 2, 2018 16:17

Getting a working Qt, with all the required include files is one of the largest difficulties with building ParaView. With ParaView-5.5.x, you'll know also need a qt5 at least.


In any case, for your summary

1. build Qt as needed. ParaView recommends 5.9.3, but on opensuse leap 42.3 it has qt-5.6 something and that works fine. I've had real problems building qt-4.9 on older systems, but managed to build qt-5.6 on a few of them


2. with makeParaView, you can also specify the qt version that you just built. Eg, makeParaView qt-5.6.4 5.5.2 and it should search the platforms/ directory to find it.


Cavaet with 1712 - the QT5_DIR was not properly set in etc/config.sh/paraview. This should be corrected for OpenFOAM-v1806 (released last week).


Of course, if you use regular paraview binaries, or just want the builtin reader, "paraFoam -vtk" is the same as "paraFoam -builtin", but saves a few keystrokes.


In any case, people should realized that paraFoam is nothing special. It is simply a wrapper script that does a "touch", paraview with that file, and cleans up on exit. Nothing magic at all. For the plugins (.blockMesh, .OpenFOAM), it adds some extra logic to test if the libraries appear to be there.


/mark

u2berggeist July 2, 2018 17:03

Firstly, Thanks for contributing some info!

Secondly:
Quote:

Originally Posted by olesen (Post 697953)
Cavaet with 1712 - the QT5_DIR was not properly set in etc/config.sh/paraview. This should be corrected for OpenFOAM-v1806 (released last week).

Was this the issue I ran into initially? Qt5 was installed on the native OS when I first start compiling everything together, and it sounds like that would be the reason that I ran into issues in the first place.

Thirdly:
Quote:

Originally Posted by olesen (Post 697953)
"paraFoam -vtk" is the same as "paraFoam -builtin", but saves a few keystrokes.

I can do you one better. :D I've appended "alias paraFoam='paraFoam -builtin'" to "~/OpenFOAM/OpenFOAM-v1712/etc/bashrc". Admitedly though, it wasn't my idea. It came from the OpenFOAM wiki article.


All times are GMT -4. The time now is 12:53.