Error building with Catalyst support

Hi all,

I’m having a bit of trouble installing Code_saturne 6.0.2 with Catalyst support.

I built Paraview 5.6.3 with catalyst and python flags activated, as well as install files flag.
I then used “make” and “make install”, but when I provide the installation path to CS, I have the following error during building :

../../../code_saturne-6.0.2/src/fvm/fvm_to_catalyst.cxx: At global scope:
../../../code_saturne-6.0.2/src/fvm/fvm_to_catalyst.cxx:402:23: error: ISO C++ forbids declaration of ‘_init_coprocessor’ with no type [-fpermissive]
 _init_coprocessor(void)
                       ^
../../../code_saturne-6.0.2/src/fvm/fvm_to_catalyst.cxx: In function ‘int _init_coprocessor()’:
../../../code_saturne-6.0.2/src/fvm/fvm_to_catalyst.cxx:458:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
make[3]: *** [Makefile:1284: fvm_catalyst_la-fvm_to_catalyst.lo] Error 1
make[3] : on quitte le répertoire « /home/antoine/Téléchargements/build/src/fvm »
make[2]: *** [Makefile:973: all-recursive] Error 1
make[2] : on quitte le répertoire « /home/antoine/Téléchargements/build/src »
make[1]: *** [Makefile:1595: all-recursive] Error 1
make[1] : on quitte le répertoire « /home/antoine/Téléchargements/build »
make: *** [Makefile:1039: all] Error 2

What Am I doing wrong ?

I saw that the paraview built inside Salome 9.4.0 has Catalyst installed, can I use this one to build CS with catalyst support ?

Best regards,

Antoine

UPDATE 1 :

In file “fvm_to_catalyst.cxx”, line 397, in “src” folder, replacing :

#if defined(HAVE_MPI)
static void
_init_coprocessor(bool      private_comm,
                  MPI_Comm  comm)
#else
_init_coprocessor(void)
#endif

With :

#if defined(HAVE_MPI)
static void
_init_coprocessor(bool      private_comm,
                  MPI_Comm  comm)
#else
static void
_init_coprocessor(void)
#endif

Building worked fine.

Hope everything else works fine now !


UPDATE 2 :

I managed to build and install Code_Saturne, it works fine, catalyst is now available under postrprocess writers.

I need to setup a writer to see if the results are OK.

Hello,

Which version of ParaView are you using ? Do you have in install of code_saturne with out MPI ?

In the internal EDF builds of Salome 9.4, ParaView is build with MPI support, and is usable for Catalyst support.

But last time I tested using a ParaView build without MPI (some months ago), I got an error message indicating MPI support was needed.

So you’ll see when you get further in the test, but if you get a similar error, you will need to build ParaView with MPI support… Not difficult to build, but can take hours to compile depending on your machine…

Best regards,

Yvan

Hi Yvan,

I did build Paraview with MPI support.
I’m using Paraview 5.6.3 and Code_Saturne 6.0.2, both with MPI support.

I did not manage to get the Salome paraview to work for building Code_Saturne if that was your question.

Are you saying that the issue I had means Paraview was not built with MPI support ?

Best regards,
Antoine

Hello,

Yes, it was possibly due to that. The issue you fixed was related to the case where code_saturne does not have MPI support, it seems (which is why we did not catch it before, as this is an unlikely combo).

If you have MPI support for both, things should go pretty well (hoping you do not get OpenGL-related issues, which could require additional install iterations).

Best regards,

Yvan

Good catch !

I forgot the mpi flag in CS configure… My bad !

Trying again…

I built again with MPI, and it works !
Thanks Yvan :smiley:

I have one small issue, which is the images won’t go in the folder set in code_saturne writers tab. Do you know why ? The folder gets created, but the images are in the root result folder of the run.

Best regards,
Antoine

Hello,

Yes, the images go into the execution directory by default, but you can configure that in the Catalyst Python scripts (either modify the path, or with recent ParaView versions, define the “root” directory, which can be “./postprocessing” I think; you can even do that under ParaView in the exports definition).

In v6.0, ParaView error messages go in the main log, but in 6.1, they go into postprocessing/catalyst.log. If the file deos not exist, it means there were no errors/warnings.

Best regards,

Yvan

Hello. I’m switching to CodeSaturne 6.x branch on Kubuntu 16 (up-to-date) and have problems with Saturne compilation.

Versions 6.0.6 (current main version) and 6.3.0 (current feature version) build successfully in basic configuration but won’t compile in Catalyst mode. I use ParaView 5.8.1 (current version). I configured it with options below:

CMAKE_INSTALL_PREFIX             /Programs/ParaView-5.8.1/install-catalyst
PARAVIEW_BUILD_EDITION           CATALYST
PARAVIEW_INSTALL_DEVELOPMENT_F   ON
PARAVIEW_USE_PYTHON              ON
PARAVIEW_USE_MPI                 ON
MPIEXEC_EXECUTABLE               /Programs/openmpi-1.8.4/build/bin/mpiexec
MPIEXEC_MAX_NUMPROCS             16 (Number of cores)
MPIEXEC_NUMPROC_FLAG             -np

It configured and built OK, but when I compile Saturne with standard options I used for version 5.x

./configure --prefix=/Programs/Code_Saturne-6.0.6-mpi-1.8.4-PV-5.2.0/build-catalyst/ \
            --with-libxml2=/Programs/libxml2-2.9.0/build/ \
            --with-med=/Programs/med-3.2.0/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-5.8.1/install-catalyst \
            --enable-openmp

I get the following on Saturne configure:

...
checking ParaView/Catalyst version above 5.6... CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find MPI (missing: MPI_C_FOUND C)
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /Programs/ParaView-5.8.1/install-catalyst/lib/cmake/paraview-5.8/vtk/patches/3.16/FindMPI.cmake:1705 (find_package_handle_standard_args)
  /Programs/ParaView-5.8.1/install-catalyst/lib/cmake/paraview-5.8/vtk/VTK-vtk-module-find-packages.cmake:203 (find_package)
  /Programs/ParaView-5.8.1/install-catalyst/lib/cmake/paraview-5.8/vtk/vtk-config.cmake:129 (include)
  /Programs/ParaView-5.8.1/install-catalyst/lib/cmake/paraview-5.8/paraview-config.cmake:53 (find_package)
  CMakeLists.txt:6 (find_package)


no
checking ParaView/Catalyst version 5.6 or older... CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find MPI (missing: MPI_C_FOUND C)
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /Programs/ParaView-5.8.1/install-catalyst/lib/cmake/paraview-5.8/vtk/patches/3.16/FindMPI.cmake:1705 (find_package_handle_standard_args)
  /Programs/ParaView-5.8.1/install-catalyst/lib/cmake/paraview-5.8/vtk/VTK-vtk-module-find-packages.cmake:203 (find_package)
  /Programs/ParaView-5.8.1/install-catalyst/lib/cmake/paraview-5.8/vtk/vtk-config.cmake:129 (include)
  /Programs/ParaView-5.8.1/install-catalyst/lib/cmake/paraview-5.8/paraview-config.cmake:53 (find_package)
  CMakeLists.txt:5 (FIND_PACKAGE)


CMake Warning (dev) in /Programs/ParaView-5.8.1/install-catalyst/lib/cmake/paraview-5.8/vtk/vtk-config.cmake:
  Policy CMP0011 is not set: Included scripts do automatic cmake_policy PUSH
  and POP.  Run "cmake --help-policy CMP0011" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  The included script

    /Programs/ParaView-5.8.1/install-catalyst/lib/cmake/paraview-5.8/vtk/vtk-config.cmake

  affects policy settings.  CMake is implying the NO_POLICY_SCOPE option for
  compatibility, so the effects are applied to the including context.
Call Stack (most recent call first):
  /Programs/ParaView-5.8.1/install-catalyst/lib/cmake/paraview-5.8/paraview-config.cmake:53 (find_package)
  CMakeLists.txt:5 (FIND_PACKAGE)
This warning is for project developers.  Use -Wno-dev to suppress it.

no
configure: error: in `/Programs/Code_Saturne-6.0.6-mpi-1.8.4-PV-5.2.0/source':
configure: error: Catalyst co-processing support requested, but test for Catalyst failed!
See `config.log' for more details

What can be the problem? You can find software versions used in configure arguments above. System MPI version is 2.1.1. Both Saturne and ParaView-5.8.1 compiled with OpenMPI-1.8.4 because later versions caused very nasty random crashes. I tried ParaView-5.2.0 but it looks like modern Saturne doesn’t support it (there are some VTK functions problems). Standard Saturne configuration witn MPI-1.8.4 is OK (configure/build/run GUI). Need your help…

Hello,

The MPI detection issue is surprising, because it seems very similar to an issue that was solved a few months ago. And which should not appear anymore in 6.3.0 or 6.0.6,

In any case, It is strongly recommend to use a separate directory for building the code (running configure from a separate, empty directory). In tree builds are not supported. So I suggest trying that first.

Also, having a recent enough CMake version may be necessary (we check for a minimum version but might be too lax).

Best regards,

Yvan

Thanks for your suggestions. Will try ASAP (I’m at work place now, the machine is a home workstation + I’m quite busy with everyday things now, I spent most of my spare time on weekend upgrading and updating Kubuntu and it was so kind to make it from 16 to 20.04 version :slight_smile:, but I didn’t have time yet to check if it helped and what CMake version I have for now). May it be connected also with old OpenMPI version 1.8.4? Maybe I need to use more recent OpenMPI? What OpenMPI version would you suggest as the most stable/compatible?

Hello,

I do not know the details of how CMake detects MPI, but switching to a more up-to-date version would be a good idea. In this case, using the latest OpenMPI, or whichever version is packaged on a Ububtu 20.04 would seem fine.

Best regards,

Yvan

I switched to out-of-source build (re-extracted fresh source tree), Kubuntu version is 20.04. The MPI issue disappeared but there is something other instead of this:

...
checking ParaView/Catalyst... CMake Error at CMakeLists.txt:27 (add_executable):
  Target "CoProcessingTest" links to target "VTK::ViewsContext2D" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at CMakeLists.txt:27 (add_executable):
  Target "CoProcessingTest" links to target "VTK::RenderingContext2D" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?


CMake Error at CMakeLists.txt:27 (add_executable):
  Target "CoProcessingTest" links to target "VTK::ChartsCore" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?

ParaView version is 5.8.1, I didn’t rebuild it. CMake version is 3.16.3 now. ParaView compatibility issue? Should I try other ParaView version? With PV 5.2.0 (worked with Saturne 5.x), it doesn’t configure with complain on Catalyst and PythonCatalyst modules (not available), at the same point of configure script. This behaviour is the same for Saturne 6.0.6 and 6.3.0.

Hello. Thanks for your support, Ivan. I solved previous problem enabling VTK’s ViewsContext2D parameter and one more parameter (something about charts, don’t remember exactly) in CCmake settings for Paraview (they can be edited in CMakeCache file). So common way to solve such issues is to search for corresponding parameters in ParaView settings (CMakeCache/CCMake), enable them, then configure/generate/make/install ParaView that Saturne links with(Catalyst version).
Saturne 6.3.0 has configured and built successfully with Catalyst, but the next problem appeared. When I start calculation with MPI, it just aborts execution, so I switched to single-thread for test as usual. And here is approximately what I saw:

Error loading /Programs/…/fvm_catalyst.so: /Programs/ParaView-5.8.1/…/libvtkWrappingPythonCore-pv5.8.so.1: undefined symbol: PyExc_ValueError

Also, I noticed that ParaView’s ccmake configure finds Python 3.8 that is current Kubuntu-20 Python version but it fails to build if there is no Python 3.6 in my system (it needs Python3.6m headers).

Looks like I need special ParaView CCMake parameter set for new Saturne/ParaView versions to work with Catalyst (it’s clear that older versions will not be supported soon and PV 5.2 is not compatible with modern Saturn already). I tried to find the tutorial on how to configure ParaView in Saturne 6.0 documentation (Install guide) but it seems that it’s all different in newer PV versions. There is a new global “Catalyst mode” parameter, while many other related parameters are gone (I checked with my old configure parameter sets for PV 4.3 and 5.2). Would you, please, suggest some solution? May be there are no any Catalyst guides for new versions and the only way for me is to explore myself? Oops, it’s getting scary :slight_smile:

Hello,

It looks like there is a mix of Python depedencies here, which could explain the library load issue.

Do you have multiple Python installs on your system ? Perhaps though environment modules or Conda or similar packages ?

Also, did you compile ParaView in a fresh (empty) build directory or do you have traces from an older install ? On most of our machines, we have Python 3.6, but I have compiled ParaView for code_saturne on an Arch Linux system with Python 3.8 and no more Python 3.6, so the dependency you observe seems surprising.

The documentation in the code_saturne might not be quite up to date, so here is a recommended option:

$ cmake
-DCMAKE_INSTALL_PREFIX=${INSTALL_PATH}_osmesa
-DPARAVIEW_USE_QT=OFF
-DPARAVIEW_USE_MPI=ON
-DPARAVIEW_USE_PYTHON=ON
-DPARAVIEW_INSTALL_DEVELOPMENT_FILES=ON
-DOSMESA_INCLUDE_DIR=${MESA_INSTALL_PREFIX}/include
-DOSMESA_LIBRARY=${MESA_INSTALL_PREFIX}/lib/libOSMesa.so
-DVTK_OPENGL_HAS_OSMESA=ON
-DVTK_USE_X=OFF
${PARAVIEW_SRC_PATH}

If you are running on a local machine with a display, and not on a cluster, you do not need OSMesa, but can use the standard OpenGL library (I can send another example for that case).

Best regards,

Yvan

Hello and thanks for your reply. I tried clean ParaView build, from clean build/install directories but with saved CMakeCache. The same error…

Regarding Python versions. As I know, a bunch of Pythons is normal for an average Linux system. After Kubuntu upgrade that removed old packages (it was needed to continue upgrade) there was 2 Python versions: 2.7 and 3.8 in my system. Then I installed 3.6 because of ParaView make complain (it needed Python 3.6m headers). Is this “version zoo” needs special attention or should Saturne find appropriate version itself? Back i nthe old days, as I remember, I needed LD_PRELOAD particular Python library before starting Saturne. Now it doesn’t help (I tried to preload Python3.8.so).

Looks like I need to dig some deeper into this issue. Error message says that PyExc_ValueError function is not found. Usually, unresolved externals arise while linking (building). When pointing to library function, you just have null pointer, you know… Is it a result of loading libvtkWrappingPythonCore-pv5.8.so.1 that is statically linked to Python? How can I trace the problem? Use strace? (I’m at work place now, will be able to check only when I get to my home station)
Also, PyExc_ValueError present in any of my Pythons (2.7, 3.6 and 3.8), I’ve checked headers. How can it be that the function is not found?

Hello,

code_saturne should be able to find the correct version but multiplie versions and environnement variables combinations can lead to incorrect detection. For example if you have 3.8 headers in a default path but LD_PRELOAD for another version.

As I noted before, ParaView is ok with only Python 3.8 on my system. Are you sure when it complained about Python 3.6 headers you had installed Python 3.8-devel and not only Python 3.8 ?

Could you also post your config.log ? Are you building from a separate directory now ?

Regards,

Yvan

Yes, I build Saturne and Paraview out-of-source now. When I got Python 3.6m headers problem I checked than Python3.8-devel is already installed and latest version. I was sure I will see standard “Do you wan to install [Y/n]” but development package was already there… export LD_PRELOAD=… was set to Python 3.8 before “code_saturne run” and it didn’t help.

I’ll check for PATH and Python-related Paraview options and write back. Maybe I need some options from this thread: https://discourse.paraview.org/t/undefined-symbol-pyexc-valueerror/5494
It seems to be Paraview problem and not related to Saturne directly. I think that one of desireable solutions is to include current ParaView sources with custom catalyst settings in Saturne source distribution (just ./configure … with-catalyst - and voila - it build it’s own actual “catalystic” ParaView modules), but it will take time for Saturne team to create this functionality and update with new ParaView versions.

Hello. I managed to launch Saturne 6.3.0 with catalyst with ParaView 5.8.1. PyExc_ValueError issue is solved with the following:

  1. Set /usr/bin/python symlink to /usr/bin/python3
  2. Set /usr/bin/python-config symlink to /usr/bin/python3-config
  3. export LD_PRELOAD=$LD_PRELOAD:/usr/lib/x86_64-linux-gnu/libpython3.8.so (before starting Saturne in terminal)

But there is the next issue! When ParaView is ready to accept Catalyst connection and calculation runs, no output is made and an error message is shown in catalyst.log:

Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "./Catalyst.py", line 117, in RequestDataDescription
    coprocessor.LoadRequestedData(datadescription)
  File "/Programs/ParaView-5.8.1/build-catalyst/lib/python3.8/site-packages/paraview/coprocessing.py", line 172, in LoadRequestedData
    datadescription.GetInputDescriptionByName(key).AllFieldsOn()
AttributeError: 'NoneType' object has no attribute 'AllFieldsOn'

I generetated fresh Catalyst.py with ParaView 8.5, so it should be compatible. What may cause this?

Hello,

You are getting closer to success. This error typically occurs when the name of the writer and of the input under the Catalyst script do not match.

If you check the documentation on the GitHub wiki https://github.com/code-saturne/code_saturne/wiki/In-situ-postprocessing-with-ParaView-Catalyst, check step 1.

You can also edit the matching entry (which appears at 2 or 3 places in the catalyst script) directly in the Catalyst Python file instead, but is may be safer to do it from the interface if you have not done it before.

Regards,

Yvan