Unverified Commit fffc69be authored by Connor Baker's avatar Connor Baker Committed by GitHub
Browse files

openimagedenoise: fix cuda cmake patch (#501114)

parents eb3575dc 72addac9
Loading
Loading
Loading
Loading
+17 −15
Original line number Diff line number Diff line
Remove upstream workarounds for CMake "limitations" that do not appear to exist
in nixpkgs build environment, but rather break the build, presumably because
CMAKE_INSTALL_{BIN,LIB}DIR is an absolute path in our build so
CMAKE_INSTALL_PREFIX has no effect.

diff --git a/devices/CMakeLists.txt b/devices/CMakeLists.txt
index d5111cd..43986ad 100644
index a0ea112..4d03b4f 100644
--- a/devices/CMakeLists.txt
+++ b/devices/CMakeLists.txt
@@ -53,7 +53,6 @@ if(OIDN_DEVICE_CUDA)
@@ -47,7 +47,6 @@ if(OIDN_DEVICE_CUDA)
     -DCMAKE_CXX_COMPILER:FILEPATH=${_host_compiler}
     -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${CMAKE_TOOLCHAIN_FILE}
     -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-    -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/cuda/preinstall
     -DCMAKE_INSTALL_BINDIR:PATH=${CMAKE_INSTALL_BINDIR}
     -DCMAKE_INSTALL_LIBDIR:PATH=${CMAKE_INSTALL_LIBDIR}
       -DCUDAToolkit_ROOT:PATH=${CUDAToolkit_ROOT}
@@ -69,14 +68,6 @@ if(OIDN_DEVICE_CUDA)
     -DOIDN_ROOT_BINARY_DIR:PATH=${OIDN_ROOT_BINARY_DIR}
@@ -78,14 +77,6 @@ if(OIDN_DEVICE_CUDA)
     DEPENDS
       OpenImageDenoise_core
   )
@@ -30,3 +25,10 @@ index d5111cd..43986ad 100644
 endif()
 
 if(OIDN_DEVICE_HIP)
@@ -186,4 +177,4 @@ endif()
 
 if(OIDN_DEVICE_METAL)
   add_subdirectory(metal)
-endif()
\ No newline at end of file
+endif()
+8 −4
Original line number Diff line number Diff line
@@ -19,10 +19,14 @@ stdenv.mkDerivation (finalAttrs: {
  # The release tarballs include pretrained weights, which would otherwise need to be fetched with git-lfs
  src = fetchzip {
    url = "https://github.com/RenderKit/oidn/releases/download/v${finalAttrs.version}/oidn-${finalAttrs.version}.src.tar.gz";
    sha256 = "sha256-SM0Bn4qgeqRJAXr2MMjNjfWJVTcciERZxMHiyx4Z1hA=";
    hash = "sha256-SM0Bn4qgeqRJAXr2MMjNjfWJVTcciERZxMHiyx4Z1hA=";
  };

  patches = lib.optional cudaSupport ./cuda.patch;
  strictDeps = true;

  patches = lib.optionals cudaSupport [
    ./cuda.patch
  ];

  postPatch = ''
    # fix build failure with GCC14
@@ -35,7 +39,7 @@ stdenv.mkDerivation (finalAttrs: {
    python3
    ispc
  ]
  ++ lib.optional cudaSupport cudaPackages.cuda_nvcc
  ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ]
  ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcodebuild ];

  buildInputs = [
@@ -49,7 +53,7 @@ stdenv.mkDerivation (finalAttrs: {

  cmakeFlags = [
    (lib.cmakeBool "OIDN_DEVICE_CUDA" cudaSupport)
    (lib.cmakeFeature "TBB_INCLUDE_DIR" "${onetbb.dev}/include")
    (lib.cmakeFeature "TBB_INCLUDE_DIR" "${lib.getDev onetbb}/include")
    (lib.cmakeFeature "TBB_ROOT" "${onetbb}")
  ];