Skip to content
Snippets Groups Projects
Commit b89bcdff authored by Kelly (KT) Thompson's avatar Kelly (KT) Thompson
Browse files

Make Boost an optional feature of Trilinos.

I have been unable to build Boost with some toolset/platform combinations. The
users I support don't need the Boost features in Trilinos, so I have been
manually hacking trilinos/package.py to disable boost. I would like to propose
that these changes be added to the released version.

+ Add boost as a variant, default to true so there is no change to existing
  behavior.
+ Move the CMake configure options related to Boost into a conditional block
  that is triggered by "if '+boost' in spec".
parent bc038eb7
No related branches found
No related tags found
No related merge requests found
...@@ -58,11 +58,12 @@ class Trilinos(Package): ...@@ -58,11 +58,12 @@ class Trilinos(Package):
variant('python', default=False, description='Build python wrappers') variant('python', default=False, description='Build python wrappers')
variant('shared', default=True, description='Enables the build of shared libraries') variant('shared', default=True, description='Enables the build of shared libraries')
variant('debug', default=False, description='Builds a debug version of the libraries') variant('debug', default=False, description='Builds a debug version of the libraries')
variant('boost', default=True, description='Compile with Boost')
# Everything should be compiled with -fpic # Everything should be compiled with -fpic
depends_on('blas') depends_on('blas')
depends_on('lapack') depends_on('lapack')
depends_on('boost') depends_on('boost', when='+boost')
depends_on('matio') depends_on('matio')
depends_on('glm') depends_on('glm')
depends_on('swig') depends_on('swig')
...@@ -121,9 +122,6 @@ def install(self, spec, prefix): ...@@ -121,9 +122,6 @@ def install(self, spec, prefix):
'-DTPL_ENABLE_LAPACK=ON', '-DTPL_ENABLE_LAPACK=ON',
'-DLAPACK_LIBRARY_NAMES=lapack', '-DLAPACK_LIBRARY_NAMES=lapack',
'-DLAPACK_LIBRARY_DIRS=%s' % spec['lapack'].prefix, '-DLAPACK_LIBRARY_DIRS=%s' % spec['lapack'].prefix,
'-DTPL_ENABLE_Boost:BOOL=ON',
'-DBoost_INCLUDE_DIRS:PATH=%s' % spec['boost'].prefix.include,
'-DBoost_LIBRARY_DIRS:PATH=%s' % spec['boost'].prefix.lib,
'-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON', '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON',
'-DTrilinos_ENABLE_CXX11:BOOL=ON', '-DTrilinos_ENABLE_CXX11:BOOL=ON',
'-DTPL_ENABLE_Netcdf:BOOL=ON', '-DTPL_ENABLE_Netcdf:BOOL=ON',
...@@ -131,6 +129,14 @@ def install(self, spec, prefix): ...@@ -131,6 +129,14 @@ def install(self, spec, prefix):
'-DTPL_ENABLE_HDF5:BOOL=%s' % ('ON' if '+hdf5' in spec else 'OFF'), '-DTPL_ENABLE_HDF5:BOOL=%s' % ('ON' if '+hdf5' in spec else 'OFF'),
]) ])
if '+boost' in spec:
options.extend([
'-DTPL_ENABLE_Boost:BOOL=ON',
'-DBoost_INCLUDE_DIRS:PATH=%s' % spec['boost'].prefix.include,
'-DBoost_LIBRARY_DIRS:PATH=%s' % spec['boost'].prefix.lib
])
else:
options.extend(['-DTPL_ENABLE_Boost:BOOL=OFF'])
# Fortran lib # Fortran lib
libgfortran = os.path.dirname (os.popen('%s --print-file-name libgfortran.a' % join_path(mpi_bin,'mpif90') ).read()) libgfortran = os.path.dirname (os.popen('%s --print-file-name libgfortran.a' % join_path(mpi_bin,'mpif90') ).read())
options.extend([ options.extend([
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment