diff --git a/cscs-checks/libraries/io/netcdf_compile_run.py b/cscs-checks/libraries/io/netcdf_compile_run.py index 4fd4086bf8..68e0e8e7a9 100644 --- a/cscs-checks/libraries/io/netcdf_compile_run.py +++ b/cscs-checks/libraries/io/netcdf_compile_run.py @@ -23,51 +23,53 @@ def __init__(self, lang, linkage): if self.current_system.name in ['daint', 'dom']: self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu', 'PrgEnv-intel', 'PrgEnv-pgi'] + self.modules = ['cray-netcdf'] elif self.current_system.name == 'kesch': - self.valid_prog_environs = ['PrgEnv-pgi-nompi'] + if linkage == 'dynamic': + self.valid_prog_environs = ['PrgEnv-pgi-nompi'] + if lang != 'f90': self.valid_prog_environs += ['PrgEnv-cray-nompi'] self.sourcesdir = os.path.join(self.current_system.resourcesdir, 'netcdf') self.build_system = 'SingleSource' - self.build_system.ldflags = ['-%s' % linkage] self.sourcepath = 'netcdf_read_write.' + lang - if self.current_system.name in ['daint', 'dom']: - self.modules = ['cray-netcdf'] - self.num_tasks = 1 self.num_tasks_per_node = 1 self.sanity_patterns = sn.assert_found(r'SUCCESS', self.stdout) - self.maintainers = ['AJ', 'VK'] self.tags = {'production'} def setup(self, partition, environ, **job_opts): - if (self.current_system.name == 'kesch' and - environ.name == 'PrgEnv-cray-nompi'): - self.modules = ['netcdf/4.4.1.1-gmvolf-17.02', - 'netcdf-c++/4.3.0-gmvolf-17.02', - 'netcdf-fortran/4.4.4-gmvolf-17.02'] - self.build_system.cppflags = [ - '-I$EBROOTNETCDF/include', - '-I$EBROOTNETCDFMINCPLUSPLUS/include', - '-I$EBROOTNETCDFMINFORTRAN/include' - ] - self.build_system.ldflags = [ - '-L$EBROOTNETCDF/lib', - '-L$EBROOTNETCDFMINCPLUSPLUS/lib', - '-L$EBROOTNETCDFMINFORTRAN/lib', - '-L$EBROOTNETCDF/lib64', - '-L$EBROOTNETCDFMINCPLUSPLUS/lib64', - '-L$EBROOTNETCDFMINFORTRAN/lib64', - '-lnetcdf', '-lnetcdf_c++4', '-lnetcdff' - ] - - # NOTE: Workaround to fix static linking for C++ with PrgEnv-pgi - if (environ.name == 'PrgEnv-pgi' and - self.lang == 'cpp' and - self.linkage == 'static'): - self.build_system.ldflags += ['-lstdc++'] + if self.current_system.name == 'kesch': + if environ.name == 'PrgEnv-cray-nompi': + self.modules = ['netcdf/4.4.1.1-gmvolf-17.02', + 'netcdf-c++/4.3.0-gmvolf-17.02', + 'netcdf-fortran/4.4.4-gmvolf-17.02'] + self.build_system.cppflags = [ + '-I$EBROOTNETCDF/include', + '-I$EBROOTNETCDFMINCPLUSPLUS/include', + '-I$EBROOTNETCDFMINFORTRAN/include' + ] + self.build_system.ldflags = [ + '-L$EBROOTNETCDF/lib', + '-L$EBROOTNETCDFMINCPLUSPLUS/lib', + '-L$EBROOTNETCDFMINFORTRAN/lib', + '-L$EBROOTNETCDF/lib64', + '-L$EBROOTNETCDFMINCPLUSPLUS/lib64', + '-L$EBROOTNETCDFMINFORTRAN/lib64', + '-lnetcdf', '-lnetcdf_c++4', '-lnetcdff' + ] + elif environ.name == 'PrgEnv-pgi-nompi': + self.build_system.ldflags = ['-B' + self.linkage] + else: + self.build_system.ldflags = ['-%s' % self.linkage] + if (environ.name == 'PrgEnv-pgi' and + # NOTE: Workaround to fix static linking for C++ with + # PrgEnv-pgi + self.lang == 'cpp' and + self.linkage == 'static'): + self.build_system.ldflags += ['-lstdc++'] super().setup(partition, environ, **job_opts)