Superbuild with Anaconda Python 3.7.1

I forgot to mention that my comment concerned the standalone version of Paraview 5.6.0 and not the superbuild. I did not use MPI support.
/Eric

Hi Eric, Mathieu,

Thanks for your tips - I’m still having a few issues. After specifying the correct Python library and executable paths, it not seems to interfere with my QT install. Although I have specified the QT paths to my system install, it seems that ccmake tries to hook in the Python QT libraries. I tried removing Anaconda from my path to make sure it wasn’t finding the libraries from PATH but it still seems to pick it up. The message I get on ccmake ‘generate’ is attached below. Any thoughts or suggestions would be appreciated!

Many thanks and kind regards,

Tim

CMake Warning at VTK/CMake/vtkModuleMacros.cmake:575 (add_library):

Cannot generate a safe runtime search path for target pqWidgets because

files in some directories may conflict with libraries in implicit

directories:

runtime library [libQt5Network.so.5] in /usr/lib64 may be hidden by files in:

/home/tjim/anaconda3/envs/pv/lib

runtime library [libQt5Help.so.5] in /usr/lib64 may be hidden by files in:

/home/tjim/anaconda3/envs/pv/lib

runtime library [libQt5Widgets.so.5] in /usr/lib64 may be hidden by files in:

/home/tjim/anaconda3/envs/pv/lib

runtime library [libQt5X11Extras.so.5] in /usr/lib64 may be hidden by files in:

/home/tjim/anaconda3/envs/pv/lib

runtime library [libQt5Gui.so.5] in /usr/lib64 may be hidden by files in:

/home/tjim/anaconda3/envs/pv/lib

runtime library [libQt5Sql.so.5] in /usr/lib64 may be hidden by files in:

/home/tjim/anaconda3/envs/pv/lib

runtime library [libQt5Core.so.5] in /usr/lib64 may be hidden by files in:

/home/tjim/anaconda3/envs/pv/lib

Some of these libraries may not be found correctly.

Call Stack (most recent call first):

VTK/CMake/vtkModuleMacros.cmake:660 (vtk_add_library)

Qt/Widgets/CMakeLists.txt:269 (vtk_module_library)

Hi Tim,
Here are the cMake flags I used for Qt (5.9.3) if it can help
-DPARAVIEW_BUILD_QT_GUI=ON
-DPARAVIEW_QT_VERSION=5 -DQt5_DIR=$MYPATH/qt/5.9.3/lib/cmake/Qt5
Note also that in my previous comment I made a typo $PATH should be $MYPATH (where your python installation is located). Sorry for that.
Regards
Eric

Hi Eric,

Thanks! Does this mean you installed QT5 within your python install using pip or similar?

Thanks,

Tim

Tim,
No, I installed Qt separately. You also need to make sure that your $PATH and $LD_LIBRARY_PATH are correct so that you pick up the correct Qt, python, etc. when you run cmake.
Eric

For the issue you are having, I would recommend checking the CMakeCache.txt for any remaining mention of your anaconda Qt install, and also setting LD_LIBRARY_PATH and PATH correctly.

Thanks for the tips. I installed all the QT libraries and set all the flags. I tried again starting from a fresh directory and adding flags one at a time. It all seems to be fine setting the QT flags until I add my python directory - from then, ‘generate’ results in messages similar to below. I’ve made sure that the paths are clear and that the only mentions of my python install ‘/home/tjim/anaconda3/envs/pv/’ are in the PYTHON_LIBRARY and PYTHON_INCLUDE_DIR variables. I’m not sure what to try next - I could remove the conflicting libraries from my python install, but that will kill Matplotlib or other graphical libraries I think. Do you have any other ideas I might be able to try? Many thanks.

CMake Warning at VTK/CMake/vtkModuleMacros.cmake:575 (add_library):

Cannot generate a safe runtime search path for target pqWidgets because

files in some directories may conflict with libraries in implicit

directories:

runtime library [libQt5Network.so.5] in /usr/lib64 may be hidden by files in:

/home/tjim/anaconda3/envs/pv/lib

runtime library [libQt5Help.so.5] in /usr/lib64 may be hidden by files in:

/home/tjim/anaconda3/envs/pv/lib

runtime library [libQt5Widgets.so.5] in /usr/lib64 may be hidden by files in:

/home/tjim/anaconda3/envs/pv/lib

runtime library [libQt5X11Extras.so.5] in /usr/lib64 may be hidden by files in:

/home/tjim/anaconda3/envs/pv/lib

runtime library [libQt5Gui.so.5] in /usr/lib64 may be hidden by files in:

/home/tjim/anaconda3/envs/pv/lib

runtime library [libQt5Sql.so.5] in /usr/lib64 may be hidden by files in:

/home/tjim/anaconda3/envs/pv/lib

runtime library [libQt5Core.so.5] in /usr/lib64 may be hidden by files in:

/home/tjim/anaconda3/envs/pv/lib

Some of these libraries may not be found correctly.

Call Stack (most recent call first):

VTK/CMake/vtkModuleMacros.cmake:660 (vtk_add_library)

Qt/Widgets/CMakeLists.txt:269 (vtk_module_library)

I’m running into the same issue as OP regarding a failing build with MPI, python 3.7, and mpi4py. I’ve tested the same configuration on a similar system with python 3.6 and that works as expected - I think this is an issue with mpi4py w.r.t. python 3.7.

...
...
../VTK/ThirdParty/mpi4py/vtkmpi4py/src/mpi4py.MPI.c:164083:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
     tstate->exc_type = *type;
             ^~~~~~~~
             curexc_type
../VTK/ThirdParty/mpi4py/vtkmpi4py/src/mpi4py.MPI.c:164084:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
     tstate->exc_value = *value;
             ^~~~~~~~~
             curexc_value
../VTK/ThirdParty/mpi4py/vtkmpi4py/src/mpi4py.MPI.c:164085:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
     tstate->exc_traceback = *tb;
             ^~~~~~~~~~~~~
             curexc_traceback
In file included from ../VTK/ThirdParty/mpi4py/vtkmpi4py/src/MPI.c:4:
../VTK/ThirdParty/mpi4py/vtkmpi4py/src/mpi4py.MPI.c: In function ‘__Pyx_PyDict_Items’:
../VTK/ThirdParty/mpi4py/vtkmpi4py/src/mpi4py.MPI.c:1851:83: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t))__pyx_umethod_PyDict_Type_items.func’
               (PY_VERSION_HEX >= 0x030600B1 && (cfunc)->flag == METH_FASTCALL ?  (*(__Pyx_PyCFunctionFast)(cfunc)->func)(self, &PyTuple_GET_ITEM(__pyx_empty_tuple, 0), 0, NULL) :\
                                                                                  ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../VTK/ThirdParty/mpi4py/vtkmpi4py/src/mpi4py.MPI.c:164279:16: note: in expansion of macro ‘__Pyx_CallUnboundCMethod0’
         return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d);
                ^~~~~~~~~~~~~~~~~~~~~~~~~
[4902/19480] Building C object ThirdParty/cgns/vtkcgns/src/CMakeFiles/vtkcgns.dir/cgnslib.c.o
[4903/19480] Building CXX object VTK/Filters/Points/CMakeFiles/vtkFiltersPoints.dir/vtkExtractPointCloudPiece.cxx.o
[4904/19480] Building CXX object VTK/Filters/Points/CMakeFiles/vtkFiltersPoints.dir/vtkExtractPoints.cxx.o
[4905/19480] Building CXX object VTK/Filters/Points/CMakeFiles/vtkFiltersPoints.dir/vtkFitImplicitFunction.cxx.o
[4906/19480] Building CXX object VTK/Filters/Points/CMakeFiles/vtkFiltersPoints.dir/vtkGaussianKernel.cxx.o
[4907/19480] Building CXX object ParaViewCore/VTKExtensions/CGNSReader/CMakeFiles/vtkPVVTKExtensionsCGNSReader.dir/vtkCGNSReader.cxx.o
[4908/19480] Building CXX object VTK/Filters/Points/CMakeFiles/vtkFiltersPoints.dir/vtkExtractEnclosedPoints.cxx.o
[4909/19480] Building CXX object VTK/Filters/Points/CMakeFiles/vtkFiltersPoints.dir/vtkDensifyPointCloudFilter.cxx.o
[4910/19480] Building CXX object VTK/Filters/Points/CMakeFiles/vtkFiltersPoints.dir/vtkExtractSurface.cxx.o
ninja: build stopped: subcommand failed.

Here’s a copy of the cache file I use to preload the cmake build:

SET(BUILD_EXAMPLES ON CACHE BOOL "")
SET(PARAVIEW_ENABLE_FFMPEG ON CACHE BOOL "")
SET(PARAVIEW_ENABLE_PYTHON ON CACHE BOOL "")
SET(PARAVIEW_USE_MPI ON CACHE BOOL "")
SET(VTK_PYTHON_VERSION 3 CACHE STRING "")
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "")

find_program(CMAKE_C_COMPILER "gcc")
find_program(CMAKE_CXX_COMPILER "g++")
find_program(CMAKE_Fortran_COMPILER "gfortran")
find_program(MPI_C_COMPILER "mpicc")
find_program(MPI_CXX_COMPILER "mpicxx")
find_program(MPI_Fortran_COMPILER "mpifort")
find_program(PYTHON_EXECUTABLE "python3")

find_program(QT_QMAKE_EXECUTABLE "qmake-qt5")
find_program(QT_HELP_GENERATOR "qhelpgenerator-qt5")
find_program(QT_XMLPATTERNS_EXECUTABLE "xmlpatterns-qt5")

Copies of the resulting CmakeCache.txt file and log files are attached. Please advise if I should open up a new issue

CMakeCache.txt (188.9 KB)
log.cmake (40.0 KB)
log.make (590.0 KB)

The mpi4py generated using the Cython available at import time that is included in VTK 8.2.0 (which it appears you may be trying to compile) might not support those versions of Python. You could try doing this:

$EDITOR ThirdParty/mpi4py/update.sh
# change `tag="for/vtk"` to `tag="f79c82e4bd527a7770d1bd2a4fb53dab605678a2"`
ThirdParty/mpi4py/update.sh

with a newer Cython installed in case that gets you 3.7 support. Note that you need to be at the VTK root in order to run the script and it’s only really decently tested on Linux (there are known issues when running on macOS and Windows).

Hi Ben,

Thanks for getting back to me.

I tried changing the line to the git tag you listed but that doesn’t seem to work – that git hash doesn’t exist in the mpi4py, at least that’s what it looks like from the following error:

fatal: reference is not a tree: f79c82e4bd527a7770d1bd2a4fb53dab605678a2

The most recent commit that references that git hash is 3ad62583885dfe6f4e940cbda54e813ccc196b80, but that hash causes the same fatal error.

I also tried just running ./update.sh with the current for/vtk tag, and that resulted in at least building the mpi4py project, but also a merge clash

NOTE: All of this was done from a fresh git clone of the ParaView release branch (with associated submodules initialized)

Met vriendelijke groet,

REDstack BV

Chris Coutinho

Researcher/Data Analyst

Verzonden: maandag 6 mei 2019 21:11

I’ll push up a tag for that commit. It is for/vtk-20170419-2.0.0 instead of the raw hash.

Thanks @ben.boeckel, using that commit/tag works, and now I can build ParaView on my system with python 3.7.

Many thanks!