Packages/cns nospec (#5023)
* new package: cns-nospec * made changes as suggested and added proxy-app tag * updated edit() * adjusted logic for '+debug' * install readme and license * install readme and license * install readme and license; fix mpi version build issues * fix build issues for ~mpi * pep8 compliant
This commit is contained in:
parent
3506f2674c
commit
a66fb012da
1 changed files with 41 additions and 1 deletions
|
@ -49,6 +49,21 @@ class CnsNospec(MakefilePackage):
|
||||||
build_directory = 'MiniApps/CNS_NoSpec'
|
build_directory = 'MiniApps/CNS_NoSpec'
|
||||||
|
|
||||||
def edit(self, spec, prefix):
|
def edit(self, spec, prefix):
|
||||||
|
def_file = FileFilter('Tools/F_mk/GMakedefs.mak')
|
||||||
|
def_file.filter('tdir = t/.*', 'tdir := t/$(suf)')
|
||||||
|
def_file.filter('hdir = t/.*', 'hdir := t/html')
|
||||||
|
def_file.filter('include $(BOXLIB_HOME)/Tools/F_mk/GMakeMPI.mak', '#')
|
||||||
|
|
||||||
|
if '+mpi' in spec:
|
||||||
|
def_file.filter('FC.*:=.*', 'FC = {0}'.format(spec['mpi'].mpifc))
|
||||||
|
def_file.filter('F90.*:=.*', 'F90 = {0}'.format(spec['mpi'].mpifc))
|
||||||
|
def_file.filter(
|
||||||
|
'mpi_include_dir =.*',
|
||||||
|
'mpi_include_dir = {0}'.format(spec['mpi'].prefix.include))
|
||||||
|
def_file.filter(
|
||||||
|
'mpi_lib_dir =.*',
|
||||||
|
'mpi_lib_dir = {0}'.format(spec['mpi'].prefix.lib))
|
||||||
|
|
||||||
with working_dir(self.build_directory):
|
with working_dir(self.build_directory):
|
||||||
makefile = FileFilter('GNUmakefile')
|
makefile = FileFilter('GNUmakefile')
|
||||||
if '+mpi' in spec:
|
if '+mpi' in spec:
|
||||||
|
@ -60,6 +75,30 @@ def edit(self, spec, prefix):
|
||||||
if '+prof' in spec:
|
if '+prof' in spec:
|
||||||
makefile.filter('PROF.*', 'PROF := t')
|
makefile.filter('PROF.*', 'PROF := t')
|
||||||
|
|
||||||
|
if self.compiler.name == 'gcc':
|
||||||
|
makefile.filter('COMP .*', 'COMP = gfortran')
|
||||||
|
if self.compiler.name == 'intel':
|
||||||
|
makefile.filter('COMP .*', 'COMP = Intel')
|
||||||
|
if self.compiler.name == 'pgi':
|
||||||
|
makefile.filter('COMP .*', 'COMP = PGI')
|
||||||
|
if self.compiler.name == 'xl':
|
||||||
|
makefile.filter('COMP .*', 'COMP = IBM')
|
||||||
|
if self.compiler.name == 'cce':
|
||||||
|
makefile.filter('COMP .*', 'COMP = Cray')
|
||||||
|
|
||||||
|
@property
|
||||||
|
def build_targets(self):
|
||||||
|
spec = self.spec
|
||||||
|
if '+mpi' in spec:
|
||||||
|
return ['CC = {0}'.format(spec['mpi'].mpicc),
|
||||||
|
'CXX = {0}'.format(spec['mpi'].mpicxx)]
|
||||||
|
else:
|
||||||
|
return []
|
||||||
|
|
||||||
|
def build(self, spec, prefix):
|
||||||
|
with working_dir(self.build_directory):
|
||||||
|
gmake()
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
mkdirp(prefix.bin)
|
mkdirp(prefix.bin)
|
||||||
files = glob.glob(join_path(self.build_directory, '*.exe'))
|
files = glob.glob(join_path(self.build_directory, '*.exe'))
|
||||||
|
@ -67,3 +106,4 @@ def install(self, spec, prefix):
|
||||||
install(f, prefix.bin)
|
install(f, prefix.bin)
|
||||||
install('README.txt', prefix)
|
install('README.txt', prefix)
|
||||||
install('license.txt', prefix)
|
install('license.txt', prefix)
|
||||||
|
install(join_path(self.build_directory, 'README'), prefix)
|
||||||
|
|
Loading…
Reference in a new issue