summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorDenis Davydov <davydden@gmail.com>2017-08-25 03:18:06 +0200
committerAdam J. Stewart <ajstewart426@gmail.com>2017-08-24 20:18:06 -0500
commitc0d3d33b58eb14e3da2980db43db98b0cbd3e967 (patch)
tree5ae7aad78412ba4784842337a3460433b3e72250 /var
parent61cc55985b62ca22a929cf1c7361b12c2e14844e (diff)
downloadspack-c0d3d33b58eb14e3da2980db43db98b0cbd3e967.tar.gz
spack-c0d3d33b58eb14e3da2980db43db98b0cbd3e967.tar.bz2
spack-c0d3d33b58eb14e3da2980db43db98b0cbd3e967.tar.xz
spack-c0d3d33b58eb14e3da2980db43db98b0cbd3e967.zip
dealii: add nanoflann, sundials and adol-c plus fixes on macOS (#5175)
* expat: fix build on macOS * nanoflann: add new package * sundials: fix compilation on macOS with clang+gfortran * adol-c: add 2.6.3 * dealii: add adol-c, nanoflann, sundials and 8.5.1 * sundials: minor cleanup
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/adol-c/package.py1
-rw-r--r--var/spack/repos/builtin/packages/dealii/package.py26
-rw-r--r--var/spack/repos/builtin/packages/expat/package.py3
-rw-r--r--var/spack/repos/builtin/packages/nanoflann/package.py39
-rw-r--r--var/spack/repos/builtin/packages/sundials/package.py10
5 files changed, 76 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/adol-c/package.py b/var/spack/repos/builtin/packages/adol-c/package.py
index 5de1a31b87..1f9850b4c8 100644
--- a/var/spack/repos/builtin/packages/adol-c/package.py
+++ b/var/spack/repos/builtin/packages/adol-c/package.py
@@ -34,6 +34,7 @@ class AdolC(AutotoolsPackage):
version('develop', git='https://gitlab.com/adol-c/adol-c.git',
branch='master')
+ version('2.6.3', 'f78f67f70d5874830a1ad1c0f54e54f7')
version('2.6.2', '0f9547584c99c0673e4f81cf64e8d865')
version('2.6.1', '1032b28427d6e399af4610e78c0f087b')
diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py
index aa6a2be0b4..ab95783359 100644
--- a/var/spack/repos/builtin/packages/dealii/package.py
+++ b/var/spack/repos/builtin/packages/dealii/package.py
@@ -36,6 +36,7 @@ class Dealii(CMakePackage):
# only add for immediate deps.
transitive_rpaths = False
+ version('8.5.1', '39b9ebd6ab083d63cfc9044319aaa2ee')
version('8.5.0', 'ef999cc310b007559a6343bf5b1759bc')
version('8.4.2', '84c6bd3f250d3e0681b645d24cb987a7')
version('8.4.1', 'efbaf16f9ad59cfccad62302f36c3c1d')
@@ -48,12 +49,15 @@ class Dealii(CMakePackage):
variant('mpi', default=True, description='Compile with MPI')
variant('arpack', default=True,
description='Compile with Arpack and PArpack (only with MPI)')
+ variant('adol-c', default=False,
+ description='Compile with Adol-c')
variant('doc', default=False,
description='Compile with documentation')
variant('gsl', default=True, description='Compile with GSL')
variant('hdf5', default=True,
description='Compile with HDF5 (only with MPI)')
variant('metis', default=True, description='Compile with Metis')
+ variant('nanoflann', default=False, description='Compile with Nanoflann')
variant('netcdf', default=True,
description='Compile with Netcdf (only with MPI)')
variant('oce', default=True, description='Compile with OCE')
@@ -61,6 +65,8 @@ class Dealii(CMakePackage):
description='Compile with P4est (only with MPI)')
variant('petsc', default=True,
description='Compile with Petsc (only with MPI)')
+ variant('sundials', default=False,
+ description='Compile with Sundials')
variant('slepc', default=True,
description='Compile with Slepc (only with Petsc and MPI)')
variant('trilinos', default=True,
@@ -109,6 +115,7 @@ class Dealii(CMakePackage):
# optional dependencies
depends_on("mpi", when="+mpi")
+ depends_on("adol-c@2.6.4:", when='@9.0:+adol-c')
depends_on("arpack-ng+mpi", when='+arpack+mpi')
depends_on("doxygen+graphviz", when='+doc')
depends_on("graphviz", when='+doc')
@@ -118,6 +125,7 @@ class Dealii(CMakePackage):
# but we should not need it
depends_on("metis@5:+int64+real64", when='+metis+int64')
depends_on("metis@5:~int64+real64", when='+metis~int64')
+ depends_on("nanoflann", when="@9.0:+nanoflann")
depends_on("netcdf+mpi", when="+netcdf+mpi")
depends_on("netcdf-cxx", when='+netcdf+mpi')
depends_on("oce", when='+oce')
@@ -129,10 +137,14 @@ class Dealii(CMakePackage):
depends_on("slepc", when='+slepc+petsc+mpi')
depends_on("slepc@:3.6.3", when='@:8.4.1+slepc+petsc+mpi')
depends_on("slepc~arpack", when='+slepc+petsc+mpi+int64')
+ depends_on("sundials", when='@9.0:+sundials')
depends_on("trilinos+amesos+aztec+epetra+ifpack+ml+muelu+sacado+teuchos", when='+trilinos+mpi~int64')
depends_on("trilinos+amesos+aztec+epetra+ifpack+ml+muelu+sacado+teuchos~hypre", when="+trilinos+mpi+int64")
# check that the combination of variants makes sense
+ conflicts('+nanoflann', when='@:8.5.1')
+ conflicts('+sundials', when='@:8.5.1')
+ conflicts('+adol-c', when='@:8.5.1')
conflicts('+gsl', when='@:8.4.2')
conflicts('+python', when='@:8.4.2')
for p in ['+arpack', '+hdf5', '+netcdf', '+p4est', '+petsc',
@@ -211,7 +223,8 @@ class Dealii(CMakePackage):
# Optional dependencies for which library names are the same as CMake
# variables:
for library in (
- 'gsl', 'hdf5', 'p4est', 'petsc', 'slepc', 'trilinos', 'metis'):
+ 'gsl', 'hdf5', 'p4est', 'petsc', 'slepc', 'trilinos', 'metis',
+ 'sundials', 'nanoflann'):
if library in spec:
options.extend([
'-D%s_DIR=%s' % (library.upper(), spec[library].prefix),
@@ -222,6 +235,17 @@ class Dealii(CMakePackage):
'-DDEAL_II_WITH_%s:BOOL=OFF' % library.upper()
])
+ # adol-c
+ if '+adol-c' in spec:
+ options.extend([
+ '-DADOLC_DIR=%s' % spec['adol-c'].prefix,
+ '-DDEAL_II_WITH_ADOLC=ON'
+ ])
+ else:
+ options.extend([
+ '-DDEAL_II_WITH_ADOLC=OFF'
+ ])
+
# doxygen
options.extend([
'-DDEAL_II_COMPONENT_DOCUMENTATION=%s' %
diff --git a/var/spack/repos/builtin/packages/expat/package.py b/var/spack/repos/builtin/packages/expat/package.py
index 091c1f462e..68e8ed4c08 100644
--- a/var/spack/repos/builtin/packages/expat/package.py
+++ b/var/spack/repos/builtin/packages/expat/package.py
@@ -23,6 +23,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
+import sys
class Expat(AutotoolsPackage):
@@ -39,7 +40,7 @@ class Expat(AutotoolsPackage):
# someone's asking for an older version and also libbsd.
# In order to install an older version, you'll need to add
# `~libbsd`.
- variant('libbsd', default=True,
+ variant('libbsd', default=sys.platform != 'darwin',
description="Use libbsd (for high quality randomness)")
depends_on('libbsd', when="@2.2.1:+libbsd")
diff --git a/var/spack/repos/builtin/packages/nanoflann/package.py b/var/spack/repos/builtin/packages/nanoflann/package.py
new file mode 100644
index 0000000000..da0ec728b0
--- /dev/null
+++ b/var/spack/repos/builtin/packages/nanoflann/package.py
@@ -0,0 +1,39 @@
+##############################################################################
+# Copyright (c) 2013-2016, 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/llnl/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 Nanoflann(CMakePackage):
+ """a C++ header-only library for Nearest Neighbor (NN) search wih KD-trees.
+ """
+
+ homepage = "https://github.com/jlblancoc/nanoflann"
+ url = "https://github.com/jlblancoc/nanoflann/archive/v1.2.3.tar.gz"
+
+ version('1.2.3', '92a0f44a631c41aa06f9716c51dcdb11')
+
+ def cmake_args(self):
+ args = ['-DBUILD_SHARED_LIBS=ON']
+ return args
diff --git a/var/spack/repos/builtin/packages/sundials/package.py b/var/spack/repos/builtin/packages/sundials/package.py
index 66f385f29f..b0ad1c1f42 100644
--- a/var/spack/repos/builtin/packages/sundials/package.py
+++ b/var/spack/repos/builtin/packages/sundials/package.py
@@ -68,10 +68,18 @@ class Sundials(Package):
return 'ON' if varstr in self.spec else 'OFF'
cmake_args = std_cmake_args[:]
+
+ fortran_flag = self.compiler.pic_flag
+ if spec.satisfies('%clang platform=darwin'):
+ mpif77 = Executable(self.spec['mpi'].mpif77)
+ libgfortran = LibraryList(mpif77('--print-file-name',
+ 'libgfortran.a', output=str))
+ fortran_flag += ' ' + libgfortran.ld_flags
+
cmake_args.extend([
'-DBUILD_SHARED_LIBS=ON',
'-DCMAKE_C_FLAGS={0}'.format(self.compiler.pic_flag),
- '-DCMAKE_Fortran_FLAGS={0}'.format(self.compiler.pic_flag),
+ '-DCMAKE_Fortran_FLAGS={0}'.format(fortran_flag),
'-DEXAMPLES_ENABLE=ON',
'-DEXAMPLES_INSTALL=ON',
'-DFCMIX_ENABLE=ON',