From 60fdba40ae6e81231308bfeb38ca528c23ed1468 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Mon, 20 Jul 2020 15:32:00 +0200 Subject: [PATCH] fwi: Use 4_MPI_ompss variant. The -D_GNU_SOURCE define is required before mcc includes nanos6.h --- bsc/apps/fwi/default.nix | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/bsc/apps/fwi/default.nix b/bsc/apps/fwi/default.nix index 3909bf3..2a97508 100644 --- a/bsc/apps/fwi/default.nix +++ b/bsc/apps/fwi/default.nix @@ -9,13 +9,16 @@ stdenv.mkDerivation rec { name = "nbody"; + variant = "4_MPI_ompss"; src = builtins.fetchGit { url = "https://gitlab.com/srodrb/BSC-FWI.git"; - ref = "ompss"; + ref = "ompss-mpi-nocache"; }; - postUnpack = "sourceRoot=$sourceRoot/3_ompss"; + postUnpack = "sourceRoot=$sourceRoot/${variant}"; + + enableParallelBuilding = true; buildInputs = [ nanos6 @@ -25,6 +28,22 @@ stdenv.mkDerivation rec { mcxx ]; + # FIXME: This is an ugly hack. + # When using _GNU_SOURCE or any other definition used in features.h, we need + # 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 = '' + export DEFINES=-D_GNU_SOURCE + ''; + + makeFlags = [ + "NZF=108" + "NXF=108" + "NYF=208" + "PRECISION=float" + ]; + installPhase = '' mkdir -p $out/bin cp fwi.* $out/bin