Add missing doc variant to fenics package (#4473)

This commit is contained in:
Adam J. Stewart 2017-06-15 05:35:56 -05:00 committed by Todd Gamblin
parent 27e6e8715e
commit dc911661ca

View File

@ -25,7 +25,7 @@
from spack import * from spack import *
class Fenics(Package): class Fenics(CMakePackage):
"""FEniCS is organized as a collection of interoperable components """FEniCS is organized as a collection of interoperable components
that together form the FEniCS Project. These components include that together form the FEniCS Project. These components include
the problem-solving environment DOLFIN, the form compiler FFC, the the problem-solving environment DOLFIN, the form compiler FFC, the
@ -35,9 +35,10 @@ class Fenics(Package):
homepage = "http://fenicsproject.org/" homepage = "http://fenicsproject.org/"
url = "https://bitbucket.org/fenics-project/dolfin/downloads/dolfin-1.6.0.tar.gz" url = "https://bitbucket.org/fenics-project/dolfin/downloads/dolfin-1.6.0.tar.gz"
base_url = "https://bitbucket.org/fenics-project/{pkg}/downloads/{pkg}-{version}.tar.gz" base_url = "https://bitbucket.org/fenics-project/{pkg}/downloads/{pkg}-{version}.tar.gz"
python_components = ['ufl', 'ffc', 'fiat', 'instant']
variant('hdf5', default=True, description='Compile with HDF5') variant('hdf5', default=True, description='Compile with HDF5')
variant('parmetis', default=True, description='Compile with ParMETIS') variant('parmetis', default=True, description='Compile with ParMETIS')
variant('scotch', default=True, description='Compile with Scotch') variant('scotch', default=True, description='Compile with Scotch')
@ -56,6 +57,8 @@ class Fenics(Package):
description='Enables the build of shared libraries') description='Enables the build of shared libraries')
variant('debug', default=False, variant('debug', default=False,
description='Builds a debug version of the libraries') description='Builds a debug version of the libraries')
variant('doc', default=False,
description='Builds the documentation')
# not part of spack list for now # not part of spack list for now
# variant('petsc4py', default=True, description='Uses PETSc4py') # variant('petsc4py', default=True, description='Uses PETSc4py')
@ -68,7 +71,7 @@ class Fenics(Package):
extends('python') extends('python')
depends_on('eigen@3.2.0:', type='build') depends_on('eigen@3.2.0:')
depends_on('boost+filesystem+program_options+system+iostreams+timer+regex+chrono') depends_on('boost+filesystem+program_options+system+iostreams+timer+regex+chrono')
depends_on('mpi', when='+mpi') depends_on('mpi', when='+mpi')
@ -88,7 +91,7 @@ class Fenics(Package):
depends_on('py-numpy', type=('build', 'run')) depends_on('py-numpy', type=('build', 'run'))
depends_on('py-sympy', type=('build', 'run')) depends_on('py-sympy', type=('build', 'run'))
depends_on('swig@3.0.3:', type=('build', 'run')) depends_on('swig@3.0.3:', type=('build', 'run'))
depends_on('cmake@2.8.12:', type=('build', 'run')) depends_on('cmake@2.8.12:', type='build')
depends_on('py-setuptools', type='build') depends_on('py-setuptools', type='build')
depends_on('py-sphinx@1.0.1:', when='+doc', type='build') depends_on('py-sphinx@1.0.1:', when='+doc', type='build')
@ -140,14 +143,14 @@ class Fenics(Package):
def cmake_is_on(self, option): def cmake_is_on(self, option):
return 'ON' if option in self.spec else 'OFF' return 'ON' if option in self.spec else 'OFF'
def install(self, spec, prefix): def cmake_args(self):
for package in ['ufl', 'ffc', 'fiat', 'instant']: spec = self.spec
with working_dir(join_path('depends', package)):
setup_py('install', '--prefix=%s' % prefix)
cmake_args = [ return [
'-DCMAKE_BUILD_TYPE:STRING={0}'.format( '-DCMAKE_BUILD_TYPE:STRING={0}'.format(
'Debug' if '+debug' in spec else 'RelWithDebInfo'), 'Debug' if '+debug' in spec else 'RelWithDebInfo'),
'-DDOLFIN_ENABLE_DOCS:BOOL={0}'.format(
self.cmake_is_on('+doc')),
'-DBUILD_SHARED_LIBS:BOOL={0}'.format( '-DBUILD_SHARED_LIBS:BOOL={0}'.format(
self.cmake_is_on('+shared')), self.cmake_is_on('+shared')),
'-DDOLFIN_SKIP_BUILD_TESTS:BOOL=ON', '-DDOLFIN_SKIP_BUILD_TESTS:BOOL=ON',
@ -189,10 +192,14 @@ def install(self, spec, prefix):
self.cmake_is_on('zlib')), self.cmake_is_on('zlib')),
] ]
cmake_args.extend(std_cmake_args) @run_after('build')
def build_python_components(self):
for package in self.python_components:
with working_dir(join_path('depends', package)):
setup_py('build')
with working_dir('build', create=True): @run_after('install')
cmake('..', *cmake_args) def install_python_components(self):
for package in self.python_components:
make() with working_dir(join_path('depends', package)):
make('install') setup_py('install', '--prefix={0}'.format(self.prefix))