-
Notifications
You must be signed in to change notification settings - Fork 21
Installing VTK
VTK (Visualisation ToolKit) is a C++ class library that MOOSE needs to use modules of Image Processing. In Redback, we are using some of these functions to create meshes from CT scan images.
VTK is installed automatically when running the MOOSE Environment package in MOOSE getting started. VTK is then linked to MOOSE when compiling Libmesh with the right options.
If you need to install it manually (on a cluster for example), you should run the file that has been created following the instructions here. You will need to edit the file to fit the cluster's and the user's specifications.
Make sure to have -DVTK_Group_MPI:BOOL=ON, or else it won't work with Libmesh.
<first, copy VTK-8.0.0.tar.gz to $STACK_SRC>
cd $STACK_SRC
tar zxvf VTK-8.0.0.tar.gz
export CC=gcc
export CXX=g++
mkdir -p $STACK_SRC/VTK8-Builds
cd $STACK_SRC/VTK8-Builds
cmake ../VTK-8.0.0 \
-DCMAKE_INSTALL_PREFIX=$PACKAGES_DIR/vtk-8.0/gcc-opt \
-DCMAKE_BUILD_TYPE=Release \
-DVTK_Group_Rendering=OFF \
-DVTK_WRAP_PYTHON=ON \
-DVTK_Group_MPI:BOOL=ON \
-Wno-dev
make -j $MOOSE_JOBS
make -j16
make install
<assuming Moose is downloaded and up-to-date>
cd /short/ws55/jl1719/projects/moose/scripts
./update_and_rebuild_libmesh.sh --with-vtk-include=/short/ws55/jl1719/opt/moose/vtk-8.0/gcc-opt/include/vtk-8.0
--with-vtk-lib=/short/ws55/jl1719/opt/moose/vtk-8.0/gcc-opt/lib
For the automatic official compilation of VTK, follow the commands on this MOOSE page: http://mooseframework.org/wiki/PhysicsModules/PhaseField/ImageReader/
Instead of using variables that are not always pointing to the right folders that we need, you need to find the absolute path of the include and the lib folder of VTK. The paths should look like this:
- Include:
--with-vtk-include=/opt/moose/vtk-6.3/clang-opt/include/vtk-6.3
- Lib:
--with-vtk-lib=/opt/moose/vtk-6.3/clang-opt/lib
The paths are changing depending on your OS or your version of MOOSE.
To find them, try to open these folders and look where .h (for include) or .dylib (for lib) are located. Note that you might also need to use the VTK directories in /opt/moose/vtk-6.3/gcc-opt/
rather than /opt/moose/vtk-6.3/clang-opt/
.
Then you run the same scripts with the absolute paths instead of the variables. It should look like this:
cd ~/projects/moose/scripts
./update_and_rebuild_libmesh.sh --with-vtk-include=/opt/moose/vtk-6.3/clang-opt/include/vtk-6.3 --with-vtk-lib=/opt/moose/vtk-6.3/clang-opt/lib
Pick up to the steps after Libmesh compilation in MOOSE Getting Started.
When you run the tests, you will be able to see that some tests have been skipped.
You will easily notice on some either VTK!=false
or VTK!=true
.
The one that proves that VTK has been successfully installed is VTK!=false
.
- For unknown reasons, VTK is not running with more than 21 processors on LEONARDI CLUSTER.
REDBACK: Rock mEchanics with Dissipative feedBACKs