opensubdiv: disable opencl when building cuda

This commit is contained in:
Someone Serge 2022-04-05 19:26:32 +03:00
parent 565201d769
commit c007910a44
No known key found for this signature in database
GPG key ID: A39079F4AE78D20D

View file

@ -1,6 +1,10 @@
{ config, lib, stdenv, fetchFromGitHub, cmake, pkg-config, xorg, libGLU
, libGL, glew, ocl-icd, python3
, cudaSupport ? config.cudaSupport or false, cudatoolkit
# For visibility mostly. The whole approach to cuda architectures and capabilities
# will be reworked soon.
, cudaArch ? "compute_37"
, openclSupport ? !cudaSupport
, darwin
}:
@ -24,7 +28,7 @@ stdenv.mkDerivation rec {
glew xorg.libX11 xorg.libXrandr xorg.libXxf86vm xorg.libXcursor
xorg.libXinerama xorg.libXi
]
++ lib.optional (!stdenv.isDarwin) ocl-icd
++ lib.optional (openclSupport && !stdenv.isDarwin) ocl-icd
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [OpenCL Cocoa CoreVideo IOKit AppKit AGL ])
++ lib.optional cudaSupport cudatoolkit;
@ -37,8 +41,10 @@ stdenv.mkDerivation rec {
"-DGLEW_INCLUDE_DIR=${glew.dev}/include"
"-DGLEW_LIBRARY=${glew.dev}/lib"
] ++ lib.optionals cudaSupport [
"-DOSD_CUDA_NVCC_FLAGS=--gpu-architecture=compute_30"
"-DOSD_CUDA_NVCC_FLAGS=--gpu-architecture=${cudaArch}"
"-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc"
] ++ lib.optionals (!openclSupport) [
"-DNO_OPENCL=1"
];
postInstall = "rm $out/lib/*.a";
@ -46,6 +52,7 @@ stdenv.mkDerivation rec {
meta = {
description = "An Open-Source subdivision surface library";
homepage = "http://graphics.pixar.com/opensubdiv";
broken = openclSupport && cudaSupport;
platforms = lib.platforms.unix;
maintainers = [ lib.maintainers.eelco ];
license = lib.licenses.asl20;