Hi Robert,<br><br>It worked. adding the other file listed under my Files components=&quot;M&quot; xml block solve the error when the plugin manager tries to loader the plugin.<br><br>So I went and try to load my file in ParaView ... but this is what I got....<br>
<br><br>sms:/local/home/build/paraview-plugin/gfdl-paraview-loader-build&gt; paraview<br>/local/home/tools/ParaView/ParaView-3.10.0/sms.Linux-2.6.18-194.26.1.el5.x86_64.gcc-4.1.2.release/lib/paraview-3.10/paraview: symbol lookup error: /local/home/build/paraview-plugin/gfdl-paraview-loader-build/libVisItReaderGFDL.so: undefined symbol: nc_inq_attlen<br>
<br><br>The question now is, where in ccmake can I specify for the plugin when it is compiling to also include libnetcdf.a libhdf5_hl.a libhdf5.a libsz.a libraries? Which variable do I add the libraries to? my ccmake only show three variables when the toggle advanced mode is Off (CMAKE_BUILD_TYPE, CMAKE_INSTALL_PREFIX, and ParaView_DIR). When I turn on the advanced mode, it gave me many many more... but going through the list, I am also not sure which cmake variable to use. <br>
<br><span style="border-collapse: collapse; font-family: arial,sans-serif; font-size: 13px;">vtkVisItReaderGFDL.cxx is attached and it with generated after I added the second file into my CMakeLists.txt. I hope the file is not too big for the list. </span>if it is, it is also included at the bottom of this email.<br>
<br>thank you for your help<br><br>best,<br>-simon<br><br><br>/*=========================================================================<br><br>   Program: ParaView<br>   Module:    vtkVisItReaderGFDL.cxx<br><br>   Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.<br>
   All rights reserved.<br><br>   ParaView is a free software; you can redistribute it and/or modify it<br>   under the terms of the ParaView license version 1.2.<br><br>   See License_v1.2.txt for the full ParaView license.<br>
   A copy of this license can be obtained by contacting<br>   Kitware Inc.<br>   28 Corporate Drive<br>   Clifton Park, NY 12065<br>   USA<br><br>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS<br>``AS IS&#39;&#39; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT<br>
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR<br>A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR<br>CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,<br>EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,<br>
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR<br>PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF<br>LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING<br>NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS<br>
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.<br><br>========================================================================*/<br>#include &quot;vtkVisItReaderGFDL.h&quot;<br>#include &quot;vtkInformation.h&quot;<br>
#include &quot;vtkInformationVector.h&quot;<br>#include &quot;vtkObjectFactory.h&quot;<br>#include &quot;vtkMultiBlockDataSet.h&quot;<br><br>#include &quot;avtCM24FileFormat.h&quot;<br>#include &quot;avtDatabaseMetaData.h&quot;<br>
#include &quot;avtMeshMetaData.h&quot;<br>#include &quot;avtVariableCache.h&quot;<br><br>/* #undef ARG_VISIT_READER_USES_OPTIONS */<br><br>#ifdef ARG_VISIT_READER_USES_OPTIONS<br>#include &quot;.h&quot;<br>#endif<br><br>/* #undef VISIT_READER_USES_INTERFACE */<br>
#ifdef VISIT_READER_USES_INTERFACE<br>#include &quot;vtkVisItReaderGFDL.h&quot;<br>#endif<br><br>vtkStandardNewMacro(vtkVisItReaderGFDL);<br><br>//-----------------------------------------------------------------------------<br>
vtkVisItReaderGFDL::vtkVisItReaderGFDL()<br>{<br>  this-&gt;FileName = 0;<br>}<br><br>//-----------------------------------------------------------------------------<br>vtkVisItReaderGFDL::~vtkVisItReaderGFDL()<br>{<br>  this-&gt;SetFileName(0);<br>
}<br><br>#ifdef VISIT_READER_USES_INTERFACE<br>//-----------------------------------------------------------------------------<br>int vtkVisItReaderGFDL::CanReadFile(const char *fname)<br>{<br>  int valid = 0;<br>  try<br>
    {<br>    valid = vtkVisItReaderGFDL::;<br>    }<br>  catch(...){}    <br>  return valid;<br>}<br>#endif <br><br>//-----------------------------------------------------------------------------<br>bool vtkVisItReaderGFDL::InitializeAVTReader(  const int&amp; timestep  )<br>
{<br> if (!this-&gt;MetaData)<br>    {<br>    this-&gt;MetaData = new avtDatabaseMetaData( );<br>    }<br><br>  if (!this-&gt;Cache)<br>    {<br>    this-&gt;Cache = new avtVariableCache( );<br>    }<br><br>  if (!this-&gt;AvtFile)<br>
    {     <br>    try<br>      {    <br>#ifdef ARG_VISIT_READER_USES_OPTIONS      <br>       *options = <br>        new ();<br>      this-&gt;AvtFile = new avtCM24FileFormat(<br>        this-&gt;FileName, options-&gt;GetReadOptions() );<br>
      delete options;<br>#else<br>      this-&gt;AvtFile = new avtCM24FileFormat(this-&gt;FileName);<br>#endif        <br>      }<br>    catch(...)<br>      {<br>      this-&gt;AvtFile = NULL;<br>      return false;<br>      }          <br>
    avtCM24FileFormat *file = dynamic_cast&lt;avtCM24FileFormat*&gt;<br>      (this-&gt;AvtFile);<br>    if ( file )<br>      {<br>      //we have to make sure the visit reader populates its cache<br>      //before activating a time step<br>
      try<br>        {<br>        file-&gt;SetCache( this-&gt;Cache );<br>        file-&gt;ActivateTimestep(timestep);<br>      <br>        //only fill database after choosing timestep to activate<br>        file-&gt;SetDatabaseMetaData( this-&gt;MetaData, timestep );<br>
        }<br>      catch(...)<br>        {<br>        return false;<br>        }      <br>      }<br>    else<br>      {<br>      return false;<br>      }<br>    }<br><br>  return true;<br>}<br><br><br><br>//-----------------------------------------------------------------------------<br>
void vtkVisItReaderGFDL::PrintSelf(ostream&amp; os, vtkIndent indent)<br>{<br>  this-&gt;Superclass::PrintSelf(os, indent);<br>}<br><br><br><br><br><br><br><div class="gmail_quote">On Mon, Apr 11, 2011 at 4:41 PM, Robert Maynard <span dir="ltr">&lt;<a href="mailto:robert.maynard@kitware.com">robert.maynard@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Simon,<div><br></div><div>You do not need to modify the avt file or add the revision macro as that is not the problem you are currently facing. I would try reverting your avt file to its original content, adding all the files listed in the <span style="border-collapse: collapse; font-family: arial,sans-serif; font-size: 13px;">Files components=&quot;M&quot; xml block to your SOURCES list,</span> and adding the plugin build folder to your LD_LIBRARY_PATH.</div>


<div><br></div><div>Also would you be able to send me the contents of the <span style="border-collapse: collapse; font-family: arial,sans-serif; font-size: 13px;">vtkVisItReaderGFDL.cxx from your build directory and I will confirm the automatic wrapping is working properly.</span><div>
<div></div><div class="h5"><br>

<br><div class="gmail_quote">On Mon, Apr 11, 2011 at 3:02 PM, Simon Su <span dir="ltr">&lt;<a href="mailto:newsgroup4ssu@gmail.com" target="_blank">newsgroup4ssu@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


Hi Robert,<br><br>I inferred a CMakeLists.txt from the wiki page<br><br><br>================ CMakeLists.txt for the plugin<br><br>PROJECT(VisItReaderGFDL)<br><br>cmake_minimum_required(VERSION 2.8)<br><br>FIND_PACKAGE(ParaView REQUIRED)<br>



INCLUDE(${PARAVIEW_USE_FILE})<br><br>SET(SOURCES<br> avtCM24FileFormat.C<br> )<br><br>ADD_VISIT_PLUGIN_READER(VisItReaderGFDL &quot;1.0&quot;<br>  VISIT_READER_NAME &quot;avtCM24FileFormat&quot;<br>  VISIT_READER_TYPE &quot;MTSD&quot;<br>



  VISIT_READER_FILE_PATTERN &quot;nc&quot;<br>  SERVER_SOURCES ${SOURCES}<br>  )<br><br>TARGET_LINK_LIBRARIES(VisItReaderGFDL vtkVisItAVTAlgorithms)<br>============================<br><br>I then placed the .C and .h files in the same directory<br>



sms:/local/home/build/paraview-plugin&gt; ls -alF gfdl-paraview-loader<br>total 112<br>drwxr-xr-x 2 sms t  4096 Apr 11 14:53 ./<br>drwxr-xr-x 5 sms t  4096 Apr 11 14:20 ../<br>-rw-r--r-- 1 sms t 87958 Apr 11 12:51 avtCM24FileFormat.C<br>



-rw-r--r-- 1 sms t  7311 Apr 11 14:25 avtCM24FileFormat.h<br>-rw-r--r-- 1 sms t   404 Apr 11 13:02 CMakeLists.txt<br><br><br>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<br>



<br>sms:/local/home/build/paraview-plugin/gfdl-paraview-loader-build&gt; ls -alF<br>total 228<br>drwxr-xr-x 3 sms t  4096 Apr 11 14:25 ./<br>drwxr-xr-x 5 sms t  4096 Apr 11 14:20 ../<br>-rw-r--r-- 1 sms t 42197 Apr 11 14:24 CMakeCache.txt<br>



drwxr-xr-x 6 sms t  4096 Apr 11 14:25 CMakeFiles/<br>-rw-r--r-- 1 sms t  1691 Apr 11 14:24 cmake_install.cmake<br>-rwxr-xr-x 1 sms t 74174 Apr 11 14:25 libVisItReaderGFDL.so*<br>-rw-r--r-- 1 sms t 12258 Apr 11 14:24 Makefile<br>



-rw-r--r-- 1 sms t  2685 Apr 11 14:24 moc_VisItReaderGFDL_Plugin.cxx<br>-rw-r--r-- 1 sms t  3376 Apr 11 14:24 qrc_VisItReaderGFDL.cxx<br>-rw-r--r-- 1 sms t   578 Apr 11 14:24 VisItReaderGFDLInit.cxx<br>-rw-r--r-- 1 sms t  4308 Apr 11 14:24 VisItReaderGFDL_Plugin.cxx<br>



-rw-r--r-- 1 sms t  3809 Apr 11 14:24 VisItReaderGFDL_Plugin.h<br>-rw-r--r-- 1 sms t   163 Apr 11 14:24 VisItReaderGFDL.qrc<br>-rw-r--r-- 1 sms t  1045 Apr 11 14:24 vtkSMVisItReaderGFDLInstantiator.cxx<br>-rw-r--r-- 1 sms t   464 Apr 11 14:24 vtkSMVisItReaderGFDLInstantiator.h<br>



-rw-r--r-- 1 sms t  5473 Apr 11 14:24 vtkSMXML_VisItReaderGFDL.h<br>-rw-r--r-- 1 sms t  4705 Apr 11 14:24 vtkVisItReaderGFDLClientServer.cxx<br>-rw-r--r-- 1 sms t  4025 Apr 11 14:24 vtkVisItReaderGFDL.cxx<br>-rw-r--r-- 1 sms t  1740 Apr 11 14:24 vtkVisItReaderGFDLExport.h<br>



-rw-r--r-- 1 sms t   151 Apr 11 14:24 vtkVisItReaderGFDLGUI.xml<br>-rw-r--r-- 1 sms t  2194 Apr 11 14:24 vtkVisItReaderGFDL.h<br>-rw-r--r-- 1 sms t  4169 Apr 11 14:24 vtkVisItReaderGFDLSM.xml<br><br><br>however, loading the plugin using plugin manager gui resulted in an error <br>



<br>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)<br>



<br>then from your plugin wiki page, I added the following line into my  avtCM24FileFormat.h file<br><br>vtkCxxRevisionMacro(VisItReaderGFDL, &quot;$Revision$&quot;);<br><br>but when I compile, I get<br><br>sms:/local/home/build/paraview-plugin/gfdl-paraview-loader-build&gt; make<br>



[  9%] Generating moc_VisItReaderGFDL_Plugin.cxx<br>[ 18%] Generating vtkVisItReaderGFDLClientServer.cxx<br>[ 27%] Generating qrc_VisItReaderGFDL.cxx<br>[ 36%] Generating vtkSMXML_VisItReaderGFDL.h<br>-- Generate module: vtkVisItReaderGFDLSM<br>



[ 45%] Building CXX object CMakeFiles/VisItReaderGFDL.dir/qrc_VisItReaderGFDL.cxx.o<br>[ 54%] Building CXX object CMakeFiles/VisItReaderGFDL.dir/vtkVisItReaderGFDL.cxx.o<br>/local/home/build/paraview-plugin/gfdl-paraview-loader/avtCM24FileFormat.h:45: error: &#39;VisItReaderGFDL&#39; has not been declared<br>



/local/home/build/paraview-plugin/gfdl-paraview-loader/avtCM24FileFormat.h: In function &#39;void CollectRevisions(std::ostream&amp;)&#39;:<br>/local/home/build/paraview-plugin/gfdl-paraview-loader/avtCM24FileFormat.h:45: error: invalid use of &#39;this&#39; in non-member function<br>



/local/home/build/paraview-plugin/gfdl-paraview-loader/avtCM24FileFormat.h:45: error: &#39;Superclass&#39; has not been declared<br>make[2]: *** [CMakeFiles/VisItReaderGFDL.dir/vtkVisItReaderGFDL.cxx.o] Error 1<br>make[1]: *** [CMakeFiles/VisItReaderGFDL.dir/all] Error 2<br>



make: *** [all] Error 2<br><br>and actually, my plugin code also depend on both netcdf and hdf5 library which is specified in my VisIt xml file <br><br>sms:/local/home/build/paraview-plugin/gfdl-visit-load&gt; cat CM24.xml<br>



&lt;?xml version=&quot;1.0&quot;?&gt;<br>  &lt;Plugin name=&quot;CM24&quot; type=&quot;database&quot; label=&quot;NetCDF CM2.4&quot; version=&quot;1.0&quot; enabled=&quot;true&quot; mdspecificcode=&quot;false&quot; engspecificcode=&quot;false&quot; onlyengine=&quot;false&quot; noengine=&quot;false&quot; dbtype=&quot;MTSD&quot; haswriter=&quot;false&quot; hasoptions=&quot;false&quot;&gt;<br>



    &lt;CXXFLAGS&gt;<br>      -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<br>      -Wno-deprecated<br>    &lt;/CXXFLAGS&gt;<br>    &lt;LIBS&gt;<br>



      /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<br>      /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<br>



      /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<br>      /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<br>



    &lt;/LIBS&gt;<br>    &lt;FilePatterns&gt;<br>      *.nc<br>    &lt;/FilePatterns&gt;<br>    &lt;Files components=&quot;M&quot;&gt;<br>      avtCM24FileFormat.C<br>      NETCDFFileObject.C<br>    &lt;/Files&gt;<br>    &lt;Files components=&quot;E&quot;&gt;<br>



      avtCM24FileFormat.C<br>      NETCDFFileObject.C<br>    &lt;/Files&gt;<br>    &lt;Attribute name=&quot;&quot; purpose=&quot;&quot; persistent=&quot;true&quot; keyframe=&quot;true&quot; exportAPI=&quot;&quot; exportInclude=&quot;&quot;&gt;<br>



    &lt;/Attribute&gt;<br>  &lt;/Plugin&gt;<br><br>how do I go about adding the appropriate netcdf and hdf5 libraries into the plugin CMakeLists.txt file? <br><br>any help is much appreciated.<br><br>thank you<br><font color="#888888">-simon</font><div>


<div></div><div><br>
<br><br><br><br><div class="gmail_quote">On Mon, Apr 11, 2011 at 8:25 AM, Robert Maynard <span dir="ltr">&lt;<a href="mailto:robert.maynard@kitware.com" target="_blank">robert.maynard@kitware.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Simon,<br>
<br>
You do not need to place the CMakeLists.txt inside ParaView at all to<br>
build a plugin. You just need to set that folder as the source folder<br>
for CMake, and set a different directory as the plugin build<br>
directory. After that you will need to set ParaView_DIR to your<br>
ParaView build directory.<br>
<br>
I would also look over: <a href="http://www.paraview.org/Wiki/Plugin_HowTo" target="_blank">http://www.paraview.org/Wiki/Plugin_HowTo</a> for<br>
my information on building plugins.<br>
<div><div></div><div><br>
On Fri, Apr 8, 2011 at 5:12 PM, Simon Su &lt;<a href="mailto:newsgroup4ssu@gmail.com" target="_blank">newsgroup4ssu@gmail.com</a>&gt; wrote:<br>
&gt; Hi there,<br>
&gt;<br>
&gt; I have silo plugin working and now I would like to try out adding my own<br>
&gt; VisIt database plugin to ParaView.<br>
&gt; <a href="http://www.cmake.org/Wiki/VisIt_Database_Bridge" target="_blank">http://www.cmake.org/Wiki/VisIt_Database_Bridge</a> mentioned how to write the<br>
&gt; CMakeLists.txt file but where do I need to place the files ( CMakeLists.txt,<br>
&gt; and avtMyReaderFileFormat.C) in the source tree of ParaView to be pickup by<br>
&gt; the cmake process?<br>
&gt;<br>
&gt; thanks<br>
&gt; -simon<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ParaView Wiki at:<br>
&gt; <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
--<br>
<font color="#888888">Robert Maynard<br>
</font></blockquote></div><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div>-- <br>Robert Maynard<br>
</div>
</blockquote></div><br>