summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAlberto Chiusole <bebosudo@users.noreply.github.com>2018-11-13 17:55:01 +0100
committerAdam J. Stewart <ajstewart426@gmail.com>2018-11-13 10:55:01 -0600
commit7938ff9653b626d8f8ed1c31b2819890b2afd3b2 (patch)
tree4360f81995d728140eba5dfeeb50ac7d4975a114 /var
parent63535542a171c7c7882ae62c94d213ed59ab81c4 (diff)
downloadspack-7938ff9653b626d8f8ed1c31b2819890b2afd3b2.tar.gz
spack-7938ff9653b626d8f8ed1c31b2819890b2afd3b2.tar.bz2
spack-7938ff9653b626d8f8ed1c31b2819890b2afd3b2.tar.xz
spack-7938ff9653b626d8f8ed1c31b2819890b2afd3b2.zip
Add pic variant to cflags in boost. (#9750)
* Add pic variant to cflags in boost. * Improve description in pic variant of boost, see #9750.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/boost/package.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py
index 5b51187fea..17feb25fc3 100644
--- a/var/spack/repos/builtin/packages/boost/package.py
+++ b/var/spack/repos/builtin/packages/boost/package.py
@@ -122,6 +122,9 @@ class Boost(Package):
description='Compile with clang libc++ instead of libstdc++')
variant('numpy', default=False,
description='Build the Boost NumPy library (requires +python)')
+ variant('pic', default=False,
+ description='Generate position-independent code (PIC), useful '
+ 'for building static libraries')
depends_on('icu4c', when='+icu')
depends_on('python', when='+python')
@@ -213,14 +216,12 @@ class Boost(Package):
spack_cxx))
if '+mpi' in spec:
-
# Use the correct mpi compiler. If the compiler options are
# empty or undefined, Boost will attempt to figure out the
# correct options by running "${mpicxx} -show" or something
# similar, but that doesn't work with the Cray compiler
# wrappers. Since Boost doesn't use the MPI C++ bindings,
# that can be used as a compiler option instead.
-
mpi_line = 'using mpi : %s' % spec['mpi'].mpicxx
if 'platform=cray' in spec:
@@ -313,6 +314,9 @@ class Boost(Package):
if flag:
cxxflags.append(flag)
+ if '+pic' in self.spec:
+ cxxflags.append(self.compiler.pic_flag)
+
# clang is not officially supported for pre-compiled headers
# and at least in clang 3.9 still fails to build
# http://www.boost.org/build/doc/html/bbv2/reference/precompiled_headers.html