summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorThilina Rathnayake <thilinarmtb@users.noreply.github.com>2018-01-23 12:42:06 -0600
committerscheibelp <scheibel1@llnl.gov>2018-01-23 10:42:06 -0800
commit3223186729f68de41459d3d497d752b0231b5e33 (patch)
treeb4a82f89e9f27b1f8799de41b89428c6e487efde /var
parentd8c105a7b1f882f6a25f6c590d31e94a891220e0 (diff)
downloadspack-3223186729f68de41459d3d497d752b0231b5e33.tar.gz
spack-3223186729f68de41459d3d497d752b0231b5e33.tar.bz2
spack-3223186729f68de41459d3d497d752b0231b5e33.tar.xz
spack-3223186729f68de41459d3d497d752b0231b5e33.zip
new package: gslib (#6328)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/gslib/package.py90
1 files changed, 90 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/gslib/package.py b/var/spack/repos/builtin/packages/gslib/package.py
new file mode 100644
index 0000000000..dd179a64cd
--- /dev/null
+++ b/var/spack/repos/builtin/packages/gslib/package.py
@@ -0,0 +1,90 @@
+##############################################################################
+# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/spack/spack
+# Please also see the NOTICE and LICENSE files for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# 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 *
+
+
+class Gslib(Package):
+ """Highly scalable Gather-scatter code with AMG and XXT solvers"""
+
+ homepage = "https://github.com/gslib/gslib"
+ url = "https://github.com/gslib/gslib"
+
+ version('1.0.1', git='https://github.com/gslib/gslib.git',
+ commit='d16685f24551b7efd69e58d96dc76aec75239ea3')
+ version('1.0.0', git='https://github.com/gslib/gslib.git',
+ commit='9533e652320a3b26a72c36487ae265b02072cd48')
+
+ variant('mpi', default=True, description='Build with MPI')
+ variant('mpiio', default=True, description='Build with MPI I/O')
+ variant('blas', default=False, description='Build with BLAS')
+
+ depends_on('mpi', when="+mpi")
+ depends_on('mpi', when="+mpiio")
+ depends_on('blas', when="+blas")
+
+ conflicts('~mpi', when='+mpiio')
+
+ def install(self, spec, prefix):
+ srcDir = 'src'
+ libDir = 'lib'
+ libname = 'libgs.a'
+
+ if self.version == Version('1.0.1'):
+ makeFile = 'Makefile'
+ else:
+ makeFile = 'src/Makefile'
+
+ CC = self.compiler.cc
+
+ if '+mpiio' not in spec:
+ filter_file(r'MPIIO.*?=.*1', 'MPIIO = 0', makeFile)
+
+ if '+mpi' in spec:
+ CC = spec['mpi'].mpicc
+ else:
+ filter_file(r'MPI.*?=.*1', 'MPI = 0', makeFile)
+ filter_file(r'MPIIO.*?=.*1', 'MPIIO = 0', makeFile)
+
+ makeCmd = "CC=" + CC
+
+ if '+blas' in spec:
+ filter_file(r'BLAS.*?=.*0', 'BLAS = 1', makeFile)
+ blas = spec['blas'].libs
+ ldFlags = blas.ld_flags
+ filter_file(r'\$\(LDFLAGS\)', ldFlags, makeFile)
+
+ if self.version == Version('1.0.1'):
+ make(makeCmd)
+ make('install')
+ install_tree(libDir, prefix.lib)
+ elif self.version == Version('1.0.0'):
+ with working_dir(srcDir):
+ make(makeCmd)
+ mkdir(prefix.lib)
+ install(libname, prefix.lib)
+
+ # Should only install the headers (this will
+ # be fixed in gslib on future releases.
+ install_tree(srcDir, prefix.include)