Commit 21b397d5 authored by Chris Harris's avatar Chris Harris
Browse files

Move vtkVPICReader into vtkIOVPIC module

The third party module vtkVPIC can be build with or without
MPI. Rather than building a MPI and non MPI version we still
need the ability to switch between the two implementations. This
can use done by move the reader into a separate module and
providing VTK_VPIC_USE_MPI. This break with rule of not having
a module change it behaviour based on compile options but unless
the third party library is refactored we will have to live with this.

Change-Id: Ia949e1860272ad5ddb7b9b4cb9eb8d88305a5783
parent 209167af
......@@ -11,7 +11,6 @@ set(Module_SRCS
vtkPNrrdReader.cxx
vtkPOpenFOAMReader.cxx
vtkPSLACReader.cxx
vtkVPICReader.cxx
vtkWindBladeReader.cxx
vtkXMLPHierarchicalBoxDataWriter.cxx
vtkXMLPMultiBlockDataWriter.cxx
......
......@@ -7,7 +7,6 @@ vtk_module(vtkIOParallel
vtkIOParallelMPI
vtkIONetCDF
vtkexodusII
vtkVPIC
TEST_DEPENDS
vtkTestingCore
)
if(VTK_VPIC_USE_MPI)
find_package(MPI REQUIRED)
include_directories(${MPI_INCLUDE_PATH})
endif()
set(Module_SRCS
vtkVPICReader.cxx
)
vtk_module_library(vtkIOVPIC ${Module_SRCS})
vtk_module(vtkIOVPIC
DEPENDS
vtkVPIC
vtkCommonExecutionModel
vtkParallelCore
)
......@@ -20,21 +20,27 @@ SET(VPIC_SOURCES
GridExchange.cxx
)
IF(VTK_USE_MPI)
# Build with or without MPI, for now do this rather compiling a
# parallel and non parallel version
option(VTK_VPIC_USE_MPI "Build VPIC with MPI" OFF)
mark_as_advanced(VTK_VPIC_USE_MPI)
if(VTK_VPIC_USE_MPI)
find_package(MPI REQUIRED)
INCLUDE_DIRECTORIES(${MPI_INCLUDE_PATH})
ADD_DEFINITIONS("-DUSE_PARALLEL_VPIC -DMPICH_IGNORE_CXX_SEEK")
ENDIF(VTK_USE_MPI)
endif()
INCLUDE_DIRECTORIES (${VPIC_SOURCE_DIR} ${VPIC_BINARY_DIR})
VTK_ADD_LIBRARY(VPIC ${VPIC_SOURCES})
TARGET_LINK_LIBRARIES(VPIC vtksys )
IF(VTK_USE_MPI)
if(VTK_VPIC_USE_MPI)
TARGET_LINK_LIBRARIES(VPIC ${MPI_LIBRARY})
IF(MPI_EXTRA_LIBRARY)
TARGET_LINK_LIBRARIES(VPIC ${MPI_EXTRA_LIBRARY})
ENDIF(MPI_EXTRA_LIBRARY)
ENDIF(VTK_USE_MPI)
endif()
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
INSTALL(FILES
......
......@@ -43,7 +43,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#ifdef USE_PARALLEL_VPIC
#include <vtkMPI.h>
#include <mpi.h>
#endif
#include "GridExchange.h"
......
vtk_module(vtkVPIC
DEPENDS
vtkCommonCore
vtkParallelMPI
vtksys
EXCLUDE_FROM_WRAPPING
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment