<div dir="ltr">Dear Peter:</div><div dir="ltr"><br></div><div dir="ltr">    Thank you for your previous mail, with your help I can use the mesh2vtu.</div><div dir="ltr"><br></div><div dir="ltr">    Today mesh2vtu make error. I did not make changes to the system, but  I do not know why mesh2vtu can not be used.</div>
<div dir="ltr">    Attached is my error message.</div><div dir="ltr"><br></div><div dir="ltr">   Would you help me find out answer?</div><div dir="ltr"><br></div><div dir="ltr">   Look forward to your reply.</div><div dir="ltr">
<br></div><div dir="ltr"><br></div><div dir="ltr">   --------------</div><div dir="ltr">   steven</div><div class="gmail_extra"><br><br><div class="gmail_quote">2012/12/6 Peter Danecek <span dir="ltr"><<a href="mailto:Peter.Danecek@bo.ingv.it" target="_blank">Peter.Danecek@bo.ingv.it</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><br>
Hi,<br>
<br>
for the scope of compiling and linking mesh2vtu against VTK, you need only a relative small part of the whole VTK. For example the Python wrapper or the whole Rendering and Visualization staff is not needed. Anyway, I guess the easiest way to install VTK is through the package manager of your system. I am not very familiar with Redhat, but you should find tutorials on the web.<br>


<br>
When you are done with the VTK installations, check where it was put. My first guess would be something  like /usr/local/... (<prefix>)<br>
<br>
There you should find something the following ...<br>
NOTE: The version can be different, mesh2vtu will work also with other 5.x versions.<br>
<br>
<prefix>/include/vtk-5.10               <br>
 .. this is the path to put with -I flag (include) during compilation<br>
 Here you should find quite some header files ( *.h), on my installation there are nearly 2000<br>
<prefix>/lib/vtk-5.10           <br>
 .. this is the path to put with -L flag (library) during linking<br>
 Here you file the libraries (the extension depends on the platform, *.a or *.so are common)<br>
<br>
I send you my somewhat modified version of mesh2vtu. It should be sufficient to change the VTK_PREFIX & VER_VTK variables in the Makefile and type make. Note, that this version requires an extra parameter (to name the scalar variable) so do not expect the Perl wrapper to work as is. I will submit an extended version to the repository, when I find time to do some cleanup.<br>


<br>
</div></div><br><br>
<br>
<br>
--- snip ---<br>
[urquell:Utils/VTK-util/<u></u>mesh2vtu.petr.2012-12-06] petr% make<br>
g++ -c -O2 -Wno-deprecated -I/opt/local/include/vtk-5.10 -o mesh2vtu.o mesh2vtu.cxx<br>
g++  mesh2vtu.o -o mesh2vtu -L/opt/local/lib/vtk-5.10  -lvtkCommon -lvtkIO  -lvtkFiltering  -lvtkRendering -lvtkGraphics<br>
rm mesh2vtu.o<br>
[urquell:Utils/VTK-util/<u></u>mesh2vtu.petr.2012-12-06] petr% ls -la<br>
total 40<br>
drwxr-xr-x   5 petr  petr    170  6 Dec 10:37 .<br>
drwxr-xr-x  22 petr  petr    748  6 Dec 10:35 ..<br>
-rw-r--r--   1 petr  petr   1191  6 Dec 10:33 Makefile<br>
-rwxr-xr-x   1 petr  petr  18136  6 Dec 10:37 mesh2vtu<br>
-rw-r--r--   1 petr  petr  13321 29 Oct 16:30 mesh2vtu.cxx<br>
--- snap ---<br>
<br>
Good luck!<br>
~petr<br>
<br>
<br>
<br>
<br>
<br>
On 6 Dec 2012, at 03:16, ÕÔ·¼ wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Hello peter:<br>
<br>
 I don't known how to fix it. I need your help. Thank you very much!<br>
<br>
 There are some publise with SPECFEM3D about Post-Processing.<br>
 There is a error about <a href="http://mesh2vtu.pl" target="_blank">mesh2vtu.pl</a> as below:<br>
[root@Redhat mesh2vtu]# ./<a href="http://mesh2vtu.pl" target="_blank">mesh2vtu.pl</a> -i velocity_Z_it000400.mesh -o velocity_Z_it000400.vtu<br>
env: /SPECFEM3D/utils/<u></u>Visualization/Paraview/<u></u>mesh2vtu: Permission denied<br>
<br>
 For that, VTK has been installed as below:<br>
[root@Redhat vtk]# ls -lF<br>
total 101156<br>
drwxr-xr-x 25 root root     4096 Dec  1 16:04 bin/<br>
drwxr-xr-x 23  503  503     4096 Aug 24  2011 VTK/<br>
-rw-r--r--  1 root root 23745803 Sep  7 20:32 vtk-5.8.0.tar.gz<br>
drwxr-xr-x  4  503  503     4096 Aug 24  2011 VTKData/<br>
-rw-r--r--  1 root root 79709318 Sep  7 21:23 vtkdata-5.8.0.tar.gz<br>
<br>
 I installed VTK in /opt/vtk/bin.<br>
 When 'ccmake' I set BUILD_SHARED_LIBS to ON, and PYTHON_WRAPPING to ON. After 'make' and 'make install', I edit .bashrc add path as blow:<br>
export LD_LIBRARY_PATH=$LD_LIBRATY_<u></u>PATH:/opt/vtk/bin/bin/<br>
export DYLD_FALLBACK_LIBRARY_PATH=/<u></u>opt/vtk/bin/bin/<br>
export PYTHONPATH=/opt/vtk/bin/bin/<br>
export PYTHONPATH=$PYTHONPATH:/opt/<u></u>vtk/VTK/Wrapping/Python/<br>
<br>
 But I can't run <a href="http://setup.pl.in" target="_blank">setup.pl.in</a> which is in /opt/vtk/VTK/Wrapping/Python<br>
[root@Redhat Python]# python <a href="http://setup.py.in" target="_blank">setup.py.in</a> install<br>
 File "<a href="http://setup.py.in" target="_blank">setup.py.in</a>", line 36<br>
   vtk_use_rendering = @VTK_PYTHON_USE_RENDERING@<br>
                       ^<br>
SyntaxError: invalid syntax<br>
<br>
 I tested python scripts in /opt/vtk/VTK/Examples/GUI/<u></u>Python.<br>
[root@Redhat Python]# ./BoxWidget.py<br>
 Useing Python script to run the examply of the VTK is ok. I can see the pop-up dialog box.<br>
[root@Redhat Python]# python<br>
Python 2.7.3 (default, Dec  1 2012, 15:04:54)<br>
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2<br>
Type "help", "copyright", "credits" or "license" for more information.<br>
>>> import vtk<br>
>>><br>
 Python looks good with VTK.But I'm not sure that VTK installed properly.<br>
<br>
 After that I can not run <a href="http://mesh2vtu.pl" target="_blank">mesh2vtu.pl</a> too, I get the same error.<br>
[root@Redhat mesh2vtu]# ./<a href="http://mesh2vtu.pl" target="_blank">mesh2vtu.pl</a> -i velocity_Z_it000400.mesh -o velocity_Z_it000400.vtu<br>
env: /SPECFEM3D/utils/<u></u>Visualization/Paraview/<u></u>mesh2vtu: Permission denied<br>
<br>
 I change files owner to root, and give all competence.<br>
[root@Redhat mesh2vtu]# chown root:root *<br>
[root@Redhat mesh2vtu]# chmod 777 *<br>
[root@Redhat mesh2vtu]# ll<br>
total 1100<br>
-rwxrwxrwx 1 root root    4150 Apr 18  2010 cell2vtu.cxx<br>
-rwxrwxrwx 1 root root    1385 Apr 18  2010 <a href="http://cell2vtu.pl" target="_blank">cell2vtu.pl</a><br>
-rwxrwxrwx 1 root root     736 Apr 18  2010 <a href="http://century2xyz.pl" target="_blank">century2xyz.pl</a><br>
-rwxrwxrwx 1 root root     943 Dec  2 12:13 Makefile<br>
-rwxrwxrwx 1 root root     943 Dec  2 12:13 Makefile~<br>
-rwxrwxrwx 1 root root    1000 Nov 26 11:44 Makefile (copy)<br>
-rwxrwxrwx 1 root root    3988 Apr 18  2010 mesh2vtu.cxx<br>
-rwxrwxrwx 1 root root    1330 Nov 18 13:57 <a href="http://mesh2vtu.pl" target="_blank">mesh2vtu.pl</a><br>
-rwxrwxrwx 1 root root    1346 Nov 18 13:44 <a href="http://mesh2vtu.pl" target="_blank">mesh2vtu.pl</a>~<br>
-rwxrwxrwx 1 root root    2046 Apr 18  2010 <a href="http://points2vtu.pl" target="_blank">points2vtu.pl</a><br>
-rwxrwxrwx 1 root root    4195 Apr 18  2010 surf2vtu.cxx<br>
-rwxrwxrwx 1 root root    1399 Apr 18  2010 <a href="http://surf2vtu.pl" target="_blank">surf2vtu.pl</a><br>
-rwxrwxrwx 1 root root    3001 Apr 18  2010 ugrid.cxx<br>
-rwxrwxrwx 1 root root    1967 Apr 18  2010 ugrid_pts.cxx<br>
-rwxrwxrwx 1 root root 1056328 Sep  7 14:43 velocity_Z_it000400.mesh<br>
 But the error as before.<br>
<br>
 I try to 'make' in /SPECFEM3D/utils/<u></u>Visualization/Paraview/<u></u>mesh2vtu. Then I get error as blow:<br>
[root@Redhat mesh2vtu]# make<br>
g++ -O3 -I/opt/seismo-util/include -I/opt/seismo-util/include/vtk -Wno-<br>
deprecated -c mesh2vtu.cxx -o mesh2vtu.o<br>
mesh2vtu.cxx:39:31: error: vtk/vtkFloatArray.h: No such file or directory<br>
mesh2vtu.cxx:40:27: error: vtk/vtkPoints.h: No such file or directory<br>
mesh2vtu.cxx:41:30: error: vtk/vtkPointData.h: No such file or directory<br>
mesh2vtu.cxx:42:37: error: vtk/vtkUnstructuredGrid.h: No such file or directory<br>
mesh2vtu.cxx:43:46: error: vtk/<u></u>vtkXMLUnstructuredGridWriter.<u></u>h: No such file or directory<br>
mesh2vtu.cxx:44:53: error: vtk/<u></u>vtkUnstructuredGridToPolyDataF<u></u>ilter.h: No such file or directory<br>
mesh2vtu.cxx:45:38: error: vtk/vtkXMLPolyDataWriter.h: No such file or directory<br>
mesh2vtu.cxx:47:31: error: vtk/vtkDelaunay3D.h: No such file or directory<br>
mesh2vtu.cxx:48:30: error: vtk/vtkCellArray.h: No such file or directory<br>
mesh2vtu.cxx:49:29: error: vtk/vtkPointSet.h: No such file or directory<br>
mesh2vtu.cxx:50:31: error: vtk/vtkHexahedron.h: No such file or directory<br>
mesh2vtu.cxx: In function ‘int main(int, char**)’:<br>
mesh2vtu.cxx:81: error: ‘vtkPoints’ was not declared in this scope<br>
mesh2vtu.cxx:81: error: ‘newPts’ was not declared in this scope<br>
mesh2vtu.cxx:81: error: ‘vtkPoints’ is not a class or namespace<br>
mesh2vtu.cxx:82: error: ‘vtkFloatArray’ was not declared in this scope<br>
mesh2vtu.cxx:82: error: ‘newScalars’ was not declared in this scope<br>
mesh2vtu.cxx:82: error: ‘vtkFloatArray’ is not a class or namespace<br>
mesh2vtu.cxx:94: error: ‘vtkCellArray’ was not declared in this scope<br>
mesh2vtu.cxx:94: error: ‘cells’ was not declared in this scope<br>
mesh2vtu.cxx:94: error: ‘vtkCellArray’ is not a class or namespace<br>
mesh2vtu.cxx:102: error: ‘vtkHexahedron’ was not declared in this scope<br>
mesh2vtu.cxx:102: error: ‘hex’ was not declared in this scope<br>
mesh2vtu.cxx:102: error: ‘vtkHexahedron’ is not a class or namespace<br>
mesh2vtu.cxx:118: error: ‘vtkUnstructuredGrid’ was not declared in this scope<br>
mesh2vtu.cxx:118: error: ‘dataSet’ was not declared in this scope<br>
mesh2vtu.cxx:118: error: ‘vtkUnstructuredGrid’ is not a class or namespace<br>
mesh2vtu.cxx:129: error: ‘vtkXMLUnstructuredGridWriter’ was not declared in this scope<br>
mesh2vtu.cxx:129: error: ‘writer’ was not declared in this scope<br>
mesh2vtu.cxx:129: error: ‘vtkXMLUnstructuredGridWriter’ is not a class or namespace<br>
make: *** [mesh2vtu.o] Error 1<br>
<br>
 I edit Makefile in /SPECFEM3D/utils/<u></u>Visualization/Paraview/<u></u>mesh2vtu as blow:<br>
##############################<u></u>##############################<u></u>#<br>
## modify to match your compiler defaults<br>
CXX=g++<br>
<br>
## modify to match your library paths<br>
# VTK libraries<br>
VTK=/opt/vtk/bin<br>
LIBS=-L/usr/local/lib/vtk-5.8 -lvtkCommon -lvtkIO -lvtkRendering -lvtkFiltering -lvtkGraphics<br>
<br>
INCLUDES=-I/usr/local/include/<u></u>vtk-5.8<br>
CPPFLAGS= -O3 $(INCLUDES) -Wno-deprecated<br>
##############################<u></u>##############################<u></u>#<br>
When I 'make' I get the same error:<br>
[root@Redhat mesh2vtu]# make<br>
g++ -O3 -I/usr/local/include/vtk-5.8  -Wno-  deprecated -c mesh2vtu.cxx -o mesh2vtu.o<br>
mesh2vtu.cxx:39:31: error: vtk/vtkFloatArray.h: No such file or directory<br>
mesh2vtu.cxx:40:27: error: vtk/vtkPoints.h: No such file or directory<br>
......<br>
<br>
 I copy /opt/VTK-build/include/vtk-5.8 to /opt/VTK-build/include/vtk<br>
[root@Redhat mesh2vtu]# cp /opt/VTK-build/include/vtk-5.8 /opt/VTK-build/include/vtk<br>
[root@Redhat include]# ll<br>
total 204<br>
drwxr-xr-x  2 root root   4096 Nov 18 12:49 GL<br>
drwxr-xr-x  2 root root   4096 Dec  1 15:06 python2.7<br>
drwxr-xr-x 20 root root  73728 Dec  2 09:39 vtk<br>
drwxr-xr-x 20 root root 118784 Dec  2 09:39 vtk-5.8<br>
<br>
 After that I try to edit Makefile again in /SPECFEM3D/utils/<u></u>Visualization/Paraview/<u></u>mesh2vtu.<br>
##############################<u></u>##############################<u></u>#<br>
## modify to match your compiler defaults<br>
CXX=g++<br>
<br>
## modify to match your library paths<br>
# VTK libraries<br>
VTK=/opt/vtk/bin<br>
LIBS=-L/usr/local/lib/vtk-5.8 -lvtkCommon -lvtkIO -lvtkRendering -lvtkFiltering -lvtkGraphics<br>
<br>
INCLUDES=-I/usr/local/include/<br>
CPPFLAGS= -O3 $(INCLUDES) -Wno-deprecated<br>
##############################<u></u>##############################<u></u>#<br>
When I 'make', I get new error as blow:<br>
[root@Redhat mesh2vtu]# make<br>
c++ -O3 -I/usr/local/include/ -Wno-deprecated -c mesh2vtu.cxx -o mesh2vtu.o<br>
In file included from /usr/local/include/vtk/<u></u>vtkVariant.h:35,<br>
                from /usr/local/include/vtk/<u></u>vtkAbstractArray.h:45,<br>
                from /usr/local/include/vtk/<u></u>vtkDataArray.h:37,<br>
                from /usr/local/include/vtk/<u></u>vtkFloatArray.h:29,<br>
                from mesh2vtu.cxx:39:<br>
/usr/local/include/vtk/<u></u>vtkStdString.h:25:54: error: vtkstd/string: No such file or directory<br>
In file included from /usr/local/include/vtk/<u></u>vtkVariant.h:36,<br>
                from /usr/local/include/vtk/<u></u>vtkAbstractArray.h:45,<br>
                from /usr/local/include/vtk/<u></u>vtkDataArray.h:37,<br>
                from /usr/local/include/vtk/<u></u>vtkFloatArray.h:29,<br>
                from mesh2vtu.cxx:39:<br>
/usr/local/include/vtk/<u></u>vtkUnicodeString.h:47:31: error: vtkSystemIncludes.h: No such file or directory<br>
/usr/local/include/vtk/<u></u>vtkUnicodeString.h:49:25: error: vtkstd/vector: No such file or directory<br>
/usr/local/include/vtk/<u></u>vtkUnicodeString.h:156: error: invalid use of ‘::’<br>
/usr/local/include/vtk/<u></u>vtkUnicodeString.h:156: error: expected ‘;’ before ‘<’ token<br>
/usr/local/include/vtk/<u></u>vtkUnicodeString.h:160: error: ‘std::vector’ has not been declared<br>
/usr/local/include/vtk/<u></u>vtkUnicodeString.h:160: error: expected ‘,’ or ‘...’ before ‘<’ token<br>
make: *** [mesh2vtu.o] Error 1<br>
<br>
 All of *.h file is in /usr/local/include/vtk/.<br>
 What should I do for this?<br>
------------------------------<u></u>---------------<br>
fang zhao<br>
<br>
<br>
</blockquote>
<br>
<br>_______________________________________________<br>
CIG-SEISMO mailing list<br>
<a href="mailto:CIG-SEISMO@geodynamics.org" target="_blank">CIG-SEISMO@geodynamics.org</a><br>
<a href="http://geodynamics.org/cgi-bin/mailman/listinfo/cig-seismo" target="_blank">http://geodynamics.org/cgi-bin/mailman/listinfo/cig-seismo</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>---------------------------------------------<div>

Steven Hu</div><div><br></div>
</div>