Skip to content

Commit

Permalink
blender: Fix CUDA support
Browse files Browse the repository at this point in the history
CUDA toolkit 8 doesn't support gcc 6, so we have to build opensubdiv
and blender with gcc 5.
  • Loading branch information
edolstra committed Sep 16, 2017
1 parent bb1c9b0 commit afc0218
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 6 additions & 2 deletions pkgs/applications/misc/blender/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, boost, cmake, ffmpeg, gettext, glew
{ stdenv, stdenv_gcc5, lib, fetchurl, boost, cmake, ffmpeg, gettext, glew
, ilmbase, libXi, libX11, libXext, libXrender
, libjpeg, libpng, libsamplerate, libsndfile
, libtiff, mesa, openal, opencolorio, openexr, openimageio, openjpeg_1, python
Expand All @@ -10,7 +10,7 @@

with lib;

stdenv.mkDerivation rec {
(if cudaSupport then stdenv_gcc5 else stdenv).mkDerivation rec {
name = "blender-2.79";

src = fetchurl {
Expand Down Expand Up @@ -65,6 +65,10 @@ stdenv.mkDerivation rec {

NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR -I${python}/include/${python.libPrefix}m";

# Since some dependencies are built with gcc 6, we need gcc 6's
# libstdc++ in our RPATH. Sigh.
NIX_LDFLAGS = optionalString cudaSupport "-rpath ${stdenv.cc.cc.lib}/lib";

enableParallelBuilding = true;

meta = with stdenv.lib; {
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/libraries/opensubdiv/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{ lib, stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig, xorg, mesa_glu
{ lib, stdenv, stdenv_gcc5, fetchurl, fetchFromGitHub, cmake, pkgconfig, xorg, mesa_glu
, mesa_noglu, glew, ocl-icd, python3
, cudaSupport ? false, cudatoolkit
}:

stdenv.mkDerivation rec {
(if cudaSupport then stdenv_gcc5 else stdenv).mkDerivation rec {
name = "opensubdiv-${version}";
version = "3.2.0";

Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9912,6 +9912,7 @@ with pkgs;
};

opensubdiv = callPackage ../development/libraries/opensubdiv {
stdenv_gcc5 = overrideCC stdenv gcc5;
cmake = cmake_2_8;
};

Expand Down Expand Up @@ -13619,6 +13620,7 @@ with pkgs;
bleachbit = callPackage ../applications/misc/bleachbit { };

blender = callPackage ../applications/misc/blender {
stdenv_gcc5 = overrideCC stdenv gcc5;
python = python35;
};

Expand Down

0 comments on commit afc0218

Please sign in to comment.