diff --git a/pkgs/development/libraries/science/math/magma/generic.nix b/pkgs/development/libraries/science/math/magma/generic.nix index 49efda96829c..d10da6843c36 100644 --- a/pkgs/development/libraries/science/math/magma/generic.nix +++ b/pkgs/development/libraries/science/math/magma/generic.nix @@ -28,6 +28,7 @@ , ninja , openmp , rocmSupport ? false +, static ? false , stdenv , symlinkJoin }: @@ -145,6 +146,8 @@ stdenv.mkDerivation { cmakeFlags = [ "-DGPU_TARGET=${gpuTargetString}" + ] ++ lists.optionals static [ + "-DBUILD_SHARED_LIBS=OFF" ] ++ lists.optionals cudaSupport [ "-DCMAKE_CUDA_ARCHITECTURES=${cudaArchitecturesString}" "-DMIN_ARCH=${minArch}" # Disarms magma's asserts diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 59096154d82f..dfabb7a6c2c5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -38238,6 +38238,10 @@ with pkgs; rocmSupport = false; }; + magma-cuda-static = magma-cuda.override { + static = true; + }; + # TODO:AMD won't compile with anything newer than 2.6.2 -- it fails at the linking stage. magma-hip = magma_2_6_2.override { cudaSupport = false; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 620e359ef76b..bc4f996122b8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12319,6 +12319,10 @@ self: super: with self; { torch = callPackage ../development/python-modules/torch { cudaSupport = pkgs.config.cudaSupport or false; + magma = + if pkgs.config.cudaSupport or false + then pkgs.magma-cuda-static + else pkgs.magma; inherit (pkgs.darwin.apple_sdk.frameworks) Accelerate CoreServices; inherit (pkgs.darwin) libobjc; inherit (pkgs.llvmPackages_rocm) openmp; @@ -12329,7 +12333,7 @@ self: super: with self; { }; torchWithCuda = self.torch.override { - magma = pkgs.magma-cuda; + magma = pkgs.magma-cuda-static; cudaSupport = true; rocmSupport = false; };