From bc3cbec604dedce1e02a16fa80e987ee62d083d9 Mon Sep 17 00:00:00 2001 From: Johannes Blaschke Date: Sun, 17 Oct 2021 12:04:47 -0700 Subject: [PATCH 1/2] makefile output is always the last line --- simtbx/kokkos/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simtbx/kokkos/SConscript b/simtbx/kokkos/SConscript index 25d87173af0..7113c257a13 100644 --- a/simtbx/kokkos/SConscript +++ b/simtbx/kokkos/SConscript @@ -69,7 +69,7 @@ kokkos_cxxflags = subprocess.check_output( ['make', '-f', 'Makefile.kokkos', 'print-cxx-flags'], cwd=os.environ['KOKKOS_PATH']) kokkos_cxxflags = kokkos_cxxflags.split(b'\n') -kokkos_cxxflags = kokkos_cxxflags[1].decode('utf8').split() +kokkos_cxxflags = kokkos_cxxflags[-1].decode('utf8').split() print('KOKKOS_CXXFLAGS:', kokkos_cxxflags) print('='*79) From ea00af729fdf8e3b20a0586d48c27d37eddf03e0 Mon Sep 17 00:00:00 2001 From: Johannes Blaschke Date: Sun, 17 Oct 2021 12:26:52 -0700 Subject: [PATCH 2/2] make outputs have trailing \\n -- this removes these blank lines --- simtbx/kokkos/SConscript | 3 +++ 1 file changed, 3 insertions(+) diff --git a/simtbx/kokkos/SConscript b/simtbx/kokkos/SConscript index 7113c257a13..d1b3ca6a07c 100644 --- a/simtbx/kokkos/SConscript +++ b/simtbx/kokkos/SConscript @@ -69,6 +69,9 @@ kokkos_cxxflags = subprocess.check_output( ['make', '-f', 'Makefile.kokkos', 'print-cxx-flags'], cwd=os.environ['KOKKOS_PATH']) kokkos_cxxflags = kokkos_cxxflags.split(b'\n') +# remove empty lines (this will also remove trailing \n in stdout) +kokkos_cxxflags = list(filter(lambda x: x!=b'', kokkos_cxxflags)) +# last line returned by print-cxx-flags contains flags kokkos_cxxflags = kokkos_cxxflags[-1].decode('utf8').split() print('KOKKOS_CXXFLAGS:', kokkos_cxxflags) print('='*79)