nixpkgs/pkgs/development/libraries/science/math/mkl/test/default.nix
Daniël de Kok 6556beb779 mkl: 2020.3.304 -> 2021.1.1.52
Intel MKL is succeeded by Intel oneMKL. This also results in several
changes:

- The versioning scheme has been changed, it now consists of a version
  such as "2021.1.1" and a build such as "52".
- The tarball of RPMs has been replaced by a relatively complex
  installer, so instead we use the RPMs provided by the upstream
  Yum repository.

To better detect breakage, the passthru tests also check static builds
and with parallel (iomp) execution.
2021-03-23 14:55:06 +01:00

42 lines
806 B
Nix

{ stdenv
, pkg-config
, mkl
, enableStatic ? false
, execution ? "seq"
}:
let
linkType = if enableStatic then "static" else "dynamic";
in stdenv.mkDerivation {
pname = "mkl-test";
version = mkl.version;
src = ./.;
nativeBuildInputs = [ pkg-config ];
buildInputs = [ (mkl.override { inherit enableStatic; }) ];
doCheck = true;
buildPhase = ''
# Check regular Nix build.
gcc test.c -o test $(pkg-config --cflags --libs mkl-${linkType}-ilp64-${execution})
# Clear flags to ensure that we are purely relying on options
# provided by pkg-config.
NIX_CFLAGS_COMPILE="" \
NIX_LDFLAGS="" \
gcc test.c -o test $(pkg-config --cflags --libs mkl-${linkType}-ilp64-${execution})
'';
installPhase = ''
touch $out
'';
checkPhase = ''
./test
'';
}