%bcond_without openmpi %bcond_without mpich %global ospray_cmake_options \\\ -DOSPRAY_ZIP_MODE=OFF \\\ -DOSPRAY_ENABLE_MODULES=ON \\\ -DOSPRAY_ENABLE_APPS_BENCHMARK=OFF \\\ -DOSPRAY_ENABLE_APPS_EXAMPLES=OFF \\\ -DOSPRAY_ENABLE_APPS_TESTING=ON \\\ -DOSPRAY_ENABLE_APPS_TUTORIALS=OFF \\\ -DOSPRAY_ENABLE_VOLUMES=ON \\\ %ifarch x86_64 \ -DOSPRAY_MODULE_DENOISER=ON \\\ %else \ -DOSPRAY_MODULE_DENOISER=OFF \\\ %endif \ Name: ospray Version: 3.2.0 Release: %autorelease Summary: Ray tracing based rendering engine for high-fidelity visualization License: Apache-2.0 URL: https://www.ospray.org Source: https://github.com/RenderKit/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz Patch0: ospray-test.patch BuildRequires: cmake >= 3.1 BuildRequires: cmake(embree) BuildRequires: cmake(openvkl) BuildRequires: cmake(ispcrt) %ifarch x86_64 BuildRequires: cmake(OpenImageDenoise) %endif BuildRequires: cmake(rkcommon) BuildRequires: cmake(Snappy) BuildRequires: cmake(tbb) BuildRequires: gcc-c++ BuildRequires: glfw-devel BuildRequires: gtest-devel BuildRequires: libglvnd-devel BuildRequires: stb_image-devel BuildRequires: stb_image_write-devel # Upstream supports only aarch64 and x86_64 CPU Architectures ExcludeArch: i686 ppc64le s390x %description Intel OSPRay is an open source, scalable, and portable ray tracing engine for high-performance, high-fidelity visualization on Intel CPUs, Intel Xe GPUs, and Aarch64/ARM64 CPUs. The purpose of OSPRay is to provide an open, powerful, and easy-to-use rendering library that allows one to easily build applications that use ray tracing based rendering for interactive applications (including both surface- and volume-based visualizations). OSPRay runs on anything from laptops, to workstations, to compute nodes in HPC systems. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for applications that use %{name}. %if %{with openmpi} %package openmpi Summary: %{name} OpenMPI BuildRequires: chrpath BuildRequires: openmpi-devel Requires: openmpi%{?_isa} %description openmpi %{name} OpenMPI version. %package openmpi-devel Summary: The OpenMPI %{name} headers and development-related files Requires: %{name}-openmpi%{?_isa} = %{version}-%{release} Requires: openmpi-devel%{?_isa} %description openmpi-devel The %{name}-openmpi-devel package contains libraries and header files for applications that use %{name} OpenMPI. %endif %if %{with mpich} %package mpich Summary: %{name} MPICH BuildRequires: chrpath BuildRequires: mpich-devel Requires: mpich%{?_isa} %description mpich %{name} MPICH version. %package mpich-devel Summary: The MPICH %{name} headers and development-related files Requires: %{name}-mpich%{?_isa} = %{version}-%{release} Requires: mpich-devel%{?_isa} %description mpich-devel The %{name}-mpich-devel package contains libraries and header files for applications that use %{name} MPICH. %endif %prep %setup -qc patch -p1 -d %{name}-%{version} < %{PATCH0} # rkcommon version fix sed -i 's/1.14.0/1.14.2/g' %{name}-%{version}/cmake/ospray_options.cmake %if %{with openmpi} cp -a %{name}-%{version} %{name}-%{version}-openmpi %endif %if %{with mpich} cp -a %{name}-%{version} %{name}-%{version}-mpich %endif %build pushd %{name}-%{version} %cmake %{ospray_cmake_options} %cmake_build popd %if %{with openmpi} pushd %{name}-%{version}-openmpi %{_openmpi_load} %cmake \ %{ospray_cmake_options} -DCMAKE_C_COMPILER=mpicc \ -DCMAKE_CXX_COMPILER=mpicxx \ -DCMAKE_INSTALL_BINDIR=${MPI_BIN} \ -DCMAKE_INSTALL_LIBDIR=${MPI_LIB} \ -DCMAKE_INSTALL_INCLUDEDIR=${MPI_INCLUDE} \ -DOSPRAY_MODULE_MPI=ON %cmake_build %{_openmpi_unload} popd %endif %if %{with mpich} pushd %{name}-%{version}-mpich %{_mpich_load} %cmake \ %{ospray_cmake_options} -DCMAKE_C_COMPILER=mpicc \ -DCMAKE_CXX_COMPILER=mpicxx \ -DCMAKE_INSTALL_BINDIR=${MPI_BIN} \ -DCMAKE_INSTALL_LIBDIR=${MPI_LIB} \ -DCMAKE_INSTALL_INCLUDEDIR=${MPI_INCLUDE} \ -DOSPRAY_MODULE_MPI=ON %cmake_build %{_mpich_unload} popd %endif %install pushd %{name}-%{version} %cmake_install popd %if %{with openmpi} pushd %{name}-%{version}-openmpi %{_openmpi_load} %cmake_install %{_openmpi_unload} popd %endif %if %{with mpich} pushd %{name}-%{version}-mpich %{_mpich_load} %cmake_install %{_mpich_unload} popd %endif # Remove docs and test-suite files rm -f %{buildroot}%{_docdir}/OSPRay-%{version}/* rm -f %{buildroot}%{_bindir}/osp* %if %{with openmpi} rm -f %{buildroot}%{_libdir}/openmpi/lib/lib%{name}_testing.so.3.2.0 rm -f %{buildroot}%{_libdir}/openmpi/lib/lib%{name}_testing.so.3 rm -f %{buildroot}%{_libdir}/openmpi/bin/ospMPIDistribTestSuite rm -f %{buildroot}%{_libdir}/openmpi/bin/ospTestSuite rm -f %{buildroot}%{_libdir}/openmpi/bin/ospConvertRawToAMR %endif %if %{with mpich} rm -f %{buildroot}%{_libdir}/mpich/lib/lib%{name}_testing.so.3.2.0 rm -f %{buildroot}%{_libdir}/mpich/lib/lib%{name}_testing.so.3 rm -f %{buildroot}%{_libdir}/mpich/bin/ospMPIDistribTestSuite rm -f %{buildroot}%{_libdir}/mpich/bin/ospTestSuite rm -f %{buildroot}%{_libdir}/mpich/bin/ospConvertRawToAMR %endif %if %{with openmpi} # Remove rpath chrpath --delete %{buildroot}%{_libdir}/openmpi/bin/ospray_mpi_worker chrpath --delete %{buildroot}%{_libdir}/openmpi/lib/lib%{name}.so.%{version} chrpath --delete %{buildroot}%{_libdir}/openmpi/lib/lib%{name}_module_cpu.so.%{version} %ifarch x86_64 chrpath --delete %{buildroot}%{_libdir}/openmpi/lib/lib%{name}_module_denoiser.so.%{version} %endif chrpath --delete %{buildroot}%{_libdir}/openmpi/lib/lib%{name}_mpi_common.so.%{version} chrpath --delete %{buildroot}%{_libdir}/openmpi/lib/lib%{name}_module_mpi_offload.so.%{version} chrpath --delete %{buildroot}%{_libdir}/openmpi/lib/lib%{name}_module_mpi_distributed_cpu.so.%{version} %endif %if %{with mpich} # Remove rpath chrpath --delete %{buildroot}%{_libdir}/mpich/bin/ospray_mpi_worker chrpath --delete %{buildroot}%{_libdir}/mpich/lib/lib%{name}.so.%{version} chrpath --delete %{buildroot}%{_libdir}/mpich/lib/lib%{name}_module_cpu.so.%{version} %ifarch x86_64 chrpath --delete %{buildroot}%{_libdir}/mpich/lib/lib%{name}_module_denoiser.so.%{version} %endif chrpath --delete %{buildroot}%{_libdir}/mpich/lib/lib%{name}_mpi_common.so.%{version} chrpath --delete %{buildroot}%{_libdir}/mpich/lib/lib%{name}_module_mpi_offload.so.%{version} chrpath --delete %{buildroot}%{_libdir}/mpich/lib/lib%{name}_module_mpi_distributed_cpu.so.%{version} %endif %check pushd %{name}-%{version} mkdir redhat-linux-build/regression_test_baseline ./redhat-linux-build/ospTestSuite --dump-img --baseline-dir=redhat-linux-build/regression_test_baseline popd %if %{with openmpi} pushd %{name}-%{version}-openmpi %{_openmpi_load} mkdir redhat-linux-build/regression_test_baseline mpiexec -np 3 ./redhat-linux-build/ospMPIDistribTestSuite --dump-img --baseline-dir=redhat-linux-build/regression_test_baseline %{_openmpi_unload} popd %endif %if %{with mpich} pushd %{name}-%{version}-mpich %{_mpich_load} mkdir redhat-linux-build/regression_test_baseline mpiexec -np 3 ./redhat-linux-build/ospMPIDistribTestSuite --dump-img --baseline-dir=redhat-linux-build/regression_test_baseline %{_mpich_unload} popd %endif %files %license %{name}-%{version}/LICENSE.txt %{name}-%{version}/third-party-programs*.txt %doc %{name}-%{version}/CHANGELOG.md %{name}-%{version}/README.md %{_libdir}/lib%{name}.so.3 %{_libdir}/lib%{name}.so.%{version} %{_libdir}/lib%{name}_module_cpu.so.3 %{_libdir}/lib%{name}_module_cpu.so.%{version} %{_libdir}/lib%{name}_testing.so.3 %{_libdir}/lib%{name}_testing.so.%{version} %ifarch x86_64 %{_libdir}/lib%{name}_module_denoiser.so.3 %{_libdir}/lib%{name}_module_denoiser.so.%{version} %endif %files devel %{_includedir}/%{name} %{_libdir}/lib%{name}.so %{_libdir}/cmake/%{name}-%{version} # MPI versions %if %{with openmpi} %files openmpi %license %{name}-%{version}/LICENSE.txt %{name}-%{version}/third-party-programs*.txt %doc %{name}-%{version}/CHANGELOG.md %{name}-%{version}/README.md %{_libdir}/openmpi/bin/%{name}_mpi_worker %{_libdir}/openmpi/lib/lib%{name}.so.3 %{_libdir}/openmpi/lib/lib%{name}.so.%{version} %{_libdir}/openmpi/lib/lib%{name}_mpi_common.so.3 %{_libdir}/openmpi/lib/lib%{name}_mpi_common.so.%{version} %{_libdir}/openmpi/lib/lib%{name}_module_cpu.so.3 %{_libdir}/openmpi/lib/lib%{name}_module_cpu.so.%{version} %ifarch x86_64 %{_libdir}/openmpi/lib/lib%{name}_module_denoiser.so.3 %{_libdir}/openmpi/lib/lib%{name}_module_denoiser.so.%{version} %endif %{_libdir}/openmpi/lib/lib%{name}_module_mpi_distributed_cpu.so.3 %{_libdir}/openmpi/lib/lib%{name}_module_mpi_distributed_cpu.so.%{version} %{_libdir}/openmpi/lib/lib%{name}_module_mpi_offload.so.3 %{_libdir}/openmpi/lib/lib%{name}_module_mpi_offload.so.%{version} %files openmpi-devel %{_includedir}/openmpi-%{_arch}/%{name}/ %{_libdir}/openmpi/lib/lib%{name}.so %{_libdir}/openmpi/lib/cmake/%{name}-%{version} %endif %if %{with mpich} %files mpich %license %{name}-%{version}/LICENSE.txt %{name}-%{version}/third-party-programs*.txt %doc %{name}-%{version}/CHANGELOG.md %{name}-%{version}/README.md %{_libdir}/mpich/bin/%{name}_mpi_worker %{_libdir}/mpich/lib/lib%{name}.so.3 %{_libdir}/mpich/lib/lib%{name}.so.%{version} %{_libdir}/mpich/lib/lib%{name}_mpi_common.so.3 %{_libdir}/mpich/lib/lib%{name}_mpi_common.so.%{version} %{_libdir}/mpich/lib/lib%{name}_module_cpu.so.3 %{_libdir}/mpich/lib/lib%{name}_module_cpu.so.%{version} %ifarch x86_64 %{_libdir}/mpich/lib/lib%{name}_module_denoiser.so.3 %{_libdir}/mpich/lib/lib%{name}_module_denoiser.so.%{version} %endif %{_libdir}/mpich/lib/lib%{name}_module_mpi_distributed_cpu.so.3 %{_libdir}/mpich/lib/lib%{name}_module_mpi_distributed_cpu.so.%{version} %{_libdir}/mpich/lib/lib%{name}_module_mpi_offload.so.3 %{_libdir}/mpich/lib/lib%{name}_module_mpi_offload.so.%{version} %files mpich-devel %{_includedir}/mpich-%{_arch}/%{name}/ %{_libdir}/mpich/lib/lib%{name}.so %{_libdir}/mpich/lib/cmake/%{name}-%{version} %endif %changelog %autochangelog