diff --git a/simtbx/kokkos/SConscript b/simtbx/kokkos/SConscript index 25d87173af..d1b3ca6a07 100644 --- a/simtbx/kokkos/SConscript +++ b/simtbx/kokkos/SConscript @@ -69,7 +69,10 @@ 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() +# 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)