# Disable LTO # undefined-non-weak-symbol libospray_module_mpi* %undefine _ld_as_needed %global _lto_cflags %{nil} %global with_openmpi 1 Name: ospray Version: 2.11.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/%{name}/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz BuildRequires: cmake >= 3.1 BuildRequires: cmake(embree) BuildRequires: cmake(openvkl) BuildRequires: cmake(ispcrt) BuildRequires: cmake(benchmark) BuildRequires: cmake(GTest) BuildRequires: cmake(rkcommon) BuildRequires: cmake(Snappy) BuildRequires: cmake(tbb) BuildRequires: gcc-c++ BuildRequires: ispc-static # Ospray supports ony ExclusiveArch: aarch64 x86_64 %description Intel OSPRay is an open source, scalable, and portable ray tracing engine for high-performance, high-fidelity visualization on Intel Architecture CPUs. OSPRay internally builds on top of Intel Embree and Intel ISPC (Implicit SPMD Program Compiler), and fully exploits modern instruction sets like Intel SSE4, AVX, AVX2, AVX-512 and NEON to achieve high rendering performance, thus a CPU with support for at least SSE4.1 is required to run OSPRay on x86_64 or a CPU with support for NEON is required to run OSPRay on ARM64 architectures. %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 0%{?with_openmpi} %package openmpi Summary: %{name} openmpi package 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} Provides: %{name}-openmpi-static = %{version}-%{release} %description openmpi-devel The %{name}-openmpi-devel package contains libraries and header files for applications that use %{name} OpenMPI. %endif %prep %autosetup %global ospray_cmake_options \\\ -DCMAKE_CXX_FLAGS="%{optflags} -Wl,--as-needed" \\\ -DOSPRAY_ZIP_MODE=OFF \\\ -DOSPRAY_ENABLE_APPS_BENCHMARK=OFF \\\ -DOSPRAY_ENABLE_APPS_EXAMPLES=OFF \\\ -DOSPRAY_ENABLE_APPS_TESTING=OFF \\\ -DOSPRAY_ENABLE_APPS_TUTORIALS=OFF \\\ -DOSPRAY_ENABLE_VOLUMES=ON \\\ -DOSPRAY_ENABLE_MODULES=ON \\\ -DOSPRAY_MODULE_CPU=ON \\\ -DOSPRAY_MODULE_DENOISER=OFF \\\ %build mkdir %{_target_platform} pushd %{_target_platform} %cmake .. \ %ifarch x86_64 -DOSPRAY_BUILD_ISA_SSE4=ON \ -DOSPRAY_BUILD_ISA_AVX=ON \ -DOSPRAY_BUILD_ISA_AVX2=ON \ %else -DOSPRAY_BUILD_ISA_NEON=ON \ %endif %{ospray_cmake_options} %cmake_build popd %if 0%{?with_openmpi} mkdir %{_target_platform}-openmpi pushd %{_target_platform}-openmpi %{_openmpi_load} # MPI vars export CC=mpicc export CXX=mpicxx %cmake .. \ -DOSPRAY_MODULE_MPI=ON \ -DCMAKE_INSTALL_BINDIR=${MPI_BIN} \ -DCMAKE_INSTALL_LIBDIR=${MPI_LIB} \ -DCMAKE_INSTALL_INCLUDEDIR=${MPI_INCLUDE} \ %{ospray_cmake_options} %cmake_build %{_openmpi_unload} popd %endif %install %if 0%{?with_openmpi} pushd %{_target_platform}-openmpi %{_openmpi_load} %cmake_install %{_openmpi_unload} popd %endif pushd %{_target_platform} %cmake_install popd # Remove docs rm %{buildroot}%{_docdir}/OSPRay-%{version}/* %if 0%{?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} 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 %check pushd %{_target_platform} %ctest popd %files %license LICENSE.txt third-party-programs*.txt %doc CHANGELOG.md README.md %{_libdir}/lib%{name}.so.2 %{_libdir}/lib%{name}.so.%{version} %{_libdir}/lib%{name}_module_cpu.so.2 %{_libdir}/lib%{name}_module_cpu.so.%{version} %files devel %{_includedir}/%{name} %{_libdir}/lib%{name}.so %{_libdir}/lib%{name}_module_cpu.so %{_libdir}/cmake/%{name}-%{version} # MPI versions %if 0%{?with_openmpi} %files openmpi %license LICENSE.txt third-party-programs*.txt %doc CHANGELOG.md README.md %{_libdir}/openmpi/bin/%{name}_mpi_worker %{_libdir}/openmpi/lib/lib%{name}.so.2 %{_libdir}/openmpi/lib/lib%{name}.so.%{version} %{_libdir}/openmpi/lib/lib%{name}_mpi_common.so.2 %{_libdir}/openmpi/lib/lib%{name}_mpi_common.so.%{version} %{_libdir}/openmpi/lib/lib%{name}_module_cpu.so.2 %{_libdir}/openmpi/lib/lib%{name}_module_cpu.so.%{version} %{_libdir}/openmpi/lib/lib%{name}_module_mpi_distributed_cpu.so.2 %{_libdir}/openmpi/lib/lib%{name}_module_mpi_distributed_cpu.so.%{version} %{_libdir}/openmpi/lib/lib%{name}_module_mpi_offload.so.2 %{_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/lib%{name}_mpi_common.so %{_libdir}/openmpi/lib/lib%{name}_module_cpu.so %{_libdir}/openmpi/lib/lib%{name}_module_mpi_distributed_cpu.so %{_libdir}/openmpi/lib/lib%{name}_module_mpi_offload.so %{_libdir}/openmpi/lib/cmake/%{name}-%{version} %endif %changelog %autochangelog