summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authoryellowhat <yellowhat46@gmail.com>2020-07-03 09:05:24 +0100
committerGitHub <noreply@github.com>2020-07-03 10:05:24 +0200
commitb45fc975642d224693f450d645b52accba190571 (patch)
tree22b00766ccd3cc5912b23b2dfd4617a6af6801cf /var
parent986f68f7ed3b06ccd9ec44d1c8896a97f64c4920 (diff)
downloadspack-b45fc975642d224693f450d645b52accba190571.tar.gz
spack-b45fc975642d224693f450d645b52accba190571.tar.bz2
spack-b45fc975642d224693f450d645b52accba190571.tar.xz
spack-b45fc975642d224693f450d645b52accba190571.zip
Package request: HPCG (#17350)
* use patch from upstream Co-authored-by: Michael Kuhn <michael.kuhn@informatik.uni-hamburg.de>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/hpcg/package.py78
1 files changed, 78 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/hpcg/package.py b/var/spack/repos/builtin/packages/hpcg/package.py
new file mode 100644
index 0000000000..4de150cda2
--- /dev/null
+++ b/var/spack/repos/builtin/packages/hpcg/package.py
@@ -0,0 +1,78 @@
+# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack import *
+import os
+import platform
+
+
+class Hpcg(AutotoolsPackage):
+ """HPCG is a software package that performs a fixed number of multigrid
+ preconditioned (using a symmetric Gauss-Seidel smoother) conjugate gradient
+ (PCG) iterations using double precision (64 bit) floating point values."""
+
+ homepage = "https://www.hpcg-benchmark.org"
+ url = "http://www.hpcg-benchmark.org/downloads/hpcg-3.1.tar.gz"
+ git = "https://github.com/hpcg-benchmark/hpcg.git"
+
+ version('develop', branch='master')
+ version('3.1', sha256='33a434e716b79e59e745f77ff72639c32623e7f928eeb7977655ffcaade0f4a4')
+
+ variant('openmp', default=True, description='Enable OpenMP support')
+
+ patch('https://github.com/hpcg-benchmark/hpcg/commit/e9e0b7e6cae23e1f30dd983c2ce2d3bd34d56f75.patch', sha256='23b9de83042eb7a8207fdddcfa79ae2cc1a17e8e623e2224c7751d7c328ee482', when='%gcc@9:')
+
+ depends_on('mpi@1.1:')
+
+ arch = '{0}-{1}'.format(platform.system(), platform.processor())
+ build_targets = ['arch={0}'.format(arch)]
+
+ def configure(self, spec, prefix):
+ CXXFLAGS = '-O3 -ffast-math '
+ CXXFLAGS += '-ftree-vectorize -ftree-vectorizer-verbose=0 '
+ if '+openmp' in self.spec:
+ CXXFLAGS += self.compiler.openmp_flag
+ config = [
+ # Shell
+ 'SHELL = /bin/sh',
+ 'CD = cd',
+ 'CP = cp',
+ 'LN_S = ln -fs',
+ 'MKDIR = mkdir -p',
+ 'RM = /bin/rm -f',
+ 'TOUCH = touch',
+ # Platform identifier
+ 'ARCH = {0}'.format(self.arch),
+ # HPCG Directory Structure / HPCG library
+ 'TOPdir = {0}'.format(os.getcwd()),
+ 'SRCdir = $(TOPdir)/src',
+ 'INCdir = $(TOPdir)/src',
+ 'BINdir = $(TOPdir)/bin',
+ # Message Passing library (MPI)
+ 'MPinc = -I{0}'.format(spec['mpi'].prefix.include),
+ 'MPlib = -L{0}'.format(spec['mpi'].prefix.lib),
+ # HPCG includes / libraries / specifics
+ 'HPCG_INCLUDES = -I$(INCdir) -I$(INCdir)/$(arch) $(MPinc)',
+ 'HPCG_LIBS =',
+ 'HPCG_OPTS =',
+ 'HPCG_DEFS = $(HPCG_OPTS) $(HPCG_INCLUDES)',
+ # Compilers / linkers - Optimization flags
+ 'CXX = {0}'.format(spec['mpi'].mpicxx),
+ 'CXXFLAGS = $(HPCG_DEFS) {0}'.format(CXXFLAGS),
+ 'LINKER = $(CXX)',
+ 'LINKFLAGS = $(CXXFLAGS)',
+ 'ARCHIVER = ar',
+ 'ARFLAGS = r',
+ 'RANLIB = echo',
+ ]
+
+ # Write configuration options to include file
+ with open('setup/Make.{0}'.format(self.arch), 'w') as makefile:
+ for var in config:
+ makefile.write('{0}\n'.format(var))
+
+ def install(self, spec, prefix):
+ # Manual installation
+ install_tree('bin', prefix.bin)