Add support in nix for mkl
This commit is contained in:
parent
b72303cad4
commit
a9ddbf4f1a
13
etc/nix/mkl.nix
Normal file
13
etc/nix/mkl.nix
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{ pkgs, ...}:
|
||||||
|
|
||||||
|
{
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
mkl
|
||||||
|
];
|
||||||
|
|
||||||
|
shellHook = ''
|
||||||
|
export MKL_PATH=${pkgs.mkl}
|
||||||
|
export LD_LIBRARY_PATH=$MKL_PATH:$LD_LIBRARY_PATH
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
16
etc/nix/openblas.nix
Normal file
16
etc/nix/openblas.nix
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{ pkgs, ...}:
|
||||||
|
|
||||||
|
{
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
openblas
|
||||||
|
scalapack
|
||||||
|
];
|
||||||
|
|
||||||
|
shellHook = ''
|
||||||
|
export OPENBLAS_PATH=${pkgs.openblas}
|
||||||
|
export SCALAPACK_PATH=${pkgs.scalapack}
|
||||||
|
export LD_LIBRARY_PATH=${pkgs.scalapack}/lib:$LD_LIBRARY_PATH
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
43
shell.nix
43
shell.nix
@ -1,7 +1,13 @@
|
|||||||
{ pkgs ? import <nixpkgs> {} , with-clang ? false }:
|
{ pkgs ? import <nixpkgs> {} , with-clang ? false , with-mkl ? false }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
mkl = import ./etc/nix/mkl.nix { pkgs = (import <nixpkgs> {
|
||||||
|
config.allowUnfree = true;
|
||||||
|
}); };
|
||||||
|
|
||||||
|
openblas = import ./etc/nix/openblas.nix { inherit pkgs; };
|
||||||
|
|
||||||
clang = import ./etc/nix/clang.nix { inherit pkgs; };
|
clang = import ./etc/nix/clang.nix { inherit pkgs; };
|
||||||
|
|
||||||
compiler-configuration
|
compiler-configuration
|
||||||
@ -13,28 +19,25 @@ in
|
|||||||
|
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
|
|
||||||
buildInputs = with pkgs; [
|
buildInputs
|
||||||
|
= with pkgs; [
|
||||||
|
|
||||||
coreutils
|
coreutils
|
||||||
git
|
git
|
||||||
|
|
||||||
blas
|
openmpi
|
||||||
openmpi
|
|
||||||
|
|
||||||
gnumake
|
gnumake
|
||||||
binutils
|
binutils
|
||||||
emacs
|
emacs
|
||||||
|
]
|
||||||
|
++ compiler-configuration
|
||||||
|
++ (if with-mkl then mkl.buildInputs else openblas.buildInputs)
|
||||||
|
;
|
||||||
|
|
||||||
] ++ compiler-configuration;
|
shellHook
|
||||||
|
= (if with-clang then clang.shellHook else "")
|
||||||
shellHook = ''
|
+ (if with-mkl then mkl.shellHook else openblas.shellHook)
|
||||||
export LAPACK_PATH=${pkgs.lapack}
|
;
|
||||||
export BLAS_PATH=${pkgs.blas}
|
|
||||||
export OPENBLAS_PATH=${pkgs.openblas}
|
|
||||||
export SCALAPACK_PATH=${pkgs.scalapack}
|
|
||||||
export LD_LIBRARY_PATH=${pkgs.scalapack}/lib:$LD_LIBRARY_PATH
|
|
||||||
''
|
|
||||||
+ (if with-clang then clang.shellHook else "")
|
|
||||||
;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user