-
Notifications
You must be signed in to change notification settings - Fork 12
Compiling VisIt Plugin
Before starting
- Make sure that the vlsv library is compiled
- Locate xmledit and xml2cmake:
xmledit and xml2cmake should be in
/PATH-TO-VISIT/bin/xmledit
/PATH-TO-VISIT/bin/xml2cmake
Locate vlsv plugin folder:
/PATH-TO-VLSV/vlsv_lib/visit-plugin/
VisIt handles it's compilation environment. Open the vlsv.xml file with xmledit and set include and library paths point to vlsv directory. If you want to use the plugin in parallel, you need to compile VisIt from source on your own computer so that VisIt and plugin use same MPI compiler.
Note: VTK API changed somewhere between VisIt 2.6.x and 2.7.1 versions which caused couple minor changes in plugin code. Plugin is now by default set to use the new API-- if you need to compile the plugin for older versions of VisIt, simply remove the "-DNEW_VTK_API" define from CXXFLAGS.
> xmledit vlsv.xml
Open tab CMake and set correct include and library paths to CXXFLAGS, LDFLAGS and LIBS fields. Here's an example:
VisIt comes with several programs that are meant to aid the writing and compilation of user-defined plugins. Information needed to autogenerate Makefiles is in vlsv.xml file, which must be processes with xml2cmake and CMake before compiling with Make:
> xml2cmake vlsv.xml
> cmake .
> make
Note that you may need to manually open CMakeList.txt file and edit the required CMake version number on line 2
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
to correspond to the version installed on your system. NOTE: if you get bunch of error messages during this step, try installing an older cmake.
Separate plugin libraries are generated for serial and parallel database engines. VisIt seems to use pure MPI parallelization (unconfirmed). In practice the same source code file(s) can be used for both, but MPI includes and function calls must be guarded by PARALLEL preprocessor macros:
#ifdef PARALLEL
#include <mpi.h>
#endif
Makefile is autogenerated by cmake. When plugin code is compiled with make, only the parallel plugin version uses mpic++ with -DPARALLEL compiler flag, serial plugin is compiled with g++. In other words, compiler error(s) will be generated if MPI code is not inside PARALLEL preprocessor macros.
Basically any MPI process can request any domain in the mesh.