From d70316a25a40f2cb19dd5b807ae533f52620a48f Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 4 Dec 2020 11:17:15 +0100 Subject: [PATCH] fwi: disable nanos6 in ModelGenerator --- garlic/apps/fwi/default.nix | 21 ++++++++++++++------- overlay.nix | 4 ++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/garlic/apps/fwi/default.nix b/garlic/apps/fwi/default.nix index 2a97508..594e73e 100644 --- a/garlic/apps/fwi/default.nix +++ b/garlic/apps/fwi/default.nix @@ -8,16 +8,14 @@ }: stdenv.mkDerivation rec { - name = "nbody"; - variant = "4_MPI_ompss"; + name = "fwi"; + variant = "oss+task"; src = builtins.fetchGit { url = "https://gitlab.com/srodrb/BSC-FWI.git"; - ref = "ompss-mpi-nocache"; + ref = "${variant}"; }; - postUnpack = "sourceRoot=$sourceRoot/${variant}"; - enableParallelBuilding = true; buildInputs = [ @@ -33,8 +31,17 @@ stdenv.mkDerivation rec { # to define them before mcc includes nanos6.h from the command line. So the # only chance is by setting it at the command line with -D. Using the DEFINES # below, reaches the command line of the preprocessing stage with gcc. - preBuild = '' + preConfigure = '' export DEFINES=-D_GNU_SOURCE + export NANOS6_CONFIG_OVERRIDE=version.debug=true + ''; + + # We compile the ModelGenerator using gcc *only*, as otherwise it will + # be compiled with nanos6, which requires access to /sys to determine + # hardware capabilities. So it will fail in the nix-build environment, + # as there is no /sys mounted. + preBuild = '' + make COMPILER=GNU ModelGenerator ''; makeFlags = [ @@ -46,7 +53,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/bin - cp fwi.* $out/bin + cp fwi $out/bin cp ModelGenerator $out/bin ''; } diff --git a/overlay.nix b/overlay.nix index 2a3e7eb..d3652d5 100644 --- a/overlay.nix +++ b/overlay.nix @@ -310,6 +310,8 @@ let ifsker = callPackage ./garlic/apps/ifsker/default.nix { }; + fwi = callPackage ./garlic/apps/fwi { }; + # heat = callPackage ./garlic/apps/heat/default.nix { # # FIXME: The heat program must be able to compile with gcc9 and newer # stdenv = self.gcc7Stdenv; @@ -330,8 +332,6 @@ let # }; # # hpccg = callPackage ./garlic/apps/hpccg { }; -# -# fwi = callPackage ./garlic/apps/fwi { }; }; # Execution stages