CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums

Building ParaView 3.8.0 with custom Qt 4.6.3

Register Blogs Members List Search Today's Posts Mark Forums Read

Rate this Entry

Building ParaView 3.8.0 with custom Qt 4.6.3

Posted January 9, 2011 at 12:41 by wyldckat
Updated September 5, 2011 at 05:16 by wyldckat (updated old link to openfoam.com)

<-- Related issues to ParaView with OpenFOAM - Fixes and solutions

This blog post is for those users who want to build ParaView 3.8.0 that comes with OpenFOAM's ThirdParty, version 1.7.0/1/x.


In case you don't know, ParaView 3.8.0 that comes with OpenFOAM 1.7.0/1, doesn't build very well with Qt 4.7. So, in case your system's Qt is already using 4.7, then you should play safe and follow the instructions in this blog post. If you don't know which version it has, run:
Code:
qmake --version
On the other hand, you can also try building ParaView 3.8.1, which I believe already builds well with Qt 4.7, but I haven't confirmed this yet.

So, this is pretty much just copy paste of this code onto your terminal, when you already have your OpenFOAM environment ready to be used:
Code:
foam3rdParty

wget http://modular.nucleation.googlecode.com/hg/of17x/files/makeQt
chmod +x makeQt

mkdir -p download
cd download
wget ftp://ftp.trolltech.com/qt/source/qt-everywhere-opensource-src-4.6.3.tar.gz
cd ..
tar -xzf download/qt-everywhere-opensource-src-4.6.3.tar.gz

time ./makeQt -opensource --confirm-license=yes > makeQt.log 2>&1 && \
time ./makeParaView -qmake ${WM_THIRD_PARTY_DIR}/platforms/$WM_ARCH$WM_COMPILER_ARCH/qt-everywhere-opensource-src-4.6.3/bin/qmake > makePV.log 2>&1

echo "Are these next two lines the same?"
which paraview
ls $ParaView_DIR/bin/paraview
The last two lines should output the same; otherwise, it's very likely that ParaView didn't build well Check the two logs makeQt.log and makePV.log and check what went wrong.
If it went well, then read the instructions left to do from here, right after "./makeParaView".

Why don't I simply put this in a script? Laziness And you should learn a bit about this in the mean time too

Technically, this is just an extract of a massive installation script that is still under development at the project openfoam-ubuntu (not endorsed to OpenCFD) and which has been moved to the project nucleation to avoid trademark infringement, but time hasn't been permitting us to make the final fixes, tests, coding and adjustments to release at least a beta version of the script

Additional Notes:
  • If you want to build ParaView with the system's OpenMPI, read this bug report: http://www.openfoam.com/mantisbt/view.php?id=96
  • If you are using Fedora 15 or kernel 2.6.38, then before running makeParaView, you'll need to run this command:
    Code:
    sed -i -e 's=ptrdiff_t=std::ptrdiff_t=' ${WM_THIRD_PARTY_DIR}/paraview-3.8.0/VTK/Utilities/vtkmetaio/metaUtils.cxx

Good luck!
Bruno
« Prev     Main     Next »
Total Comments 11

Comments

  1. Old Comment
    Dear Bruno,

    Thank you for the link, the effort and the good work! It works! (On Archlinux x86_64, for the people interested)

    As I said on the Openfoam bug-report website, the compilation of ParaView itself and the reason why the additional PV3FoamReader Modules can only be added to the locally compiled version of ParaView are two things which continue to baffle me no matter how much effort I put in understanding them..

    I wish there was an easy way of adding the PV3FoamReader Modules to a repository version of Paraview..

    I also tried your forum thread:
    "Using the official pre-built ParaView 3.8.0 version with OpenFOAM..." but that didn't work for some reason I didn't understand.

    By the way, I also had an other question related to Paraview, albeit slightly off-topic.. A friend of mine was also using paraview, but he had the possibility to export videos directly to avi format within Paraview, without having to use a third party software.. Any tips/ideas on how to get this nifty add-on? (he said he had it from the start, so he didn't know better) I have to export the animations as images, and then make a movie out of them, a process I would like to make more efficient..

    Kind regards,

    Francois.
    permalink
    Posted January 10, 2011 at 09:24 by Fransje Fransje is offline
  2. Old Comment
    Hi Francois,

    Quote:
    Originally Posted by Fransje View Comment
    As I said on the Openfoam bug-report website, the compilation of ParaView itself and the reason why the additional PV3FoamReader Modules can only be added to the locally compiled version of ParaView are two things which continue to baffle me no matter how much effort I put in understanding them..
    Because to build the plug-ins, we need the development header files used to build ParaView, which usually isn't made available by the Linux distribution that delivers the localized build version.

    Quote:
    Originally Posted by Fransje View Comment
    I wish there was an easy way of adding the PV3FoamReader Modules to a repository version of Paraview..
    As of ParaView 3.8.0, you can use the internal reader developed by Takuya (7islands here on the forum). To use it, follow the instructions in point #7 of my other blog post... which you didn't manage to work out with. Simply edit the "paraFoam" script and change all ".OpenFOAM" entries to ".foam".


    Quote:
    Originally Posted by Fransje View Comment
    By the way, I also had an other question related to Paraview, albeit slightly off-topic.. A friend of mine was also using paraview, but he had the possibility to export videos directly to avi format within Paraview, without having to use a third party software.. Any tips/ideas on how to get this nifty add-on? (he said he had it from the start, so he didn't know better) I have to export the animations as images, and then make a movie out of them, a process I would like to make more efficient..
    Oooo... that's going to be a bit difficult. If you were using Ubuntu 10.10, you simply would install ParaView from the repository, which would install the necessary movie making related library technology and voilá! But in your case, it'll be necessary to do some deeper investigation on which libraries are needed for building along with ParaView. Or simply follow the official instructions for building ParaView: http://www.paraview.org/Wiki/ParaView:Build_And_Install - well, they only mention the ffmpeg libraries, they don't explain how to exactly use them...

    Best regards and good luck!
    Bruno
    permalink
    Posted January 13, 2011 at 18:31 by wyldckat wyldckat is offline
  3. Old Comment
    For the users getting an error of the type:
    Code:
    metaUtils.cxx: 'ptdriff_t' has not been declared in this scope.
    when compiling paraview -I got the errror on Arch Linux x86_64 with gcc version 4.6.0-, open the metaUtils.cxx file in:
    Code:
    ~/OpenFOAM/ThirdParty-1.7.x/paraview-3.8.0/VTK/Utilities/vtkmetaio/
    and change all
    Code:
    ptdriff_t
    to
    Code:
    std::ptdriff_t
    This worked for me.

    Kind regards,

    Francois.
    permalink
    Posted April 23, 2011 at 09:36 by Fransje Fransje is offline
  4. Old Comment
    Hi Francois,

    your already using gcc 4.6.0! Be careful when compiling/building OpenFOAM 1.7.x with gcc 4.6.0, since I don't think it has been thoroughly tested yet and the previous OpenFOAM versions had problems with the new generations of gcc. OpenFOAM 1.7.1 had to be released to be compatible with gcc 4.5 series! So, be veeery careful!

    Therefore, it's advisable that you keep an OpenFOAM version built with gcc 4.5.x or 4.4.x close by, just in case the build with 4.6.0 starts giving interesting results. If you don't know how, here's another blog post of mine: Automated scripts for building gcc 4.4.x and 4.5.x for using with OpenFOAM 1.7 series

    Best regards,
    Bruno
    permalink
    Posted April 23, 2011 at 10:22 by wyldckat wyldckat is offline
  5. Old Comment
    Dear Bruno,

    Thank you for you swift comment and reply! That's quite some dedication! Keep up the good work!

    Yeah, gcc 4.6.0 was part of the system update I got when upgrading to the 2.6.38 kernel.. (blistering fast by the way.. Boot to login prompt under 15 seconds. on an average spec laptop. )

    But actually, further along the way I ran into some more troubles.. I started getting errors from paraFoam of the type:
    Quote:
    Application asked to unregister timer 0x6700001e which is not registered in this thread. Fix application.
    So I thought, well, you know, recompiling paraview might help ()..
    But then I got errors from paraview complaining that the toStdString function did not exist.. Hum.. Strange..

    So I downgraded back to gcc 4.5.2, to see if it helped, but to no avail..

    Looking deeper into the qt-code (somewhere in qstring.h) I found out that the function does exist, but that it was preceded by #ifndef QT_NO_STL. So now I'm having a go at compiling qt with the -no-stl option.

    I will keep you informed of my progress!

    Kind regards,

    Francois.

    Ps: Needing paraFoam/paraview, I installed the packaged paraview 3.10 coming with my distro, but I also get the same error.. So I'm suspecting it might actually be a slight kernel bug, although I don't know enough about kernels yet to say anything useful about them..
    permalink
    Posted April 24, 2011 at 07:05 by Fransje Fransje is offline
  6. Old Comment
    Well, using gcc version 4.5.2, the -no-stl option and the instructions given here-above, paraview refused to compile. It returns the same toStdString error as with version 4.6.0
    permalink
    Posted April 26, 2011 at 07:22 by Fransje Fransje is offline
  7. Old Comment
    Hi Francois,

    Mmm... Interesting problem But when it comes to Arch Linux, although I like its concept, I simply haven't been able yet to deal with its way of doing business.

    Either way, I'll try this weekend to do some tests building gcc 4.6.0 on my Ubuntu 10.10, so I can add it to my build-gcc toolkit. Then I'll try to follow my own instructions and see how far I get. This way we should be able to isolate where the problem comes from.

    Nonetheless, the following scenarios come to mind:
    1. The base library glibc, which I believe is highly intertwined with the kernel, might be the one at fault. When Qt tries to provide the wrapper for std::string, some pointer might be improperly defined, therefore things go wrong.
    2. There might be some weird residue from the system's Qt, which contaminates the loaded object space when building/running ParaView.
    3. When you moved to gcc 4.5.2, did you bring along a matching build of binutils? If not, this could be the problem!

    Edit: sadly I haven't been able to build gcc 4.6.0 yet there was a strange bug that appeared during build time about a missing "asm/errno.h" and after that it complained that "libc.so" was missing. So personally I'll wait for gcc 4.6.1 before trying this again

    Best regards,
    Bruno
    permalink
    Posted April 28, 2011 at 13:58 by wyldckat wyldckat is offline
    Updated April 30, 2011 at 07:25 by wyldckat (fixed typos... and see "Edit:")
  8. Old Comment
    AleDR's Avatar
    HI!

    First of all... thank very much for the very effective instructions!!! I managed to compile ParaView and proper Qt libraries without a problem!
    You saved me a lot of time in frustrating try-and-error process!

    Anyway... now I've a problem with the PV3FoamReader installation! The output of the my log file is:
    Quote:
    + [ -d /home/cluster/OpenFOAM/ThirdParty-1.7.x/platforms/linuxGcc/paraview-3.8.0 -a -r /home/cluster/OpenFOAM/ThirdParty-1.7.x/platforms/linuxGcc/paraview-3.8.0 ]
    + wmake libso vtkPV3Readers
    wmakeLnInclude: linking include files to ./lnInclude
    Making dependency list for source file vtkPV3Readers.C
    could not open file vtkWinCE.h for source file vtkPV3Readers.C
    SOURCE=vtkPV3Readers.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/home/cluster/OpenFOAM/ThirdParty-1.7.x/platforms/linuxGcc/paraview-3.8.0/include/paraview-3.8 -IlnInclude -I. -I/home/cluster/OpenFOAM/OpenFOAM-1.7.x/src/OpenFOAM/lnInclude -I/home/cluster/OpenFOAM/OpenFOAM-1.7.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/vtkPV3Readers.o
    '/home/cluster/OpenFOAM/OpenFOAM-1.7.x/lib/linuxGccDPOpt/libvtkPV3Readers.so' is up to date.
    + PV3FoamReader/Allwmake
    + [ -d /home/cluster/OpenFOAM/ThirdParty-1.7.x/platforms/linuxGcc/paraview-3.8.0 -a -r /home/cluster/OpenFOAM/ThirdParty-1.7.x/platforms/linuxGcc/paraview-3.8.0 ]
    + [ ! -n /home/cluster/OpenFOAM/OpenFOAM-1.7.x/lib/linuxGccDPOpt/paraview-3.8 ]
    + wmake libso vtkPV3Foam
    wmakeLnInclude: linking include files to ./lnInclude
    Making dependency list for source file vtkPV3Foam.C
    could not open file vtkWinCE.h for source file vtkPV3Foam.C
    Making dependency list for source file vtkPV3FoamFields.C
    could not open file vtkWinCE.h for source file vtkPV3FoamFields.C
    [...]
    '/home/cluster/OpenFOAM/OpenFOAM-1.7.x/lib/linuxGccDPOpt/libvtkPV3Foam.so' is up to date.
    + cd PV3FoamReader
    + mkdir -p Make/linuxGccDPOpt
    + cd Make/linuxGccDPOpt
    + cmake ../..
    -- The C compiler identification is GNU
    -- The CXX compiler identification is GNU
    -- Check for working C compiler: /usr/bin/gcc
    -- Check for working C compiler: /usr/bin/gcc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Loading ParaView CMake commands
    -- Loading ParaView CMake commands - done
    -- Looking for Q_WS_X11
    -- Looking for Q_WS_X11 - not found.
    -- Looking for Q_WS_WIN
    -- Looking for Q_WS_WIN - not found.
    -- Looking for Q_WS_QWS
    -- Looking for Q_WS_QWS - not found.
    -- Looking for Q_WS_MAC
    -- Looking for Q_WS_MAC - not found.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/cluster/OpenFOAM/OpenFOAM-1.7.x/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/PV3FoamReader/Make/linuxGccDPOpt
    + make
    [ 5%] Generating moc_PV3FoamReader_SM_Plugin.cxx
    make[2]: QT_MOC_EXECUTABLE-NOTFOUND: Command not found
    make[2]: *** [moc_PV3FoamReader_SM_Plugin.cxx] Error 127
    make[1]: *** [CMakeFiles/PV3FoamReader_SM.dir/all] Error 2
    make: *** [all] Error 2
    Whatever happened? =S ?
    Now that I launch paraFoam a dialog box pops out asking me to select the proper program. After selecting OpenFOAM, ParaView starts as usual with no other problems.
    How to fix this??

    My OS is Ubuntu 10.10

    Second question:
    how can I modify the script for MPI compatibility??

    Thank you!!! =)
    permalink
    Posted May 10, 2011 at 04:35 by AleDR AleDR is offline
  9. Old Comment
    Hi AleDR,

    For the first question - That is one weird error! (edit: oh wait, it didn't stop because of the file "vtkWinCE.h")
    OK, the quickest solution is explained here: Using the official pre-built ParaView 3.10.1 version with OpenFOAM - start with point #7

    For the second question - check this bug report, in case you are using the system's OpenMPI: http://www.openfoam.com/mantisbt/view.php?id=96
    Either way, you can build it with:
    Code:
    makeParaView -mpi -python
    Best regards,
    Bruno
    permalink
    Posted May 12, 2011 at 13:20 by wyldckat wyldckat is offline
    Updated May 12, 2011 at 13:22 by wyldckat (see "edit:")
  10. Old Comment
    Hi there!

    Well, as an update, I downgraded back to a 2.6.36 kernel, and the compilation went fine. So it really is a problem linked to the kernel..

    The only problem now is that I have the same issue as AleDR, namely that when paraFoam opens, a dialog box pops up asking me to select a program to read my .OpenFOAM case. Once I select "OpenFOAM", everything goes fine... Weird.. And I have to re-select OpenFOAM everytime..

    Kind regards,
    Francois.
    permalink
    Posted May 20, 2011 at 15:27 by Fransje Fransje is offline
  11. Old Comment
    Hi Francois,

    Many thanks for the feedback! And sadly I didn't get around to doing more tests on this, nor will I get any time to do so in the next few weeks or so
    As for the kernel being the one at fault... that is one crazy and strange issue... but hey, the way that technology is advancing, I suppose it's no wonder that things start breaking in strange places...

    As for the dialog popup, and like I said in my previous comment, the quickest solution is explained here: Using the official pre-built ParaView 3.10.1 version with OpenFOAM - point #7 - in your case, just do point #7

    Best regards,
    Bruno
    permalink
    Posted May 21, 2011 at 04:45 by wyldckat wyldckat is offline
 

All times are GMT -4. The time now is 15:48.