summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Paul Pelteret <jppelteret@gmail.com>2017-01-24 18:00:27 +0100
committerTodd Gamblin <tgamblin@llnl.gov>2017-01-24 10:00:27 -0700
commit416e52c150addbfa0f81a70f422f35494a92cfd2 (patch)
tree2efa65d3e31689103b52b7d092a48aa543330c69
parentdb7a786d1cb61ee87d84c52781740440d8632096 (diff)
downloadspack-416e52c150addbfa0f81a70f422f35494a92cfd2.tar.gz
spack-416e52c150addbfa0f81a70f422f35494a92cfd2.tar.bz2
spack-416e52c150addbfa0f81a70f422f35494a92cfd2.tar.xz
spack-416e52c150addbfa0f81a70f422f35494a92cfd2.zip
Update SymEngine package (#2919)
Take advantage of new configuration options in the @develop branch
-rw-r--r--var/spack/repos/builtin/packages/symengine/package.py82
1 files changed, 48 insertions, 34 deletions
diff --git a/var/spack/repos/builtin/packages/symengine/package.py b/var/spack/repos/builtin/packages/symengine/package.py
index f3fc13474c..e3c00f849a 100644
--- a/var/spack/repos/builtin/packages/symengine/package.py
+++ b/var/spack/repos/builtin/packages/symengine/package.py
@@ -23,9 +23,10 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
+import sys
-class Symengine(Package):
+class Symengine(CMakePackage):
"""SymEngine is a fast symbolic manipulation library, written in C++."""
homepage = "https://github.com/symengine/symengine"
@@ -35,7 +36,9 @@ class Symengine(Package):
version('0.1.0', '41ad7daed61fc5a77c285eb6c7303425')
version('develop', git='https://github.com/symengine/symengine.git')
- variant('flint', default=True,
+ variant('boostmp', default=False,
+ description='Compile with Boost multi-precision integer library')
+ variant('flint', default=False,
description='Compile with Flint integer library')
variant('mpc', default=True,
description='Compile with MPC library')
@@ -54,20 +57,22 @@ class Symengine(Package):
depends_on('cmake', type='build')
# Other dependencies
- depends_on('gmp') # mpir is a drop-in replacement for this
- depends_on('mpc', when='+mpc') # Could also be built against mpir
- depends_on('mpfr', when='+mpfr') # Could also be built against mpir
- depends_on('flint', when='+flint') # Could also be built against mpir
- depends_on('piranha', when='+piranha~flint') # Could also be built against mpir # NOQA
+ # NOTE: mpir is a drop-in replacement for gmp
+ # NOTE: [mpc,mpfr,flint,piranha] could also be built against mpir
+ depends_on('boost', when='+boostmp')
+ depends_on('gmp', when='~boostmp')
+ depends_on('mpc', when='+mpc~boostmp')
+ depends_on('mpfr', when='+mpfr~boostmp')
+ depends_on('flint', when='+flint~boostmp')
+ depends_on('piranha', when='+piranha~flint~boostmp')
- def install(self, spec, prefix):
- options = []
- options.extend(std_cmake_args)
+ def build_type(self):
+ # CMAKE_BUILD_TYPE should be Debug | Release
+ return 'Release'
- # CMAKE_BUILD_TYPE should be Debug | Release
- for word in options[:]:
- if word.startswith('-DCMAKE_BUILD_TYPE'):
- options.remove(word)
+ def cmake_args(self):
+ spec = self.spec
+ options = []
# See https://github.com/symengine/symengine/blob/master/README.md
# for build options
@@ -76,38 +81,47 @@ class Symengine(Package):
'-DWITH_SYMENGINE_RCP:BOOL=ON',
'-DWITH_SYMENGINE_THREAD_SAFE:BOOL=%s' % (
'ON' if ('+thread_safe' or '+openmp') in spec else 'OFF'),
- '-DBUILD_TESTS:BOOL=ON',
+ '-DBUILD_TESTS:BOOL=%s' % (
+ 'ON' if self.run_tests else 'OFF'),
'-DBUILD_BENCHMARKS:BOOL=ON',
- '-DWITH_MPC:BOOL=%s' % (
- 'ON' if '+mpc' in spec else 'OFF'),
- '-DWITH_MPFR:BOOL=%s' % (
- 'ON' if '+mpfr' in spec else 'OFF'),
- '-DINTEGER_CLASS:STRING=gmp',
'-DWITH_OPENMP:BOOL=%s' % (
'ON' if '+openmp' in spec else 'OFF'),
'-DBUILD_SHARED_LIBS:BOOL=%s' % (
'ON' if '+shared' in spec else 'OFF'),
])
- if '+flint' in spec:
+ if sys.platform == 'darwin':
options.extend([
- '-DWITH_FLINT:BOOL=ON',
- '-DINTEGER_CLASS:STRING=flint'
+ '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=on'
])
- elif '+piranha' in spec:
+
+ if '+boostmp' in spec:
options.extend([
- '-DWITH_PIRANHA:BOOL=ON',
- '-DINTEGER_CLASS:STRING=piranha'
+ '-DINTEGER_CLASS:STRING=boostmp',
+ '-DBoost_INCLUDE_DIR=%s' % spec['boost'].prefix.include,
+ '-DWITH_MPC:BOOL=OFF',
+ '-DWITH_MPFR:BOOL=OFF',
])
else:
options.extend([
- '-DINTEGER_CLASS:STRING=gmp'
+ '-DWITH_MPC:BOOL=%s' % (
+ 'ON' if '+mpc' in spec else 'OFF'),
+ '-DWITH_MPFR:BOOL=%s' % (
+ 'ON' if '+mpfr' in spec else 'OFF'),
])
+ if '+flint' in spec:
+ options.extend([
+ '-DWITH_FLINT:BOOL=ON',
+ '-DINTEGER_CLASS:STRING=flint'
+ ])
+ elif '+piranha' in spec:
+ options.extend([
+ '-DWITH_PIRANHA:BOOL=ON',
+ '-DINTEGER_CLASS:STRING=piranha'
+ ])
+ else:
+ options.extend([
+ '-DINTEGER_CLASS:STRING=gmp'
+ ])
- with working_dir('spack-build', create=True):
- cmake('..', *options)
-
- make()
- make('install')
- if self.run_tests:
- ctest()
+ return options