Commit 518b408d authored by Utkarsh Ayachit's avatar Utkarsh Ayachit
Browse files

cmake: fix Fortran

When building ParaView binaries on system with Fortran compiler present
and ADIOS enabled, ParaView failed to find ADIOS correctly. The issue
was that though superbuild had disabled Fortran (hence MPI was built
without Fortran) ADIOS tried to find MPI's Fortran components and hence
failed.

In general, since we have an option in superbuild to enable/disable
fortran support, it seems reasonable to have the option affect how
ParaView enables/disables its Fortran components.
parent 3934b92d
......@@ -88,6 +88,21 @@ option(PARAVIEW_USE_MPI "Enable MPI support for parallel computing" OFF)
option(PARAVIEW_USE_CUDA "Support CUDA compilation" OFF)
option(PARAVIEW_USE_VTKM "Enable VTK-m accelerated algorithms" "${PARAVIEW_ENABLE_NONESSENTIAL}")
# Add option to disable Fortran
if (NOT WIN32)
include(CheckFortran)
check_fortran_support()
if (CMAKE_Fortran_COMPILER)
set(_has_fortran TRUE)
else()
set(_has_fortran FALSE)
endif()
cmake_dependent_option(PARAVIEW_USE_FORTRAN "Enable Fortran support" ON
"_has_fortran" OFF)
mark_as_advanced(PARAVIEW_USE_FORTRAN)
unset(_has_fortran)
endif()
vtk_deprecated_setting(python_default PARAVIEW_USE_PYTHON PARAVIEW_ENABLE_PYTHON OFF)
option(PARAVIEW_USE_PYTHON "Enable/Disable Python scripting support" "${python_default}")
......
......@@ -200,18 +200,8 @@ if (PARAVIEW_ENABLE_MOMENTINVARIANTS)
set(use_vtk_remote_modules ON)
endif ()
# For Catalyst, Fortran is optionally needed. Hence we enable
# Fortran at the top level itself. When individual module called
# enable_language(...), it failed during first cmake configure but worked o
# subsequent. enable_language(... OPTIONAL) overcomes that issue altogether.
if (NOT WIN32)
# Theoretically, CheckFortran should not be needed, but it
# enable_language(OPTIONAL) fails with Ninja generator.
include(CheckFortran)
check_fortran_support()
if (CMAKE_Fortran_COMPILER)
enable_language(Fortran OPTIONAL)
endif ()
if (PARAVIEW_USE_FORTRAN)
enable_language(Fortran OPTIONAL)
endif ()
if (PARAVIEW_USE_EXTERNAL_VTK)
......
......@@ -335,6 +335,8 @@ These settings control capabitities of the build. These begin with the prefix
Less common, but potentially useful variables are:
* `PARAVIEW_USE_VTKM` (default `ON`): Whether VTK-m based filters are enabled.
* `PARAVIEW_USE_FORTRAN` (default `ON` if Fortran compiler found): Enable
Fortran support for Catalyst libraries.
#### Feature settings
......
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