Commit 4c40c9c8 authored by Mark Olesen's avatar Mark Olesen

COMP: allow catalystFoam without ParaView MPI support

- ParaView Catalyst with MPI is advisable (especially for larger
  simulations), but not a requirement
parent 9b969cd4
...@@ -20,8 +20,8 @@ link_directories( ...@@ -20,8 +20,8 @@ link_directories(
) )
add_definitions( add_definitions(
-DWM_$ENV{WM_PRECISION_OPTION} -DNoRepository -DWM_$ENV{WM_PRECISION_OPTION} -DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE}
-DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE} -DNoRepository
) )
set(CMAKE_BUILD_TYPE Release) set(CMAKE_BUILD_TYPE Release)
...@@ -29,29 +29,27 @@ set(CMAKE_BUILD_TYPE Release) ...@@ -29,29 +29,27 @@ set(CMAKE_BUILD_TYPE Release)
set(CMAKE_CXX_FLAGS_DEBUG set(CMAKE_CXX_FLAGS_DEBUG
"-g -O0 -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -Wno-overloaded-virtual" "-g -O0 -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -Wno-overloaded-virtual"
) )
set(CMAKE_C_FLAGS_DEBUG "-g -O0 -std=c++11")
set(CMAKE_CXX_FLAGS_RELEASE set(CMAKE_CXX_FLAGS_RELEASE
"-O3 -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -Wno-overloaded-virtual") "-O3 -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -Wno-overloaded-virtual"
set(CMAKE_C_FLAGS_RELEASE "-O3 -std=c++11") )
# Some characteristics # Some characteristics
set(test_file ${CMAKE_CURRENT_BINARY_DIR}/check_initialize.cxx) set(test_file ${CMAKE_CURRENT_BINARY_DIR}/check_initialize.cxx)
file(WRITE ${test_file} file(WRITE ${test_file}
"#include <vtkCPProcessor.h>\n" "#include <vtkCPProcessor.h>\n"
"int main() {\n" "int main() {\n"
" vtkCPProcessor* p = vtkCPProcessor::New();\n" " vtkCPProcessor* p = vtkCPProcessor::New();\n"
" p->Initialize(\"AAA\");\n" " p->Initialize(\"AAA\");\n"
" p->Delete();\n" " p->Delete();\n"
" return 0;\n" " return 0;\n"
"}") "}"
)
try_compile(CATALYST_HAS_WORKING_DIRECTORY try_compile(CATALYST_HAS_WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR} ${test_file} ${CMAKE_CURRENT_BINARY_DIR} ${test_file}
LINK_LIBRARIES vtkPVPythonCatalyst CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${PARAVIEW_INCLUDE_DIRS}"
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${PARAVIEW_INCLUDE_DIRS}" )
)
if (CATALYST_HAS_WORKING_DIRECTORY) if (CATALYST_HAS_WORKING_DIRECTORY)
add_definitions(-DUSE_CATALYST_WORKING_DIRECTORY) add_definitions(-DUSE_CATALYST_WORKING_DIRECTORY)
endif() endif()
...@@ -94,6 +92,13 @@ set(OPENFOAM_LIBRARIES ...@@ -94,6 +92,13 @@ set(OPENFOAM_LIBRARIES
overset overset
) )
if (PARAVIEW_USE_MPI)
set(LINK_LIBRARIES vtkPVPythonCatalyst vtkParallelMPI)
else()
set(LINK_LIBRARIES vtkPVPythonCatalyst)
endif()
add_library( add_library(
catalystFoam catalystFoam
SHARED SHARED
...@@ -102,7 +107,7 @@ add_library( ...@@ -102,7 +107,7 @@ add_library(
target_link_libraries( target_link_libraries(
catalystFoam catalystFoam
vtkPVPythonCatalyst vtkParallelMPI ${LINK_LIBRARIES}
${OPENFOAM_LIBRARIES} ${OPENFOAM_LIBRARIES}
) )
......
...@@ -8,12 +8,12 @@ cmake_policy(SET CMP0002 OLD) ...@@ -8,12 +8,12 @@ cmake_policy(SET CMP0002 OLD)
if (EXISTS "$ENV{ParaView_DIR}") if (EXISTS "$ENV{ParaView_DIR}")
message("Building with Paraview from $ENV{ParaView_DIR}") message("Building with Paraview from $ENV{ParaView_DIR}")
find_package(ParaView REQUIRED COMPONENTS vtkPVPythonCatalyst) find_package(ParaView REQUIRED COMPONENTS vtkPVPythonCatalyst)
if(NOT PARAVIEW_USE_MPI) if (NOT PARAVIEW_USE_MPI)
message(SEND_ERROR "ParaView must be built with MPI enabled") message(WARNING "==== Recommended to build using ParaView Catalyst with MPI ====")
endif() endif()
else () else()
message (FATAL_ERROR "ParaView_DIR not set") message (FATAL_ERROR "ParaView_DIR not set")
endif () endif()
include(CMakeLists-Common.txt) include(CMakeLists-Common.txt)
......
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