[CIG-SEISMO] Post-Processing mesh2vtu can not make

Peter Danecek Peter.Danecek at bo.ingv.it
Thu Dec 6 02:06:08 PST 2012


Hi,

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.

When you are done with the VTK installations, check where it was put.  
My first guess would be something  like /usr/local/... (<prefix>)

There you should find something the following ...
NOTE: The version can be different, mesh2vtu will work also with other  
5.x versions.

<prefix>/include/vtk-5.10		
  .. this is the path to put with -I flag (include) during compilation
  Here you should find quite some header files ( *.h), on my  
installation there are nearly 2000
<prefix>/lib/vtk-5.10		
  .. this is the path to put with -L flag (library) during linking
  Here you file the libraries (the extension depends on the platform,  
*.a or *.so are common)

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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mesh2vtu.petr.2012-12-06.tar
Type: application/x-tar
Size: 20480 bytes
Desc: not available
Url : http://geodynamics.org/pipermail/cig-seismo/attachments/20121206/ffef14f1/attachment-0001.tar 
-------------- next part --------------



--- snip ---
[urquell:Utils/VTK-util/mesh2vtu.petr.2012-12-06] petr% make
g++ -c -O2 -Wno-deprecated -I/opt/local/include/vtk-5.10 -o mesh2vtu.o  
mesh2vtu.cxx
g++  mesh2vtu.o -o mesh2vtu -L/opt/local/lib/vtk-5.10  -lvtkCommon - 
lvtkIO  -lvtkFiltering  -lvtkRendering -lvtkGraphics
rm mesh2vtu.o
[urquell:Utils/VTK-util/mesh2vtu.petr.2012-12-06] petr% ls -la
total 40
drwxr-xr-x   5 petr  petr    170  6 Dec 10:37 .
drwxr-xr-x  22 petr  petr    748  6 Dec 10:35 ..
-rw-r--r--   1 petr  petr   1191  6 Dec 10:33 Makefile
-rwxr-xr-x   1 petr  petr  18136  6 Dec 10:37 mesh2vtu
-rw-r--r--   1 petr  petr  13321 29 Oct 16:30 mesh2vtu.cxx
--- snap ---

Good luck!
~petr





On 6 Dec 2012, at 03:16, ?? wrote:

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1762 bytes
Desc: not available
Url : http://geodynamics.org/pipermail/cig-seismo/attachments/20121206/ffef14f1/attachment-0001.bin 


More information about the CIG-SEISMO mailing list