Skip to content

Commit

Permalink
Refactor nix flake and exclude tests which fail due to insufficient c…
Browse files Browse the repository at this point in the history
…ores

The nix flake check workflow failed previously because the github actions runner
has only two cores, but some tests require more. Filtering with the (.*_np[3-9])
regex removes the failing tests.
  • Loading branch information
mk3z committed Aug 16, 2024
1 parent 42f7a70 commit 6a03196
Showing 1 changed file with 20 additions and 29 deletions.
49 changes: 20 additions & 29 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,17 @@

basePkg = {
name,
nativeBuildInputs,
buildInputs,
cmakeFlags,
nativeBuildInputs ? [],
buildInputs ? [],
cmakeFlags ? [],
doCheck,
checkOptions,
checkOptions ? ''-L "quick|fast" -E "(ForceToStress_parallel)|(Hydro_Coupled)|(Hydro_SedOnly)|(Proj_South)|(.*_np[3-9])"'',
...
} @ inputs: let
}: let
storepath = placeholder "out";
extraNativeBuildInputs = nativeBuildInputs;
extraBuildInputs = buildInputs;
extraCmakeFlags = cmakeFlags;
in
pkgs.stdenv.mkDerivation {
inherit name doCheck storepath;
Expand Down Expand Up @@ -86,7 +89,7 @@
pkg-config
autoPatchelfHook
]
++ inputs.nativeBuildInputs;
++ extraNativeBuildInputs;

buildInputs = with pkgs;
[
Expand All @@ -95,7 +98,7 @@
liblapack
tbb
]
++ inputs.buildInputs;
++ extraBuildInputs;

cmakeFlags =
[
Expand All @@ -110,7 +113,7 @@

"-Wno-dev"
]
++ inputs.cmakeFlags;
++ extraCmakeFlags;

checkPhase = ''
runHook preCheckPhase
Expand All @@ -130,24 +133,15 @@
];
};

default = {
doCheck ? false,
checkOptions ? ''-L "quick|fast" -E "(ForceToStress_parallel)|(Hydro_Coupled)|(Hydro_SedOnly)|(Proj_South)|(PoissonDG_np8)|(poisson_transient_conforming_anti_np8)"'',
}:
default = {doCheck ? false}:
basePkg {
inherit doCheck checkOptions;
inherit doCheck;
name = "elmer";
nativeBuildInputs = [];
buildInputs = [];
cmakeFlags = [];
};

gui = {
doCheck ? false,
checkOptions ? ''-L "quick|fast" -E "(ForceToStress_parallel)|(Hydro_Coupled)|(Hydro_SedOnly)|(Proj_South)|(PoissonDG_np8)|(poisson_transient_conforming_anti_np8)"'',
}:
gui = {doCheck ? false}:
basePkg {
inherit doCheck checkOptions;
inherit doCheck;
name = "elmer-gui";

nativeBuildInputs = [pkgs.libsForQt5.wrapQtAppsHook];
Expand All @@ -171,16 +165,11 @@
];
};

full = {
doCheck ? false,
checkOptions ? ''-L "quick|fast" -E "(ForceToStress_parallel)|(Hydro_Coupled)|(Hydro_SedOnly)|(Proj_South)|(PoissonDG_np8)|(poisson_transient_conforming_anti_np8)"'',
}:
full = {doCheck ? false}:
basePkg {
inherit doCheck checkOptions;
inherit doCheck;
name = "elmer-full";

nativeBuildInputs = [];

buildInputs = with pkgs;
[
hdf5-mpi
Expand All @@ -196,17 +185,19 @@
cmakeFlags = [
"-DWITH_NETCDF:BOOL=TRUE"
"-DNETCDF_LIBRARY=${pkgs.netcdf-mpi}/lib/libnetcdf.so"
"-DNETCDFF_LIBRARY=${pkgs.netcdffortran}/lib/libnetcdff.so"
"-DNETCDF_INCLUDE_DIR=${pkgs.netcdf-mpi}/include"
"-DNETCDFF_LIBRARY=${pkgs.netcdffortran}/lib/libnetcdff.so"
"-DCMAKE_Fortran_FLAGS=-I${pkgs.netcdffortran}/include"

"-DWITH_Hypre:BOOL=TRUE"

"-DWITH_Mumps:BOOL=TRUE"

"-DWITH_ScatteredDataInterpolator:BOOL=TRUE"

"-DCSA_LIBRARY=${csa}/lib/libcsa.a"
"-DCSA_INCLUDE_DIR=${csa}/include"

"-DNN_INCLUDE_DIR=${pkgs.nn}/include"
"-DNN_LIBRARY=${pkgs.nn}/lib/libnn.a"

Expand Down

0 comments on commit 6a03196

Please sign in to comment.