summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThilina Rathnayake <thilinarmtb@users.noreply.github.com>2017-12-08 11:29:58 -0600
committerChristoph Junghans <christoph.junghans@gmail.com>2017-12-08 10:29:58 -0700
commitd6db53209539190a3a33062da899fef3a6a8c51c (patch)
tree65871ca21fb3bb4ce7dd0357801a81491ddb6f2e
parent4c02e7e9f4e018f9a47aec9f604df21bfe1ab4fa (diff)
downloadspack-d6db53209539190a3a33062da899fef3a6a8c51c.tar.gz
spack-d6db53209539190a3a33062da899fef3a6a8c51c.tar.bz2
spack-d6db53209539190a3a33062da899fef3a6a8c51c.tar.xz
spack-d6db53209539190a3a33062da899fef3a6a8c51c.zip
Update the Nekbone package (#6508)
-rw-r--r--var/spack/repos/builtin/packages/nekbone/package.py57
1 files changed, 36 insertions, 21 deletions
diff --git a/var/spack/repos/builtin/packages/nekbone/package.py b/var/spack/repos/builtin/packages/nekbone/package.py
index 3d419b9156..4531012110 100644
--- a/var/spack/repos/builtin/packages/nekbone/package.py
+++ b/var/spack/repos/builtin/packages/nekbone/package.py
@@ -22,7 +22,6 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
-
from spack import *
@@ -33,32 +32,48 @@ class Nekbone(Package):
the spectral element method."""
homepage = "https://github.com/Nek5000/Nekbone"
- url = "https://github.com/Nek5000/Nekbone/tarball/v17.0"
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')
- depends_on('mpi')
+ # Variants
+ variant('mpi', default=True, description='Build with MPI')
- def install(self, spec, prefix):
+ # 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)
- working_dirs = ['example1', 'example2', 'example3', 'nek_comm',
- 'nek_delay', 'nek_mgrid']
+ def install(self, spec, prefix):
mkdir(prefix.bin)
- for wdir in working_dirs:
- with working_dir('test/' + wdir):
- makenec = FileFilter('makenek')
- makenec.filter('CC.*', 'CC=' + self.spec['mpi'].mpicc)
- makenec.filter('FF77.*', 'FF77=' + self.spec['mpi'].mpif77)
- makenek = Executable('./makenek')
- path = join_path(prefix.bin, wdir)
- makenek('ex1', '../../src')
- mkdir(path)
- install('nekbone', path)
- install('nekpmpi', path)
- install('data.rea', path)
- install('SIZE', path)
- install('README', path)
+ FC = self.compiler.fc
+ CC = self.compiler.cc
+ if '+mpi' in spec:
+ FC = spec['mpi'].mpif77
+ CC = spec['mpi'].mpicc
+
+ # Install Nekbone in prefix.bin
+ install_tree("../Nekbone", prefix.bin.Nekbone)
+
+ # Install scripts in prefix.bin
+ nekpmpi = 'test/example1/nekpmpi'
+ makenek = 'test/example1/makenek'
+
+ 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')