From e4f6f747fec10fac6922537043166e9c7f4dc3ff Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Jun 10 2021 00:35:26 +0000 Subject: Build with bundled cgnslib on EL8; BR cmake, use %cmake macro --- diff --git a/paraview.spec b/paraview.spec index de65806..e6c81d0 100644 --- a/paraview.spec +++ b/paraview.spec @@ -23,6 +23,18 @@ %global py2_prefix python2 %endif +# cgnslib is too old on EL8 +%if 0%{?el8} +%bcond_with cgnslib +%else +%bcond_without cgnslib +%endif +%if %{with cgnslib} +%global vtk_use_system_cgnslib -DVTK_MODULE_USE_EXTERNAL_ParaView_cgns:BOOL=ON +%else +%global vtk_use_system_cgnslib -DVTK_MODULE_USE_EXTERNAL_ParaView_cgns:BOOL=OFF +%endif + # VTK currently is carrying local modifications to gl2ps %bcond_with gl2ps %if !%{with gl2ps} @@ -85,7 +97,7 @@ Patch3: paraview-freetype.patch Patch4: %{name}-gcc11.patch -BuildRequires: cmake3 >= 3.12 +BuildRequires: cmake >= 3.12 BuildRequires: make BuildRequires: lz4-devel %if %{with qt5} @@ -117,7 +129,9 @@ BuildRequires: python2-netcdf4 BuildRequires: %{py2_prefix}-qt5 %endif %endif +%if %{with cgnslib} BuildRequires: cgnslib-devel +%endif BuildRequires: gdal-devel BuildRequires: hdf5-devel BuildRequires: tk-devel @@ -200,6 +214,10 @@ Provides: bundled(kwsys-regularexpression) Provides: bundled(kwsys-system) Provides: bundled(kwsys-systeminformation) Provides: bundled(kwsys-systemtools) +# Bundled cgnslib +%if !%{with cgnslib} +Provides: bundled(cgnslib) = 4.1 +%endif # Bundled jsoncpp %if !0%{system_jsoncpp} Provides: bundled(jsoncpp) = 0.7.0 @@ -263,6 +281,7 @@ Provides: bundled(xdmf2) %endif \ -DVTK_USE_OGGTHEORA_ENCODER:BOOL=ON \\\ -DPARAVIEW_BUILD_WITH_EXTERNAL:BOOL=ON \\\ + %{?vtk_use_system_cgnslib} \\\ %{?vtk_use_system_gl2ps} \\\ %{?vtk_use_system_jsoncpp} \\\ -DVTK_MODULE_USE_EXTERNAL_VTK_libharu=OFF \\\ @@ -491,7 +510,7 @@ rm -f Utilities/VisItBridge/databases/readers/Vs/VsStaggeredField.C # Install python properly sed -i -s '/VTK_INSTALL_PYTHON_USING_CMAKE/s/TRUE/FALSE/' CMakeLists.txt #Remove included thirdparty sources just to be sure -for x in vtkcgns %{?_with_protobuf:vtkprotobuf} +for x in %{?_with_cgnslib:vtkcgns} %{?_with_protobuf:vtkprotobuf} do rm -r ThirdParty/*/${x} done @@ -523,7 +542,7 @@ cp %SOURCE2 VTK/CMake/FindPEGTL.cmake %endif mkdir %{_target_platform} pushd %{_target_platform} -%cmake3 -Wno-dev .. \ +%cmake -Wno-dev .. \ -DCMAKE_INSTALL_CMAKEDIR:PATH=%{_lib}/cmake \ -DCMAKE_INSTALL_LIBDIR:PATH=%{_lib}/%{name} \ -DPARAVIEW_BUILD_DEVELOPER_DOCUMENTATION:BOOL=ON \ @@ -541,7 +560,7 @@ popd mkdir %{_target_platform}-openmpi pushd %{_target_platform}-openmpi %{_openmpi_load} -%cmake3 -Wno-dev .. \ +%cmake -Wno-dev .. \ %{paraview_cmake_mpi_options} %make_build %{_openmpi_unload} @@ -554,7 +573,7 @@ pushd %{_target_platform}-mpich # EL7 mpich module doesn't set PYTHONPATH # https://bugzilla.redhat.com/show_bug.cgi?id=1148992 [ -z "$PYTHONPATH" ] && export PYTHONPATH=$MPI_PYTHON_SITEARCH -%cmake3 -Wno-dev .. \ +%cmake -Wno-dev .. \ %{paraview_cmake_mpi_options} %make_build %{_mpich_unload}