[Paraview] VisIt Database Bridge - Custom Plugin of VisIt Reader

Simon Su newsgroup4ssu at gmail.com
Mon Apr 11 15:02:58 EDT 2011


Hi Robert,

I inferred a CMakeLists.txt from the wiki page


================ CMakeLists.txt for the plugin

PROJECT(VisItReaderGFDL)

cmake_minimum_required(VERSION 2.8)

FIND_PACKAGE(ParaView REQUIRED)
INCLUDE(${PARAVIEW_USE_FILE})

SET(SOURCES
 avtCM24FileFormat.C
 )

ADD_VISIT_PLUGIN_READER(VisItReaderGFDL "1.0"
  VISIT_READER_NAME "avtCM24FileFormat"
  VISIT_READER_TYPE "MTSD"
  VISIT_READER_FILE_PATTERN "nc"
  SERVER_SOURCES ${SOURCES}
  )

TARGET_LINK_LIBRARIES(VisItReaderGFDL vtkVisItAVTAlgorithms)
============================

I then placed the .C and .h files in the same directory
sms:/local/home/build/paraview-plugin> ls -alF gfdl-paraview-loader
total 112
drwxr-xr-x 2 sms t  4096 Apr 11 14:53 ./
drwxr-xr-x 5 sms t  4096 Apr 11 14:20 ../
-rw-r--r-- 1 sms t 87958 Apr 11 12:51 avtCM24FileFormat.C
-rw-r--r-- 1 sms t  7311 Apr 11 14:25 avtCM24FileFormat.h
-rw-r--r-- 1 sms t   404 Apr 11 13:02 CMakeLists.txt


Then in the build directory, I did a ccmake and entered the right text for
ParaView_DIR variable and I got this after configure/generate/make

sms:/local/home/build/paraview-plugin/gfdl-paraview-loader-build> ls -alF
total 228
drwxr-xr-x 3 sms t  4096 Apr 11 14:25 ./
drwxr-xr-x 5 sms t  4096 Apr 11 14:20 ../
-rw-r--r-- 1 sms t 42197 Apr 11 14:24 CMakeCache.txt
drwxr-xr-x 6 sms t  4096 Apr 11 14:25 CMakeFiles/
-rw-r--r-- 1 sms t  1691 Apr 11 14:24 cmake_install.cmake
-rwxr-xr-x 1 sms t 74174 Apr 11 14:25 libVisItReaderGFDL.so*
-rw-r--r-- 1 sms t 12258 Apr 11 14:24 Makefile
-rw-r--r-- 1 sms t  2685 Apr 11 14:24 moc_VisItReaderGFDL_Plugin.cxx
-rw-r--r-- 1 sms t  3376 Apr 11 14:24 qrc_VisItReaderGFDL.cxx
-rw-r--r-- 1 sms t   578 Apr 11 14:24 VisItReaderGFDLInit.cxx
-rw-r--r-- 1 sms t  4308 Apr 11 14:24 VisItReaderGFDL_Plugin.cxx
-rw-r--r-- 1 sms t  3809 Apr 11 14:24 VisItReaderGFDL_Plugin.h
-rw-r--r-- 1 sms t   163 Apr 11 14:24 VisItReaderGFDL.qrc
-rw-r--r-- 1 sms t  1045 Apr 11 14:24 vtkSMVisItReaderGFDLInstantiator.cxx
-rw-r--r-- 1 sms t   464 Apr 11 14:24 vtkSMVisItReaderGFDLInstantiator.h
-rw-r--r-- 1 sms t  5473 Apr 11 14:24 vtkSMXML_VisItReaderGFDL.h
-rw-r--r-- 1 sms t  4705 Apr 11 14:24 vtkVisItReaderGFDLClientServer.cxx
-rw-r--r-- 1 sms t  4025 Apr 11 14:24 vtkVisItReaderGFDL.cxx
-rw-r--r-- 1 sms t  1740 Apr 11 14:24 vtkVisItReaderGFDLExport.h
-rw-r--r-- 1 sms t   151 Apr 11 14:24 vtkVisItReaderGFDLGUI.xml
-rw-r--r-- 1 sms t  2194 Apr 11 14:24 vtkVisItReaderGFDL.h
-rw-r--r-- 1 sms t  4169 Apr 11 14:24 vtkVisItReaderGFDLSM.xml


however, loading the plugin using plugin manager gui resulted in an error

Cannot load library
/local/home/build/paraview-plugin/gfdl-paraview-loader-build/libVisItReaderGFDL.so:
(/local/home/build/paraview-plugin/gfdl-paraview-loader-build/libVisItReaderGFDL.so:
undefined symbol: _ZTI17avtCM24FileFormat)

then from your plugin wiki page, I added the following line into my
avtCM24FileFormat.h file

vtkCxxRevisionMacro(VisItReaderGFDL, "$Revision$");

but when I compile, I get

sms:/local/home/build/paraview-plugin/gfdl-paraview-loader-build> make
[  9%] Generating moc_VisItReaderGFDL_Plugin.cxx
[ 18%] Generating vtkVisItReaderGFDLClientServer.cxx
[ 27%] Generating qrc_VisItReaderGFDL.cxx
[ 36%] Generating vtkSMXML_VisItReaderGFDL.h
-- Generate module: vtkVisItReaderGFDLSM
[ 45%] Building CXX object
CMakeFiles/VisItReaderGFDL.dir/qrc_VisItReaderGFDL.cxx.o
[ 54%] Building CXX object
CMakeFiles/VisItReaderGFDL.dir/vtkVisItReaderGFDL.cxx.o
/local/home/build/paraview-plugin/gfdl-paraview-loader/avtCM24FileFormat.h:45:
error: 'VisItReaderGFDL' has not been declared
/local/home/build/paraview-plugin/gfdl-paraview-loader/avtCM24FileFormat.h:
In function 'void CollectRevisions(std::ostream&)':
/local/home/build/paraview-plugin/gfdl-paraview-loader/avtCM24FileFormat.h:45:
error: invalid use of 'this' in non-member function
/local/home/build/paraview-plugin/gfdl-paraview-loader/avtCM24FileFormat.h:45:
error: 'Superclass' has not been declared
make[2]: *** [CMakeFiles/VisItReaderGFDL.dir/vtkVisItReaderGFDL.cxx.o] Error
1
make[1]: *** [CMakeFiles/VisItReaderGFDL.dir/all] Error 2
make: *** [all] Error 2

and actually, my plugin code also depend on both netcdf and hdf5 library
which is specified in my VisIt xml file

sms:/local/home/build/paraview-plugin/gfdl-visit-load> cat CM24.xml
<?xml version="1.0"?>
  <Plugin name="CM24" type="database" label="NetCDF CM2.4" version="1.0"
enabled="true" mdspecificcode="false" engspecificcode="false"
onlyengine="false" noengine="false" dbtype="MTSD" haswriter="false"
hasoptions="false">
    <CXXFLAGS>

-I/net/sms/tools/VisIt/VisIt-2.2.1/sms.Linux-2.6.18-194.26.1.el5.x86_64.gcc-4.1.2.release/current/linux-x86_64/include/netcdf
      -Wno-deprecated
    </CXXFLAGS>
    <LIBS>

/local/home/tools/VisIt/VisIt-2.2.1/sms.Linux-2.6.18-194.26.1.el5.x86_64.gcc-4.1.2.release/current/linux-x86_64/archives/libnetcdf.a

/local/home/tools/VisIt/VisIt-2.2.1/sms.Linux-2.6.18-194.26.1.el5.x86_64.gcc-4.1.2.release/current/linux-x86_64/lib/libhdf5_hl.a

/local/home/tools/VisIt/VisIt-2.2.1/sms.Linux-2.6.18-194.26.1.el5.x86_64.gcc-4.1.2.release/current/linux-x86_64/lib/libhdf5.a

/local/home/tools/VisIt/VisIt-2.2.1/sms.Linux-2.6.18-194.26.1.el5.x86_64.gcc-4.1.2.release/current/linux-x86_64/lib/libsz.a
    </LIBS>
    <FilePatterns>
      *.nc
    </FilePatterns>
    <Files components="M">
      avtCM24FileFormat.C
      NETCDFFileObject.C
    </Files>
    <Files components="E">
      avtCM24FileFormat.C
      NETCDFFileObject.C
    </Files>
    <Attribute name="" purpose="" persistent="true" keyframe="true"
exportAPI="" exportInclude="">
    </Attribute>
  </Plugin>

how do I go about adding the appropriate netcdf and hdf5 libraries into the
plugin CMakeLists.txt file?

any help is much appreciated.

thank you
-simon




On Mon, Apr 11, 2011 at 8:25 AM, Robert Maynard
<robert.maynard at kitware.com>wrote:

> Hi Simon,
>
> You do not need to place the CMakeLists.txt inside ParaView at all to
> build a plugin. You just need to set that folder as the source folder
> for CMake, and set a different directory as the plugin build
> directory. After that you will need to set ParaView_DIR to your
> ParaView build directory.
>
> I would also look over: http://www.paraview.org/Wiki/Plugin_HowTo for
> my information on building plugins.
>
> On Fri, Apr 8, 2011 at 5:12 PM, Simon Su <newsgroup4ssu at gmail.com> wrote:
> > Hi there,
> >
> > I have silo plugin working and now I would like to try out adding my own
> > VisIt database plugin to ParaView.
> > http://www.cmake.org/Wiki/VisIt_Database_Bridge mentioned how to write
> the
> > CMakeLists.txt file but where do I need to place the files (
> CMakeLists.txt,
> > and avtMyReaderFileFormat.C) in the source tree of ParaView to be pickup
> by
> > the cmake process?
> >
> > thanks
> > -simon
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the ParaView Wiki at:
> > http://paraview.org/Wiki/ParaView
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.paraview.org/mailman/listinfo/paraview
> >
> >
>
>
>
> --
> Robert Maynard
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20110411/59277ab5/attachment.htm>


More information about the ParaView mailing list