Merge pull request #1028 from JRWynneIII/boost-graph-parallel-fix
Add variant for boost graph and parallel graph
This commit is contained in:
commit
9dd1f2747a
@ -27,7 +27,7 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
|
|
||||||
class Boost(Package):
|
class Boost(Package):
|
||||||
"""Boost provides free peer-reviewed portable C++ source
|
"""Boost provides free peer-reviewed portable C++ source
|
||||||
@ -109,6 +109,7 @@ class Boost(Package):
|
|||||||
variant('multithreaded', default=True, description="Build multi-threaded versions of libraries")
|
variant('multithreaded', default=True, description="Build multi-threaded versions of libraries")
|
||||||
variant('singlethreaded', default=True, description="Build single-threaded versions of libraries")
|
variant('singlethreaded', default=True, description="Build single-threaded versions of libraries")
|
||||||
variant('icu_support', default=False, description="Include ICU support (for regex/locale libraries)")
|
variant('icu_support', default=False, description="Include ICU support (for regex/locale libraries)")
|
||||||
|
variant('graph', default=False, description="Build the Boost Graph library")
|
||||||
|
|
||||||
depends_on('icu', when='+icu_support')
|
depends_on('icu', when='+icu_support')
|
||||||
depends_on('python', when='+python')
|
depends_on('python', when='+python')
|
||||||
@ -120,12 +121,15 @@ class Boost(Package):
|
|||||||
patch('boost_11856.patch', when='@1.60.0%gcc@4.4.7')
|
patch('boost_11856.patch', when='@1.60.0%gcc@4.4.7')
|
||||||
|
|
||||||
def url_for_version(self, version):
|
def url_for_version(self, version):
|
||||||
"""Handle Boost's weird URLs, which write the version two different ways."""
|
"""
|
||||||
|
Handle Boost's weird URLs,
|
||||||
|
which write the version two different ways.
|
||||||
|
"""
|
||||||
parts = [str(p) for p in Version(version)]
|
parts = [str(p) for p in Version(version)]
|
||||||
dots = ".".join(parts)
|
dots = ".".join(parts)
|
||||||
underscores = "_".join(parts)
|
underscores = "_".join(parts)
|
||||||
return "http://downloads.sourceforge.net/project/boost/boost/%s/boost_%s.tar.bz2" % (
|
return "http://downloads.sourceforge.net/project/boost" \
|
||||||
dots, underscores)
|
"/boost/%s/boost_%s.tar.bz2" % (dots, underscores)
|
||||||
|
|
||||||
def determine_toolset(self, spec):
|
def determine_toolset(self, spec):
|
||||||
if spec.satisfies("arch=darwin-x86_64"):
|
if spec.satisfies("arch=darwin-x86_64"):
|
||||||
@ -178,8 +182,7 @@ def determine_b2_options(self, spec, options):
|
|||||||
'-s', 'BZIP2_INCLUDE=%s' % spec['bzip2'].prefix.include,
|
'-s', 'BZIP2_INCLUDE=%s' % spec['bzip2'].prefix.include,
|
||||||
'-s', 'BZIP2_LIBPATH=%s' % spec['bzip2'].prefix.lib,
|
'-s', 'BZIP2_LIBPATH=%s' % spec['bzip2'].prefix.lib,
|
||||||
'-s', 'ZLIB_INCLUDE=%s' % spec['zlib'].prefix.include,
|
'-s', 'ZLIB_INCLUDE=%s' % spec['zlib'].prefix.include,
|
||||||
'-s', 'ZLIB_LIBPATH=%s' % spec['zlib'].prefix.lib,
|
'-s', 'ZLIB_LIBPATH=%s' % spec['zlib'].prefix.lib])
|
||||||
])
|
|
||||||
|
|
||||||
linkTypes = ['static']
|
linkTypes = ['static']
|
||||||
if '+shared' in spec:
|
if '+shared' in spec:
|
||||||
@ -191,7 +194,8 @@ def determine_b2_options(self, spec, options):
|
|||||||
if '+singlethreaded' in spec:
|
if '+singlethreaded' in spec:
|
||||||
threadingOpts.append('single')
|
threadingOpts.append('single')
|
||||||
if not threadingOpts:
|
if not threadingOpts:
|
||||||
raise RuntimeError("At least one of {singlethreaded, multithreaded} must be enabled")
|
raise RuntimeError("""At least one of {singlethreaded,
|
||||||
|
multithreaded} must be enabled""")
|
||||||
|
|
||||||
options.extend([
|
options.extend([
|
||||||
'toolset=%s' % self.determine_toolset(spec),
|
'toolset=%s' % self.determine_toolset(spec),
|
||||||
@ -202,9 +206,9 @@ def determine_b2_options(self, spec, options):
|
|||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
# On Darwin, Boost expects the Darwin libtool. However, one of the
|
# On Darwin, Boost expects the Darwin libtool. However, one of the
|
||||||
# dependencies may have pulled in Spack's GNU libtool, and these two are
|
# dependencies may have pulled in Spack's GNU libtool, and these two
|
||||||
# not compatible. We thus create a symlink to Darwin's libtool and add
|
# are not compatible. We thus create a symlink to Darwin's libtool
|
||||||
# it at the beginning of PATH.
|
# and add it at the beginning of PATH.
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
newdir = os.path.abspath('darwin-libtool')
|
newdir = os.path.abspath('darwin-libtool')
|
||||||
mkdirp(newdir)
|
mkdirp(newdir)
|
||||||
@ -217,7 +221,8 @@ def install(self, spec, prefix):
|
|||||||
withLibs.append(lib)
|
withLibs.append(lib)
|
||||||
if not withLibs:
|
if not withLibs:
|
||||||
# if no libraries are specified for compilation, then you dont have
|
# if no libraries are specified for compilation, then you dont have
|
||||||
# to configure/build anything, just copy over to the prefix directory.
|
# to configure/build anything, just copy over to the prefix
|
||||||
|
# directory.
|
||||||
src = join_path(self.stage.source_path, 'boost')
|
src = join_path(self.stage.source_path, 'boost')
|
||||||
mkdirp(join_path(prefix, 'include'))
|
mkdirp(join_path(prefix, 'include'))
|
||||||
dst = join_path(prefix, 'include', 'boost')
|
dst = join_path(prefix, 'include', 'boost')
|
||||||
@ -235,6 +240,9 @@ def install(self, spec, prefix):
|
|||||||
withLibs.remove('chrono')
|
withLibs.remove('chrono')
|
||||||
if not spec.satisfies('@1.43.0:'):
|
if not spec.satisfies('@1.43.0:'):
|
||||||
withLibs.remove('random')
|
withLibs.remove('random')
|
||||||
|
if '+graph' in spec and '+mpi' in spec:
|
||||||
|
withLibs.remove('graph')
|
||||||
|
withLibs.append('graph_parallel')
|
||||||
|
|
||||||
# to make Boost find the user-config.jam
|
# to make Boost find the user-config.jam
|
||||||
env['BOOST_BUILD_PATH'] = './'
|
env['BOOST_BUILD_PATH'] = './'
|
||||||
@ -259,6 +267,7 @@ def install(self, spec, prefix):
|
|||||||
for threadingOpt in threadingOpts:
|
for threadingOpt in threadingOpts:
|
||||||
b2('install', 'threading=%s' % threadingOpt, *b2_options)
|
b2('install', 'threading=%s' % threadingOpt, *b2_options)
|
||||||
|
|
||||||
# The shared libraries are not installed correctly on Darwin; correct this
|
# The shared libraries are not installed correctly
|
||||||
|
# on Darwin; correct this
|
||||||
if (sys.platform == 'darwin') and ('+shared' in spec):
|
if (sys.platform == 'darwin') and ('+shared' in spec):
|
||||||
fix_darwin_install_name(prefix.lib)
|
fix_darwin_install_name(prefix.lib)
|
||||||
|
Loading…
Reference in New Issue
Block a user