Change:
When you set , although it sets the CMAKE flag correctly the resulting package isn't actually built correctly as cmake can't find cuda so it unsets the flag. This is due to the incorrect usage of instead of when building the cuda related packages. The correct usage can be seen in the package. It also tries to build with CUDA by default which is wrong. Dlib hasn't supported fftw since however there are leftover references to it in cmake which might lead people to think it does support fftw. fftw should be removed. As mentioned in this it makes more sense to have as an input into rather that so that people can override it with other BLAS implementations e.g more easily if they want to. The package was also missing lapack which should be . Steps to reproduce the behavior: Build the package, it tries to build with CUDA by default. I made an example with a fairly simple nix flake that let's you switch between my patch and the original package. I have created a which fixes these issues. For it to build with CUDA. How CMAKE fails ! For this simple c switching from my fix to the original bugged package on 23.11 before openblas was . ! Please run and paste the result. Add a :+1: [reaction] to [issues you find important]. [reaction]: [issues you find important]: Thanks!

Discussion:
, fetchFromGitHub , cmake , pkg-config <del> , fftw </del> , libpng , libjpeg , libwebp <del> , openblas </del> <ins> , blas , lapack , config </ins> , guiSupport ? false , libX11 <del> # see http://dlib.net/compile.html </del> , sse4Support ? stdenv.hostPlatform.sse4_1Support , avxSupport ? stdenv.hostPlatform.avxSupport <del> , cudaSupport ? true }: stdenv.mkDerivation rec { </del> <ins> , cudaSupport ? config.cudaSupport , cudaPackages }@inputs: (if cudaSupport then cudaPackages.backendStdenv else inputs.stdenv).mkDerivation rec { </ins> pname = "dlib"; version = "19.24.2"; src = fetchFromGitHub { owner = "davisking"; repo = "dlib"; <del> rev ="v${version}"; </del> <ins> rev = "v${version}"; </ins> sha256 = "sha256-Z1fScuaIHjj2L1uqLIvsZ7ARKNjM+iaA8SAtWUTPFZk="; };

''; cmakeFlags = [ <del> (lib.cmakeBool "USE_DLIB_USE_CUDA" cudaSupport) </del> (lib.cmakeBool "USE_SSE4_INSTRUCTIONS" sse4Support) (lib.cmakeBool "USE_AVX_INSTRUCTIONS" avxSupport) <ins> (lib.cmakeBool "DLIB_USE_CUDA" cudaSupport) ] ++ lib.optionals cudaSupport [ (lib.cmakeFeature "DLIB_USE_CUDA_COMPUTE_CAPABILITIES" (builtins.concatStringsSep "," (with cudaPackages.flags; map dropDot cudaCapabilities))) </ins> ]; <del> nativeBuildInputs = [ cmake pkg-config ]; </del> <ins> nativeBuildInputs = [ cmake pkg-config ] ++ lib.optionals cudaSupport (with cudaPackages; [ cuda_nvcc ]); </ins> buildInputs = [ <del> fftw </del> libpng libjpeg libwebp <del> openblas ] ++ lib.optional guiSupport libX11; </del> <ins> blas lapack ] ++ lib.optionals guiSupport [ libX11 ] ++ lib.optionals config.cudaSupport (with cudaPackages; [ cuda_cudart.dev cuda_cudart.lib cuda_cudart.static cuda_nvcc.dev libcublas.dev libcublas.lib libcublas.static libcurand.dev libcurand.lib libcurand.static libcusolver.dev libcusolver.lib libcusolver.static cudnn.dev cudnn.lib cudnn.static cuda_cccl.dev ]); passthru = { inherit cudaSupport cudaPackages sse4Support avxSupport; }; </ins> meta = with lib; { description = "A general purpose cross-platform C++ machine learning library";

, fetchPypi , lib <del> # propagates </del> <ins> # propagates </ins> , click , dlib , face-recognition-models , numpy , pillow <del> # tests </del> <ins> # tests </ins> , pytestCheckHook <ins> , config , cudaSupport ? config.cudaSupport </ins> }: buildPythonPackage rec {

version = "1.3.0"; format = "setuptools"; <del> src = fetchPypi  { </del> <ins> src = fetchPypi { </ins> pname = "face_recognition"; inherit version; hash = "sha256-Xl790WhqpWavDTzBMTsTHksZdleo/9A2aebT+tknBew=";

pytestCheckHook ]; <ins> # Disables tests when running with cuda due to https://github.com/NixOS/nixpkgs/issues/225912 doCheck = !config.cudaSupport; </ins> meta = with lib; { license = licenses.mit; homepage = "https://github.com/ageitgey/face_recognition";