Update the Nekbone package (#6508)
This commit is contained in:
parent
4c02e7e9f4
commit
d6db532095
@ -22,7 +22,6 @@
|
|||||||
# License along with this program; if not, write to the Free Software
|
# License along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
@ -33,32 +32,48 @@ class Nekbone(Package):
|
|||||||
the spectral element method."""
|
the spectral element method."""
|
||||||
|
|
||||||
homepage = "https://github.com/Nek5000/Nekbone"
|
homepage = "https://github.com/Nek5000/Nekbone"
|
||||||
url = "https://github.com/Nek5000/Nekbone/tarball/v17.0"
|
|
||||||
|
|
||||||
tags = ['proxy-app', 'ecp-proxy-app']
|
tags = ['proxy-app', 'ecp-proxy-app']
|
||||||
|
|
||||||
version('17.0', 'cc339684547614a0725959e41839fec1')
|
version('17.0', 'cc339684547614a0725959e41839fec1', git='https://github.com/Nek5000/Nekbone.git')
|
||||||
version('develop', git='https://github.com/Nek5000/Nekbone.git')
|
version('develop', git='https://github.com/Nek5000/Nekbone.git')
|
||||||
|
|
||||||
depends_on('mpi')
|
# Variants
|
||||||
|
variant('mpi', default=True, description='Build with MPI')
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
depends_on('mpi', when='+mpi')
|
||||||
|
|
||||||
|
@run_before('install')
|
||||||
|
def fortran_check(self):
|
||||||
|
if not self.compiler.fc:
|
||||||
|
msg = 'Nekbone can not be built without a Fortran compiler.'
|
||||||
|
raise RuntimeError(msg)
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
|
|
||||||
working_dirs = ['example1', 'example2', 'example3', 'nek_comm',
|
|
||||||
'nek_delay', 'nek_mgrid']
|
|
||||||
mkdir(prefix.bin)
|
mkdir(prefix.bin)
|
||||||
|
|
||||||
for wdir in working_dirs:
|
FC = self.compiler.fc
|
||||||
with working_dir('test/' + wdir):
|
CC = self.compiler.cc
|
||||||
makenec = FileFilter('makenek')
|
if '+mpi' in spec:
|
||||||
makenec.filter('CC.*', 'CC=' + self.spec['mpi'].mpicc)
|
FC = spec['mpi'].mpif77
|
||||||
makenec.filter('FF77.*', 'FF77=' + self.spec['mpi'].mpif77)
|
CC = spec['mpi'].mpicc
|
||||||
makenek = Executable('./makenek')
|
|
||||||
path = join_path(prefix.bin, wdir)
|
# Install Nekbone in prefix.bin
|
||||||
makenek('ex1', '../../src')
|
install_tree("../Nekbone", prefix.bin.Nekbone)
|
||||||
mkdir(path)
|
|
||||||
install('nekbone', path)
|
# Install scripts in prefix.bin
|
||||||
install('nekpmpi', path)
|
nekpmpi = 'test/example1/nekpmpi'
|
||||||
install('data.rea', path)
|
makenek = 'test/example1/makenek'
|
||||||
install('SIZE', path)
|
|
||||||
install('README', path)
|
install(makenek, prefix.bin)
|
||||||
|
install(nekpmpi, prefix.bin)
|
||||||
|
|
||||||
|
with working_dir(prefix.bin):
|
||||||
|
filter_file(r'^SOURCE_ROOT\s*=.*', 'SOURCE_ROOT=\"' +
|
||||||
|
prefix.bin.Nekbone + '/src\"', 'makenek')
|
||||||
|
filter_file(r'^CC\s*=.*', 'CC=\"' + CC + '\"', 'makenek')
|
||||||
|
filter_file(r'^F77\s*=.*', 'F77=\"' + FC + '\"', 'makenek')
|
||||||
|
|
||||||
|
if '+mpi' not in spec:
|
||||||
|
filter_file(r'^#IFMPI=\"false\"', 'IFMPI=\"false\"', 'makenek')
|
||||||
|
Loading…
Reference in New Issue
Block a user