Compiling CodeSaturne for co-processing (ParaView, Catalyst)

All questions about installation
Forum rules
Please read the forum usage recommendations before posting.
Antech
Posts: 197
Joined: Wed Jun 10, 2015 10:02 am

Re: Compiling CodeSaturne for co-processing (ParaView, Catal

Post by Antech »

Yvan Fournier
as long as you use a separate, "standard" build on a workstation with the co-processing script generator plugin
I found and used this plugin in standard ParaView binary distribution.

Thanks for the option to disable Qt, I hope it will work. It's also mentioned in ParaView official instruction (PV+OSMesa compile page), I just didn't know about it.

I already know about CMake caching, need to delete build directory contents periodically...

[!] Update
=========
I installed (compiled) ParaView 4.3.1 for offscreen rendering with Mesa library 10.5.4. But I encountered a problem compiling Code_Saturne :(. The only option I added relative to normal (working) configuration is:
--with-catalyst=/Programs/ParaView-4.3.1/build-catalyst
Directory is an installation prefix of Catalyst (offline-edition) ParaView that I've built with options recommended here:
http://www.paraview.org/Wiki/ParaView:Build_And_Install
http://www.paraview.org/Wiki/ParaView_And_Mesa_3D
Entire options set for Code_Saturne is:

Code: Select all

./configure --prefix=/Programs/Code_Saturne-4.0.2/build/ \
            --with-med=/Programs/med-3.0.8/build/ \
            --with-hdf5=/Programs/hdf5-1.8.10/build/ \
            --with-mpi=/Programs/openmpi-1.8.4/build/ \
            --with-cgns=/Programs/cgnslib-3.2.1/build \
            --with-scotch=/Programs/scotch-5.1.12/build \
            --with-catalyst=/Programs/ParaView-4.3.1\build-catalyst \
            --enable-openmp
Unfortunately, configure script with this option returns error:

Code: Select all

checking for cmake... /usr/bin/cmake
CMake Error at CMakeLists.txt:5 (FIND_PACKAGE):
  By not providing "FindParaView.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "ParaView",
  but CMake did not find one.

  Could not find a package configuration file provided by "ParaView" with any
  of the following names:

    ParaViewConfig.cmake
    paraview-config.cmake

  Add the installation prefix of "ParaView" to CMAKE_PREFIX_PATH or set
  "ParaView_DIR" to a directory containing one of the above files.  If
  "ParaView" provides a separate development package or SDK, be sure it has
  been installed.


configure: error: in `/Programs/Code_Saturne-4.0.2/source':
configure: error: Catalyst co-processing support requested, but test for Catalyst failed!
See `config.log' for more details
It's strange because I already pointed configure script to directory with "ParaViewConfig.cmake". OK, I export'ed environment variable ParaView_DIR that points to directory with "catalyst" build of ParaView 4.3.1. Configure was OK, but while compiling (make) there was many errors

Code: Select all

<Normal compilation>
...
fvm_to_catalyst.cxx:1049: error: ‘struct fvm_to_catalyst_t’ has no member named ‘processor’
fvm_to_catalyst.cxx:1049: error: ‘vtkCPProcessor’ has not been declared
fvm_to_catalyst.cxx:1053: error: ‘vtkMPICommunicatorOpaqueComm’ was not declared in this scope
fvm_to_catalyst.cxx:1053: error: expected ‘;’ before ‘vtk_comm’
fvm_to_catalyst.cxx:1055: error: ‘struct fvm_to_catalyst_t’ has no member named ‘processor’
fvm_to_catalyst.cxx:1055: error: ‘vtk_comm’ was not declared in this scope
fvm_to_catalyst.cxx:1058: error: ‘struct fvm_to_catalyst_t’ has no member named ‘processor’
fvm_to_catalyst.cxx:1063: error: ‘vtkCPPythonScriptPipeline’ was not declared in this scope
fvm_to_catalyst.cxx:1063: error: ‘pipeline’ was not declared in this scope
fvm_to_catalyst.cxx:1063: error: ‘vtkCPPythonScriptPipeline’ is not a class or namespace
fvm_to_catalyst.cxx:1087: error: ‘struct fvm_to_catalyst_t’ has no member named ‘processor’
fvm_to_catalyst.cxx:1097: error: ‘struct fvm_to_catalyst_t’ has no member named ‘datadesc’
fvm_to_catalyst.cxx:1097: error: ‘vtkCPDataDescription’ has not been declared
fvm_to_catalyst.cxx:1098: error: ‘struct fvm_to_catalyst_t’ has no member named ‘datadesc’
fvm_to_catalyst.cxx: At global scope:
fvm_to_catalyst.cxx:955: warning: unused parameter ‘path’
fvm_to_catalyst.cxx:955: warning: unused parameter ‘time_dependency’
fvm_to_catalyst.cxx: In function ‘void* fvm_to_catalyst_finalize_writer(void*)’:
fvm_to_catalyst.cxx:1135: error: ‘struct fvm_to_catalyst_t’ has no member named ‘processor’
fvm_to_catalyst.cxx:1136: error: ‘struct fvm_to_catalyst_t’ has no member named ‘processor’
fvm_to_catalyst.cxx:1137: error: ‘struct fvm_to_catalyst_t’ has no member named ‘datadesc’
fvm_to_catalyst.cxx: In function ‘void fvm_to_catalyst_set_mesh_time(void*, int, double)’:
fvm_to_catalyst.cxx:1184: error: ‘struct fvm_to_catalyst_t’ has no member named ‘datadesc’
fvm_to_catalyst.cxx: In function ‘void fvm_to_catalyst_flush(void*)’:
fvm_to_catalyst.cxx:1427: error: ‘struct fvm_to_catalyst_t’ has no member named ‘processor’
fvm_to_catalyst.cxx:1427: error: ‘struct fvm_to_catalyst_t’ has no member named ‘datadesc’
fvm_to_catalyst.cxx:1428: error: ‘struct fvm_to_catalyst_t’ has no member named ‘datadesc’
fvm_to_catalyst.cxx:1429: error: ‘struct fvm_to_catalyst_t’ has no member named ‘processor’
fvm_to_catalyst.cxx:1429: error: ‘struct fvm_to_catalyst_t’ has no member named ‘datadesc’
make[3]: *** [fvm_catalyst_la-fvm_to_catalyst.lo] Error 1
make[3]: Leaving directory `/Programs/Code_Saturne-4.0.2/source/src/fvm'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/Programs/Code_Saturne-4.0.2/source/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/Programs/Code_Saturne-4.0.2/source'
make: *** [all] Error 2
I use gcc 4.4.7 that is default in CentOS 6.5. Maybe I need newer gcc? Or maybe it incompatibility of Saturne Catalyst Adaptor with ParaView 4.3.1?

I found the reason for these errors but don't know how to correct it. It seems that compiler doesn't know where the Catalyst sources and headers are. It's because there is no option (or I don't know it) in configure script to specify Catalyst sources directory. I think I just do/set something wrong...
[Sorry, here was my wrong idea, I deleted this text]

Intermediate update
==================
I found significant differences in directory structure of ParaView 3.12 and 4.3.1. Header files needed for catalyst adapter are in different directories. I'm now trying to compile ParaView 3.12 with "catalyst options" (for OSMesa).
I can't compile ParaView 3.12! Settings in ccmake are from official web page:
http://www.paraview.org/Wiki/ParaView_And_Mesa_3D
It worked OK for version 4.3.1 but ParaView 3.12 don't compile. Lots of unresolved (undefined) references to [vtkXRenderWindow...], XtDispatchEvent e.t.c., although VTK_USE_X is off. I repeated setting ccmake + generating Makefile from scratch but these undefined externals are still there!

Please, help!
Antech
Posts: 197
Joined: Wed Jun 10, 2015 10:02 am

Re: Compiling CodeSaturne for co-processing (ParaView, Catal

Post by Antech »

Sombody, please, help... It looks like current Code_Saturne 4.0.2 is incompatible with ParaView 4.3.1 co-processor, and ParaView 3.12.0 dont want to compile with recommended settings for OSMesa rendering (see details in my previos post).
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: Compiling CodeSaturne for co-processing (ParaView, Catal

Post by Yvan Fournier »

Hello,

In any case, ParaView 4.2 and 4.3 are compatible with Code_Saturne 4.0, older versions are not.

So forget about ParaView 3.12.

In your ParaView 4.3 install, did you only use the CMake options provided in the ParaView documentation page you linked to, or also the ones recommended in the Code_Saturne installation manual ?

For Code_Saturne ti use ParaView/Catalyst, you need to make sure ParaView development headers are installed, and this option is not activated by default.

I just realized this info is missing from the Code_Saturne install documentation (I'll fix it).

You need to add: -DPARAVIEW_INSTALL_DEVELOPMENT_FILES=ON

And also:-DPARAVIEW_USE_MPI=ON

On my builds, I also add:-DBUILD_TESTING=OFF for faster builds (and avoiding test data downloads)

I am not sure -DPARAVIEW_ENABLE_PYTHON=ON is absolutely necessary, but I include it just in case...

These options do not cause issues with CMake caching (compared to diablign Qt), so you can use "ccmake -i ." in your ParaView build directory to edit them.

Regards,

Yvan
Antech
Posts: 197
Joined: Wed Jun 10, 2015 10:02 am

Re: Compiling CodeSaturne for co-processing (ParaView, Catal

Post by Antech »

Yvan Fournier
Thanks for your answer!

I already figured out that DPARAVIEW_INSTALL_DEVELOPMENT_FILES must be ON and DBUILD_TESTING OFF. I now enabled MPI in ParaView 4.3.1 and got lots of undefined references like MPI_Isend, MPI_Recv e.t.c. so I'm trying to work around this issue...
Antech
Posts: 197
Joined: Wed Jun 10, 2015 10:02 am

Re: Compiling CodeSaturne for co-processing (ParaView, Catal

Post by Antech »

Yvan Fournier
Hello.
It was not easy for me (due to custom installation prefixes and poor experience) to build ParaView with MPI support but I did it with help from ParaView mailing list (MPI library options gave me a kick :)).
Now I've got ParaView 4.3.1 built on my laptop with following features:
VTK_USE_X=OFF
VTK_OPENGL_HAS_OSMESA=ON
PARAVIEW_QT_SUPPORT=OFF
PARAVIEW_ENABLE_CATALYST=ON
PARAVIEW_USE_MPI=ON
PARAVIEW_INSTALL_DEVELOPEMENT_FILES=ON
PARAVIEW_ENABLE_PYTHON=ON
OpenGL is configured to use OSMesa 10.5.4 libraries.
ParaView 4.3.1 with these options is compiled/installed in /Programs/ParaView-4.3.1/build-catalyst.

CodeSaturne 4.0.2 cofigured as follows:

Code: Select all

./configure --prefix=/Programs/Code_Saturne-4.0.2/build/ \
            --with-med=/Programs/med-3.0.8/build/ \
            --with-hdf5=/Programs/hdf5-1.8.10/build/ \
            --with-mpi=/Programs/openmpi-1.8.4/build/ \
            --with-cgns=/Programs/cgnslib-3.2.1/build \
            --with-scotch=/Programs/scotch-5.1.12/build \
            --with-catalyst=/Programs/ParaView-4.3.1\build-catalyst \
            --enable-openmp
But I still get errors while compiling Saturne, for example:
fvm_to_catalyst.cxx:74:34: error: vtkCPDataDescription.h: No such file or directory
fvm_to_catalyst.cxx:75:39: error: vtkCPInputDataDescription.h: No such file or directory
fvm_to_catalyst.cxx:76:28: error: vtkCPProcessor.h: No such file or directory
fvm_to_catalyst.cxx:77:39: error: vtkCPPythonScriptPipeline.h: No such file or directory

I dont post full errors listing because it's too large. This fragment makes it clear that some headers are out of scope while compiling. Three of these files are in CoProcessing/Catalyst in ParaView source directory tree but not in build directory tree, although PARAVIEW_INSTALL_DEVELOPEMENT_FILES is ON.

Meanwhile, some ParaView files are "seen" by compiler:
In file included from /Programs/ParaView-4.3.1/source-std/VTK/Common/Core/vtkVariant.h:444,
from /Programs/ParaView-4.3.1/source-std/VTK/Common/Core/vtkAbstractArray.h:46,
from /Programs/ParaView-4.3.1/source-std/VTK/Common/DataModel/vtkFieldData.h:46,
from /Programs/ParaView-4.3.1/source-std/VTK/Common/DataModel/vtkDataSetAttributes.h:45,
from /Programs/ParaView-4.3.1/source-std/VTK/Common/DataModel/vtkCellData.h:27,
from fvm_to_catalyst.cxx
:60:
/Programs/ParaView-4.3.1/source-std/VTK/Common/Core/vtkVariantInlineOperators.h: In member function ‘bool vtkVariant::operator==(const vtkVariant&) const’:
/Programs/ParaView-4.3.1/source-std/VTK/Common/Core/vtkVariantInlineOperators.h:158: warning: comparing floating point with == or != is unsafe
/Programs/ParaView-4.3.1/source-std/VTK/Common/Core/vtkVariantInlineOperators.h:162: warning: comparing floating point with == or != is unsafe


CMakeCache.txt and Makefile used to build ParaView 4.3.1 are in attach.

I found a couple of options in ParaView ccmake configuration, but don't know if they neccessary:
VTK_USE_OFFSCREEN (use offscreen calls by default)
PARAVIEW_BUILD_CATALYST_ADAPTORS (build adaptors for various simulation codes)

What should I do to compile Saturne with Catalyst correctly?

Thanks.
Attachments
Make.zip
(61.35 KiB) Downloaded 370 times
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: Compiling CodeSaturne for co-processing (ParaView, Catal

Post by Yvan Fournier »

Hello,

In your "configure" command, you should not use the build directory of ParaView, but its installation directory (i.e. watever value you used as CMAKE_INSTALL_PREFIX for ParaView). For ParaView, after running "make", you ned to run "make install" before configuring Code_Saturne.

Regards,

Yvan
Antech
Posts: 197
Joined: Wed Jun 10, 2015 10:02 am

Re: Compiling CodeSaturne for co-processing (ParaView, Catal

Post by Antech »

Oh, I/m sorry, I was so busy configuring MPI stuff so I forget to make install :) I will now try to recompile with correct environment.
Is there any problems with installation in build directory?

I've built it! Thanks for instructions. But now I get a strange error: "code_saturne gui" says that it cannot import PyQt4.QtCore or PyQt4.QtGui modules. OK, I recompiled Saturne without Catalyst support, such a build worked normally before my experiments with Catalyst, but now it gives the same error about PyQt4.
I made a simple test from this page: https://wiki.python.org/moin/PyQt/Getti ... and%20PyQt
It says that Qt version is 4.6.2, SIP version is 4.9.3 and PyQt version is 4.6.2. What's wrong now?
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: Compiling CodeSaturne for co-processing (ParaView, Catal

Post by Yvan Fournier »

Hello,

The build directory has a different structure from the install directory, so using it directly will lead to apparently "missing" files.

Regarding your issues with Qt, you probably have a conflict betwwen the Qt you installed for ParaView and the original one you used for Code_Saturne. Where did you install the new version ? Did you also install Python-Qt with it ? Did you run "make distclean" in your Code_Saturne build before reconfiguring, so as to remove cached traces of the old path ? If you have an old (complete, with PyQt) and new (probably without PyQt) installation, you can probably force the old install for Code_Saturne using some configure options, includinf PYUIC4 and PYRCC4 environment variables (check "configure --help" for anything mentioning PyQt).

On my builds, for some older machines which have a too old Qt version, I install the new version under "/home/saturne/opt/qt-4.8" for example, then "export PATH=/home/saturne/opt/qt-4.8/bin:$PATH" before running cmake on ParaView, but I don't use that exported path when building Code_Saturne.

Regards,

Yvan
Antech
Posts: 197
Joined: Wed Jun 10, 2015 10:02 am

Re: Compiling CodeSaturne for co-processing (ParaView, Catal

Post by Antech »

Yvan Fournier
Thanks for you support even for non-Saturne related questions.

I don't have any experience with PyQt (I only worked with "usual" Qt4) so I cannot find the cause of problem. I don't remember that I installed any special PyQt, python or Qt version(s) betwen successful runs of Saturne (the same sources, 4.0.2) and now. But for some reason PyQt seems not to work! The following "Hello, World" code:
import sys
from PyQt4 import Qt
a = Qt.QApplication(sys.argv)
returns "Attribute error: 'module' object has no attribute 'QApplication'".
May it be that compiling ParaView with Qt disables influenced my Qt or PyQt installation?

Oops! It turned out that I really installed another Qt package. I deleted it and now "usual" Saturne GUI works! I compiled "Catalyst" version of Saturne and it runs. Thanks!
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: Compiling CodeSaturne for co-processing (ParaView, Catal

Post by Yvan Fournier »

Hello,

Great ! I just hope the Qt version you deleted was not necessary for ParaView (which requires at least 4.7). It might still work with minor glitches with you basic version :)

Regards,

Yvan
Post Reply