From 419e7f95ccf0f41c97ed7414ecd2a7b0bb756297 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Mon, 12 Apr 2021 17:43:30 +0200 Subject: [PATCH] fwi: avoid input generation The ModelGenerator is now included in the fwi-params, so that the input can be generated at runtime. --- garlic/apps/fwi/default.nix | 4 ++-- garlic/apps/fwi/{input.nix => params.nix} | 8 +++++--- garlic/apps/index.nix | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) rename garlic/apps/fwi/{input.nix => params.nix} (92%) diff --git a/garlic/apps/fwi/default.nix b/garlic/apps/fwi/default.nix index 5b1a9d6..ef31127 100644 --- a/garlic/apps/fwi/default.nix +++ b/garlic/apps/fwi/default.nix @@ -5,7 +5,7 @@ , mcxx ? null , cc , gitBranch ? "garlic/tampi+send+oss+task" -, fwiInput +, fwiParams }: with stdenv.lib; @@ -47,7 +47,7 @@ stdenv.mkDerivation rec { make depend - cp ${fwiInput}/generated_model_params.h src/ + cp ${fwiParams}/generated_model_params.h src/ ''; # We compile the ModelGenerator using gcc *only*, as otherwise it will diff --git a/garlic/apps/fwi/input.nix b/garlic/apps/fwi/params.nix similarity index 92% rename from garlic/apps/fwi/input.nix rename to garlic/apps/fwi/params.nix index 848759f..78efc33 100644 --- a/garlic/apps/fwi/input.nix +++ b/garlic/apps/fwi/params.nix @@ -9,7 +9,7 @@ with stdenv.lib; with builtins; stdenv.mkDerivation rec { - name = "fwi-input"; + name = "fwi-params"; src = builtins.fetchGit { url = "ssh://git@bscpm03.bsc.es/garlic/apps/fwi.git"; @@ -41,13 +41,15 @@ stdenv.mkDerivation rec { # Also, we need to compile it with the builder platform as target, as is going # to be executed during the build to generate the src/generated_model_params.h # header. - makeFlags = [ "COMPILER=GNU" "params" "input" ]; + makeFlags = [ "COMPILER=GNU" "params" ]; installPhase = '' mkdir -p $out/ cp src/generated_model_params.h $out/ cp SetupParams/fwi_params.txt $out/ cp SetupParams/fwi_frequencies.txt $out/ - cp -r InputModels $out/ + + mkdir -p $out/bin + cp ModelGenerator $out/bin/ ''; } diff --git a/garlic/apps/index.nix b/garlic/apps/index.nix index 41da295..c6ef494 100644 --- a/garlic/apps/index.nix +++ b/garlic/apps/index.nix @@ -54,9 +54,9 @@ hpccg = callPackage ./hpccg/default.nix { }; fwi = rec { - input = callPackage ./fwi/input.nix { }; + params = callPackage ./fwi/params.nix { }; solver = callPackage ./fwi/default.nix { - fwiInput = input; + fwiParams = params; }; }; }