Hi Robert,<br><br>I will give it a try.<br><br>thanks<br>-simon<br><br><div class="gmail_quote">On Mon, Apr 18, 2011 at 9:26 AM, Robert Maynard <span dir="ltr"><<a href="mailto:robert.maynard@kitware.com">robert.maynard@kitware.com</a>></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>I have attached an example CMakeLists.txt that support external library linking and include directories. Since you are linking to a static build of HDF5 you will need to manually add each library to VISIT_PLUGIN_EXTERNAL_LIBS separated by semicolons. </div>
<div><div><div></div><div class="h5"><div><br></div><br><div class="gmail_quote">On Mon, Apr 11, 2011 at 5:19 PM, Simon Su <span dir="ltr"><<a href="mailto:newsgroup4ssu@gmail.com" target="_blank">newsgroup4ssu@gmail.com</a>></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>It worked. adding the other file listed under my Files components="M" 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> 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'' 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 "vtkVisItReaderGFDL.h"<br>#include "vtkInformation.h"<br>
#include "vtkInformationVector.h"<br>#include "vtkObjectFactory.h"<br>#include "vtkMultiBlockDataSet.h"<br><br>#include "avtCM24FileFormat.h"<br>#include "avtDatabaseMetaData.h"<br>
#include "avtMeshMetaData.h"<br>#include "avtVariableCache.h"<br><br>/* #undef ARG_VISIT_READER_USES_OPTIONS */<br><br>#ifdef ARG_VISIT_READER_USES_OPTIONS<br>#include ".h"<br>#endif<br><br>
/* #undef VISIT_READER_USES_INTERFACE */<br>
#ifdef VISIT_READER_USES_INTERFACE<br>#include "vtkVisItReaderGFDL.h"<br>#endif<br><br>vtkStandardNewMacro(vtkVisItReaderGFDL);<br><br>//-----------------------------------------------------------------------------<br>
vtkVisItReaderGFDL::vtkVisItReaderGFDL()<br>{<br> this->FileName = 0;<br>}<br><br>//-----------------------------------------------------------------------------<br>vtkVisItReaderGFDL::~vtkVisItReaderGFDL()<br>{<br> this->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& timestep )<br>
{<br> if (!this->MetaData)<br> {<br> this->MetaData = new avtDatabaseMetaData( );<br> }<br><br> if (!this->Cache)<br> {<br> this->Cache = new avtVariableCache( );<br> }<br><br> if (!this->AvtFile)<br>
{ <br> try<br> { <br>#ifdef ARG_VISIT_READER_USES_OPTIONS <br> *options = <br> new ();<br> this->AvtFile = new avtCM24FileFormat(<br> this->FileName, options->GetReadOptions() );<br>
delete options;<br>#else<br> this->AvtFile = new avtCM24FileFormat(this->FileName);<br>#endif <br> }<br> catch(...)<br> {<br> this->AvtFile = NULL;<br> return false;<br> } <br>
avtCM24FileFormat *file = dynamic_cast<avtCM24FileFormat*><br> (this->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->SetCache( this->Cache );<br> file->ActivateTimestep(timestep);<br> <br> //only fill database after choosing timestep to activate<br> file->SetDatabaseMetaData( this->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& os, vtkIndent indent)<br>{<br> this->Superclass::PrintSelf(os, indent);<div><div></div><div><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"><<a href="mailto:robert.maynard@kitware.com" target="_blank">robert.maynard@kitware.com</a>></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="M" 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><br>
<br><div class="gmail_quote">On Mon, Apr 11, 2011 at 3:02 PM, Simon Su <span dir="ltr"><<a href="mailto:newsgroup4ssu@gmail.com" target="_blank">newsgroup4ssu@gmail.com</a>></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 "1.0"<br> VISIT_READER_NAME "avtCM24FileFormat"<br> VISIT_READER_TYPE "MTSD"<br>
VISIT_READER_FILE_PATTERN "nc"<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> 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> 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, "$Revision$");<br><br>but when I compile, I get<br><br>sms:/local/home/build/paraview-plugin/gfdl-paraview-loader-build> 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: 'VisItReaderGFDL' has not been declared<br>
/local/home/build/paraview-plugin/gfdl-paraview-loader/avtCM24FileFormat.h: In function 'void CollectRevisions(std::ostream&)':<br>/local/home/build/paraview-plugin/gfdl-paraview-loader/avtCM24FileFormat.h:45: error: invalid use of 'this' in non-member function<br>
/local/home/build/paraview-plugin/gfdl-paraview-loader/avtCM24FileFormat.h:45: error: 'Superclass' 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> cat CM24.xml<br>
<?xml version="1.0"?><br> <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"><br>
<CXXFLAGS><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> </CXXFLAGS><br> <LIBS><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>
</LIBS><br> <FilePatterns><br> *.nc<br> </FilePatterns><br> <Files components="M"><br> avtCM24FileFormat.C<br> NETCDFFileObject.C<br> </Files><br> <Files components="E"><br>
avtCM24FileFormat.C<br> NETCDFFileObject.C<br> </Files><br> <Attribute name="" purpose="" persistent="true" keyframe="true" exportAPI="" exportInclude=""><br>
</Attribute><br> </Plugin><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"><<a href="mailto:robert.maynard@kitware.com" target="_blank">robert.maynard@kitware.com</a>></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 <<a href="mailto:newsgroup4ssu@gmail.com" target="_blank">newsgroup4ssu@gmail.com</a>> wrote:<br>
> Hi there,<br>
><br>
> I have silo plugin working and now I would like to try out adding my own<br>
> VisIt database plugin to ParaView.<br>
> <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>
> CMakeLists.txt file but where do I need to place the files ( CMakeLists.txt,<br>
> and avtMyReaderFileFormat.C) in the source tree of ParaView to be pickup by<br>
> the cmake process?<br>
><br>
> thanks<br>
> -simon<br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ParaView Wiki at:<br>
> <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
><br>
><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>
</div></div></blockquote></div><br><br clear="all"><br></div></div>-- <br>Robert Maynard<br>
</div>
</blockquote></div><br>