summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Junghans <junghans@lanl.gov>2019-09-25 09:00:01 -0600
committerGitHub <noreply@github.com>2019-09-25 09:00:01 -0600
commite123058721952dcc552105e63315f64e3b189b1f (patch)
treec38659848a2d5f1e63f4b02d52c4afcd9698d212
parent7a11a2ccdb2a6a698c8df81beb230a4d210c3ff5 (diff)
downloadspack-e123058721952dcc552105e63315f64e3b189b1f.tar.gz
spack-e123058721952dcc552105e63315f64e3b189b1f.tar.bz2
spack-e123058721952dcc552105e63315f64e3b189b1f.tar.xz
spack-e123058721952dcc552105e63315f64e3b189b1f.zip
kokkos-kernels: initial commit (#12934)
-rw-r--r--var/spack/repos/builtin/packages/kokkos-kernels/makefile.patch53
-rw-r--r--var/spack/repos/builtin/packages/kokkos-kernels/package.py53
2 files changed, 106 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/kokkos-kernels/makefile.patch b/var/spack/repos/builtin/packages/kokkos-kernels/makefile.patch
new file mode 100644
index 0000000000..639bfd4d58
--- /dev/null
+++ b/var/spack/repos/builtin/packages/kokkos-kernels/makefile.patch
@@ -0,0 +1,53 @@
+--- ./src/Makefile 2018-11-05 13:28:12.000000000 -0700
++++ ./src/Makefile 2018-11-08 16:01:05.000000000 -0700
+@@ -1,37 +1,24 @@
++include $(KOKKOS_PATH)/Makefile.kokkos
+ #=======================================================================
+ #=================== Settings ==========================================
+ #=======================================================================
+
+-ifndef KOKKOSKERNELS_PATH
+- MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
+- KOKKOSKERNELS_PATH = $(subst Makefile.minimal,,$(MAKEFILE_PATH))..
+-endif
+-
+-KOKKOS_PATH = ${KOKKOSKERNELS_PATH}/../kokkos
+-
+-
+-KOKKOS_DEVICES=OpenMP
+-
+-KOKKOSKERNELS_SCALARS="'double,complex<double>'"
++KOKKOSKERNELS_SCALARS="'double'"
+ KOKKOSKERNELS_OPTIONS=eti-only
+
+-ifndef PREFIX
+- PREFIX = ${CURDIR}/install
+-endif
+-KOKKOSKERNELS_INSTALL_PATH = ${PREFIX}
+
+ default: build
+
+ CXX = g++
+
+-CXXFLAGS = -O3 -g
++CXXFLAGS = -O3
+ LINK = ${CXX}
+-LINKFLAGS =
++LINKFLAGS = $(KOKKOS_LINK_FLAGS)
+
+ DEPFLAGS = -M
+
+ OBJ =
+-LIB = -lpthread
++LIB = $(KOKKOS_LIBS)
+
+
+ #=======================================================================
+@@ -91,5 +78,4 @@
+
+ build: kokkoskernels-build-lib
+
+-install: kokkoskernels-install
+-
++install: kokkoskernels-install
+\ No newline at end of file
diff --git a/var/spack/repos/builtin/packages/kokkos-kernels/package.py b/var/spack/repos/builtin/packages/kokkos-kernels/package.py
new file mode 100644
index 0000000000..6694cc02d4
--- /dev/null
+++ b/var/spack/repos/builtin/packages/kokkos-kernels/package.py
@@ -0,0 +1,53 @@
+# Copyright 2013-2019 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 *
+
+
+class KokkosKernels(MakefilePackage):
+ """Kokkos C++ Performance Portability Programming EcoSystem: Math Kernels -
+ Provides BLAS, Sparse BLAS and Graph Kernels."""
+
+ homepage = "https://github.com/kokkos/kokkos-kernels"
+ url = "https://github.com/kokkos/kokkos-kernels/archive/2.7.00.tar.gz"
+
+ version('2.7.00', 'dfb21f26da9f1f976d84826a1510d91e')
+ version('2.6.00', 'ef8ba7509d82417dbc82a2f021886949')
+ version('2.5.00', '94f4bd78b36b9c53c18df3ccfd552041')
+ version('develop', git='https://github.com/kokkos/kokkos-kernels',
+ branch='develop')
+
+ # make sure kokkos kernels version matches kokkos
+ depends_on('kokkos@2.5.00', when='@2.5.00')
+ depends_on('kokkos@2.6.00', when='@2.6.00')
+ depends_on('kokkos@2.7.00', when='@2.7.00')
+ depends_on('kokkos@develop', when='@develop')
+
+ patch('makefile.patch')
+
+ def edit(self, spec, prefix):
+ makefile = FileFilter("src/Makefile")
+ makefile.filter('CXX = .*', 'CXX = ' + env['CXX'])
+
+ def build(self, spec, prefix):
+ with working_dir('build', create=True):
+ makefile_path = '%s%s' % (self.stage.source_path, '/src/Makefile')
+ copy(makefile_path, 'Makefile')
+ make_args = [
+ 'KOKKOSKERNELS_INSTALL_PATH=%s' % prefix,
+ 'KOKKOSKERNELS_PATH=%s' % self.stage.source_path,
+ 'KOKKOS_PATH=%s' % spec['kokkos'].prefix
+ ]
+
+ make('build', *make_args)
+
+ def install(self, spec, prefix):
+ with working_dir('build', create=False):
+ make_args = [
+ 'KOKKOSKERNELS_INSTALL_PATH=%s' % prefix,
+ 'KOKKOSKERNELS_PATH=%s' % self.stage.source_path,
+ 'KOKKOS_PATH=%s' % spec['kokkos'].prefix
+ ]
+ make('install', *make_args)