diff options
author | Sinan <sbulutw@gmail.com> | 2019-10-28 15:33:33 -0700 |
---|---|---|
committer | Adam J. Stewart <ajstewart426@gmail.com> | 2019-10-28 17:33:32 -0500 |
commit | e5b1dbf4b43a7aad027f616bf06c1d3aac87d920 (patch) | |
tree | 94a92de973507e95b2c26392eb11e9cfc640b6ad | |
parent | 1b3f546ba459735ea91c73494b1fd5a93653917e (diff) | |
download | spack-e5b1dbf4b43a7aad027f616bf06c1d3aac87d920.tar.gz spack-e5b1dbf4b43a7aad027f616bf06c1d3aac87d920.tar.bz2 spack-e5b1dbf4b43a7aad027f616bf06c1d3aac87d920.tar.xz spack-e5b1dbf4b43a7aad027f616bf06c1d3aac87d920.zip |
new Package/scs (#13454)
* new package: SCS
* make flake8 happy
* add missing patch, improve style
* fix typo
* Update var/spack/repos/builtin/packages/scs/package.py
Co-Authored-By: Adam J. Stewart <ajstewart426@gmail.com>
* move filefilter to edit phase
-rw-r--r-- | var/spack/repos/builtin/packages/scs/make_gpu.patch | 14 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/scs/package.py | 41 |
2 files changed, 55 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/scs/make_gpu.patch b/var/spack/repos/builtin/packages/scs/make_gpu.patch new file mode 100644 index 0000000000..3e38d832cc --- /dev/null +++ b/var/spack/repos/builtin/packages/scs/make_gpu.patch @@ -0,0 +1,14 @@ +diff --git a/Makefile.orig b/Makefile +index b4f2bc9..8a28fc4 100644 +--- a/Makefile.orig ++++ b/Makefile +@@ -129,7 +129,8 @@ install: $(INSTALL_INC_FILES) $(INSTALL_TARGETS) + $(INSTALL) -d $(INSTALL_INC_DIR) $(INSTALL_LIB_DIR) + $(INSTALL) -m 644 $(INSTALL_INC_FILES) $(INSTALL_INC_DIR) + $(INSTALL) -m 644 $(INSTALL_TARGETS) $(INSTALL_LIB_DIR) +-install_gpu: $(INSTALL_INC_FILES) $(INSTALL_GPU_TARGETS) ++install_gpu: $(INSTALL_INC_FILES) $(INSTALL_GPU_TARGETS) $(INSTALL_TARGETS) + $(INSTALL) -d $(INSTALL_INC_DIR) $(INSTALL_LIB_DIR) + $(INSTALL) -m 644 $(INSTALL_INC_FILES) $(INSTALL_INC_DIR) + $(INSTALL) -m 644 $(INSTALL_GPU_TARGETS) $(INSTALL_LIB_DIR) ++ $(INSTALL) -m 644 $(INSTALL_TARGETS) $(INSTALL_LIB_DIR) diff --git a/var/spack/repos/builtin/packages/scs/package.py b/var/spack/repos/builtin/packages/scs/package.py new file mode 100644 index 0000000000..db086a99d1 --- /dev/null +++ b/var/spack/repos/builtin/packages/scs/package.py @@ -0,0 +1,41 @@ +# 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 Scs(MakefilePackage): + """A C package that solves convex cone problems via operator splitting""" + + homepage = "https://github.com/cvxgrp/scs" + url = "https://github.com/cvxgrp/scs/archive/2.1.1.tar.gz" + + version('2.1.1', sha256='0e20b91e8caf744b84aa985ba4e98cc7235ee33612b2bad2bf31ea5ad4e07d93') + + variant('cuda', default=False, description='Build with Cuda support') + + depends_on('blas') + depends_on('lapack') + depends_on('cuda', when='+cuda') + + # make sure install_gpu target installs all libs not only the gpu ones + patch('make_gpu.patch') + + def edit(self, spec, prefix): + filter_file(r'-lblas', spec['blas'].libs.ld_flags, 'scs.mk') + filter_file(r'-llapack', spec['lapack'].libs.ld_flags, 'scs.mk') + + def build(self, spec, prefix): + if '+cuda' in spec: + make('default', 'gpu') + else: + make() + + def install(self, spec, prefix): + if '+cuda' in spec: + make('PREFIX=' + prefix, 'install_gpu') + else: + make('PREFIX=' + prefix, 'install') |