From 6cfa7f84078154b42fdb1226bf57deb3106d7895 Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Mon, 2 Sep 2019 09:28:14 +0200 Subject: [PATCH 1/5] Return compiler commands and flags in prgenv details --- reframe/core/environments.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/reframe/core/environments.py b/reframe/core/environments.py index 13514bdaf2..7d1227c4a8 100644 --- a/reframe/core/environments.py +++ b/reframe/core/environments.py @@ -334,3 +334,19 @@ def ldflags(self): @property def nvcc(self): return self._nvcc + + def details(self): + base_details = super().details() + extra_details = [ + ' CC: %s' % self.cc, + ' CXX: %s' % self.cxx, + ' FTN: %s' % self.ftn, + ' NVCC: %s' % self.nvcc or '', + ' CFLAGS: %s' % (self.cflags or ''), + ' CXXFLAGS: %s' % (self.cxxflags or ''), + ' FFLAGS: %s' % (self.fflags or ''), + ' CPPFLAGS: %s' % (self.cppflags or ''), + ' LDFLAGS: %s' % (self.ldflags or '') + ] + + return '\n'.join([base_details, '\n'.join(extra_details)]) From 27eb564ce0e48c3f4a1bb58292dccc91a05d8e1b Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Tue, 3 Sep 2019 07:50:33 +0200 Subject: [PATCH 2/5] Address PR comments --- reframe/core/environments.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reframe/core/environments.py b/reframe/core/environments.py index 7d1227c4a8..ab76008d9a 100644 --- a/reframe/core/environments.py +++ b/reframe/core/environments.py @@ -341,12 +341,12 @@ def details(self): ' CC: %s' % self.cc, ' CXX: %s' % self.cxx, ' FTN: %s' % self.ftn, - ' NVCC: %s' % self.nvcc or '', - ' CFLAGS: %s' % (self.cflags or ''), - ' CXXFLAGS: %s' % (self.cxxflags or ''), - ' FFLAGS: %s' % (self.fflags or ''), - ' CPPFLAGS: %s' % (self.cppflags or ''), - ' LDFLAGS: %s' % (self.ldflags or '') + ' NVCC: %s' % self.nvcc, + ' CFLAGS: %s' % self.cflags, + ' CXXFLAGS: %s' % self.cxxflags, + ' FFLAGS: %s' % self.fflags, + ' CPPFLAGS: %s' % self.cppflags, + ' LDFLAGS: %s' % self.ldflags ] return '\n'.join([base_details, '\n'.join(extra_details)]) From f65ae1640f782fea69d18703a109c8e41f43233c Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Tue, 3 Sep 2019 11:40:03 +0200 Subject: [PATCH 3/5] Address PR comments (ver 2) --- reframe/core/environments.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/reframe/core/environments.py b/reframe/core/environments.py index ab76008d9a..dc764496fb 100644 --- a/reframe/core/environments.py +++ b/reframe/core/environments.py @@ -177,6 +177,15 @@ def __repr__(self): self.modules, self.variables) +def format_flags(flags): + if flags is None: + return '' + elif len(flags) == 0: + return "''" + else: + return ' '.join(flags) + + def swap_environments(src, dst): src.unload() dst.load() @@ -342,11 +351,11 @@ def details(self): ' CXX: %s' % self.cxx, ' FTN: %s' % self.ftn, ' NVCC: %s' % self.nvcc, - ' CFLAGS: %s' % self.cflags, - ' CXXFLAGS: %s' % self.cxxflags, - ' FFLAGS: %s' % self.fflags, - ' CPPFLAGS: %s' % self.cppflags, - ' LDFLAGS: %s' % self.ldflags + ' CFLAGS: %s' % format_flags(self.cflags), + ' CXXFLAGS: %s' % format_flags(self.cxxflags), + ' FFLAGS: %s' % format_flags(self.fflags), + ' CPPFLAGS: %s' % format_flags(self.cppflags), + ' LDFLAGS: %s' % format_flags(self.ldflags) ] return '\n'.join([base_details, '\n'.join(extra_details)]) From d2a06a1fbc67b4614e26ce6f22321dc484ad7a2f Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Wed, 4 Sep 2019 08:52:03 +0200 Subject: [PATCH 4/5] Address PR comments (ver 3) --- reframe/core/environments.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reframe/core/environments.py b/reframe/core/environments.py index dc764496fb..e1f4d76ab8 100644 --- a/reframe/core/environments.py +++ b/reframe/core/environments.py @@ -345,6 +345,14 @@ def nvcc(self): return self._nvcc def details(self): + def format_flags(flags): + if flags is None: + return '' + elif len(flags) == 0: + return "''" + else: + return ' '.join(flags) + base_details = super().details() extra_details = [ ' CC: %s' % self.cc, From 1e35c68ec0beb51d9d99eea7a9b04f000e094e1c Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Thu, 5 Sep 2019 11:20:51 +0200 Subject: [PATCH 5/5] Address PR comments (ver 4) --- reframe/core/environments.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/reframe/core/environments.py b/reframe/core/environments.py index e1f4d76ab8..3d9602babd 100644 --- a/reframe/core/environments.py +++ b/reframe/core/environments.py @@ -177,15 +177,6 @@ def __repr__(self): self.modules, self.variables) -def format_flags(flags): - if flags is None: - return '' - elif len(flags) == 0: - return "''" - else: - return ' '.join(flags) - - def swap_environments(src, dst): src.unload() dst.load()