%global forgeurl https://github.com/dreamworksanimation %global cmodver 1.0.0.5 # CUDA/Optix Support %bcond gpu 0 %bcond tests 1 # Core Dump Fix %global optflags %(echo '%optflags' | sed s/-Wp,-D_GLIBCXX_ASSERTIONS//) Name: mcrt_denoise Version: 5.22.0.0 Release: %{autorelease} Summary: MoonRay’s Denoiser License: Apache-2.0 URL: https://openmoonray.org/ Source0: %{forgeurl}/%{name}/archive/refs/tags/%{name}-%{version}.tar.gz Source1: %{forgeurl}/cmake_modules/archive/refs/tags/cmake_modules-%{cmodver}.tar.gz %if %{with gpu} Patch0: %{name}-optix.patch %endif BuildRequires: cmake >= 3.23.1 BuildRequires: gcc-c++ %if %{with gpu} BuildRequires: nvidia-sdk-optix >= 8.0.0 BuildRequires: cuda-nvcc %endif Requires: cmake(OpenImageDenoise) Requires: oidn Requires: SceneRdl2 = 14.22.0.0 Provides: McrtDenoise = %{version} %description OpenImageDenoise (OIDN) and OptiX de-noisers for moonray. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %if %{with gpu} Requires: nvidia-sdk-optix >= 8.0.0 %endif Requires: cmake(OpenImageDenoise) Requires: cmake(SceneRdl2) = 14.22.0.0 %description devel The %{name}-devel package contains libraries and header files of %{name}, required to build other parts of OpenMoonRay. %prep %autosetup -p1 -n %{name}-%{name}-%{version} mkdir -p cmake_modules tar -xzf %{SOURCE1} --strip-components=1 -C $_ %build %if %{with gpu} export NVCC_PREPEND_FLAGS='-allow-unsupported-compiler' %endif CMAKE_MODULES_ROOT=%{_builddir}/%{buildsubdir}/cmake_modules \ ARRAS_SESSION_PATH=%{_libdir}/openmoonray/sessions \ %cmake \ -DCMAKE_MODULE_PATH=${CMAKE_MODULES_ROOT}/cmake \ -DBUILD_TESTING=%{expr:%{with tests}?"ON":"OFF"} \ %if %{with gpu} -DOptiX_INCLUDE_DIRS=/usr/include/optix \ -DCMAKE_CUDA_COMPILER=%{_bindir}/nvcc \ -DCMAKE_CUDA_FLAGS="-Xcompiler -fPIC" \ %endif -DMOONRAY_USE_OPTIX=%{expr:%{with gpu}?"ON":"OFF"} %cmake_build %install %cmake_install # Manually include Optix installation %if %{with gpu} sed -i '13a set(CMAKE_INCLUDE_PATH /usr/include/optix ${CMAKE_INCLUDE_PATH})' \ %{buildroot}%{_libdir}/cmake/*/McrtDenoiseConfig.cmake %endif %files %license LICENSE %{_libdir}/libdenoiser.so %files devel %{_includedir}/%{name} %{_libdir}/cmake/McrtDenoise-%(echo %{version} | sed 's/\(.*\)\.[0-9]*$/\1/').0 %changelog %autochangelog