Trouble Building External Plugins with Superbuild

When I configure a build using the paraview-superbuild (v5.8.0), I don’t see any external plugins built, despite configuring them as follows:

cmake -make \
	-DENABLE_paraviewpluginsexternal=ON \
	-Dparaview_PLUGINS_AUTOLOAD=PhastaSyncIOReader \
	-Dparaview_PLUGINS_EXTERNAL=PhastaSyncIOReader \
	-Dparaview_PLUGIN_PhastaSyncIOReader_PATH=/home/npillai2/ParaViewSyncIOReaderPlugin \
	-DSUPERBUILD_PROJECT_PARALLELISM=2 \
	-DCMAKE_INSTALL_PREFIX=/usr/local/usrapps/iabolotn/install/paraview_5.8.0 \
      ../paraview-superbuild 

when adding the following [as suggested here]

IF (ParaView_SOURCE_DIR)
  INCLUDE_DIRECTORIES( ${VTK_INCLUDE_DIRS} )
ELSE (ParaView_SOURCE_DIR)
  FIND_PACKAGE(ParaView REQUIRED)
  INCLUDE(${PARAVIEW_USE_FILE})
ENDIF (ParaView_SOURCE_DIR)

to the end of my CMakeLists.txt (lines 375-380) [which, by the way, is not located in the “build” directory, only the parent “paraview-superbuild”] , I get this error if I go through ccmake

CMake Error at CMakeLists.txt:378 (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.

This is a little confusing to me as usually the parent directory with whatever I get from github has those files (i.e. if it’s not the superbuild, e.g. via “git clone https://gitlab.kitware.com/paraview/paraview.git”) but the superbuild works so many layers of magic, I have no idea where those files are.

Am I putting the commands in the right place? And if not, how should I go about resolving this issue?

Update on this issue - I did locate the paraview-config.cmake file (after building) at build/superbuild/paraview/build/lib/cmake/paraview-5.8/

I tried another approach to just build the plugin by itself pointing to the above path for ParaView_DIR

and ran into this error

CMake Error at CMakeLists.txt:22 (ADD_PARAVIEW_PLUGIN):
  Unknown CMake command "ADD_PARAVIEW_PLUGIN".

The whole CMakeLists.txt looks like this

cmake_minimum_required(VERSION 2.8)

if(NOT ParaView_SOURCE_DIR)
  find_package(ParaView REQUIRED)
  include(${PARAVIEW_USE_FILE})
  include_directories(${CMAKE_CURRENT_SOURCE_DIR})
else()
  include_directories(
    ${PARAVIEW_INCLUDE_DIRS}
    ${PARAVIEW_KWSYS_INCLUDE_DIRS}
    ${VTK_INCLUDE_DIRS}
  )
endif()

ADD_PARAVIEW_PLUGIN(PhastaSyncIOReader "1.0"
                                       SERVER_MANAGER_XML PhastaSyncIO.xml
                                       SERVER_MANAGER_SOURCES
                                       vtkPhastaSyncIOMetaReader.cxx
                                       vtkPhastaSyncIOReader.cxx
                                       REQUIRED_ON_SERVER
                                       )

and the plugin.cmake looks like this

if (PARAVIEW_USE_MPI)
  pv_plugin(PhastaSyncIOReader
    DESCRIPTION "Phasta SyncIO Reader"
    # uncomment AUTOLOAD to have the plugin automatically loaded. Note
    # though that this isn't working in PV 5.2 and probably earlier
    AUTOLOAD
    DEFAULT_ENABLED)
endif()

Since the last known version the plugin was built for was 5.2.0, I’m not sure if anything in there is out of date, or how to fix it - does anyone have any thoughts?

These docs should help you in migrating to the new plugin CMake API.

@ben.boeckel

Thanks for the response. I tried following some of the instructions in the changelog (namely changing the data in the bottom of my CMakeLists.txt from

ADD_PARAVIEW_PLUGIN(PhastaSyncIOReader "1.0"
                                       SERVER_MANAGER_XML PhastaSyncIO.xml
                                       SERVER_MANAGER_SOURCES
                                       vtkPhastaSyncIOMetaReader.cxx
                                       vtkPhastaSyncIOReader.cxx
                                       REQUIRED_ON_SERVER
                                       )

to

PARAVIEW_ADD_PLUGIN(PhastaSyncIOReader VERSION 1.0
                                       SERVER_MANAGER_XML PhastaSyncIO.xml
                                       SOURCES
                                       vtkPhastaSyncIOMetaReader.cxx
                                       vtkPhastaSyncIOReader.cxx
                                       REQUIRED_ON_SERVER
                                       )

Trying to make the plugin again (I’m totally unfamiliar with this kind of thing, but fortunately I still have some kind of notes - which suggested that to do so I run)

cmake -DParaView_DIR=/usr/local/usrapps/iabolotn/superbuild_paraview_5.8.0/build/superbuild/paraview/build/lib/cmake/paraview-5.8/ ../

where …/ is the directory with all the plugin files, CMakeLists, etc, and the long path is something from a superbuild install.

Trying to do so gave me the following error

I can get rid of the first error (pertaining to “PARAVIEW_USE_FILE”) by just deleting it, because I don’t know what to replace it with, but I still don’t know how to deal with the second error

The 's CMakeLists.txt may not add the PhastaSyncIOReader plugin.
Call Stack (most recent call first):
  CMakeLists.txt:15 (PARAVIEW_ADD_PLUGIN)

[Changing the CMakeLists.txt to more closely match the format here doesn’t change anything

Here’s the full CmakeLists.txt if it helps

cmake_minimum_required(VERSION 2.8)

if(NOT ParaView_SOURCE_DIR)
  find_package(ParaView REQUIRED)
  include(${PARAVIEW_USE_FILE})
  include_directories(${CMAKE_CURRENT_SOURCE_DIR})
else()
  include_directories(
    ${PARAVIEW_INCLUDE_DIRS}
    ${PARAVIEW_KWSYS_INCLUDE_DIRS}
    ${VTK_INCLUDE_DIRS}
  )
endif()

PARAVIEW_ADD_PLUGIN(PhastaSyncIOReader
                    REQUIRED_ON_SERVER
                    VERSION 1.0
                    SERVER_MANAGER_XML PhastaSyncIO.xml
                    SOURCES vtkPhastaSyncIOMetaReader.cxx vtkPhastaSyncIOReader.cxx)

Note that you’ll need to create a paraview.plugin file and use paraview_plugin_scan and paraview_plugin_build to build the plugin. paraview_add_plugin relies on information gathered during the scan and build to perform all of its work (and it avoids it having 30+ CMake parameters).

See this example for how to structure a simple CMake project using a plugin. Yes, there’s boilerplate, but VTK and ParaView are working to ensure that some CMake best practices are followed (and they can’t do all the boilerplate for everyone).

Thanks! That example helped - it seems like there’s been a lot of changes to the structure. I was able to compile some kind of library (.so) file and loaded it into Paraview just fine, but when I tried to open a .phts file with Paraview (which is what the plugin was designed to do), I ran into this error, which is well beyond me, since I didn’t write any of the code for the plugin.

vtkSIProxy.cxx:415 ERR| vtkSISourceProxy (0x2d15cc0): Failed to create 'vtkPhastaSyncIOMetaReader'. This typically means that ParaView does not know about the request class to create an instance of if. Ensure that it has been correctly wrapped using the client-server wrappers and the wrapping has been initialized. Note class names are case-sensitive. Check for typos. Aborting for debugging purposes.

Loguru caught a signal: SIGABRT

Fortunately, I ran through the process of plugin-making with paraview 5.6.0, and that plugin worked just fine. If there’s something simple that I’m missing, I’d take the oppurtunity to work on paraview 5.8.0, but if not, paraview 5.6.0 will certainly get the job done.

Your vtkPhastaSyncIOMetaReader needs to be part of a module in order to be wrapped. This example has such a model with the XML to expose it to the UI.