diff options
author | Nils Leif Fischer <nils.fischer@aei.mpg.de> | 2022-01-28 11:40:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-28 11:40:02 +0100 |
commit | d80241a2037f526d8d97f778345d1a6810f2cae1 (patch) | |
tree | 82aa996fc94e417c191d4b6331302c73cd015888 | |
parent | 1e1e3ae80aec77d00dd0011557e14e6978c7653b (diff) | |
download | spack-d80241a2037f526d8d97f778345d1a6810f2cae1.tar.gz spack-d80241a2037f526d8d97f778345d1a6810f2cae1.tar.bz2 spack-d80241a2037f526d8d97f778345d1a6810f2cae1.tar.xz spack-d80241a2037f526d8d97f778345d1a6810f2cae1.zip |
spectre: allow disabling debug symbols (#28511)
* spectre: allow disabling debug symbols
* spectre: fix PCH builds
* spectre: support builds with shared libs
-rw-r--r-- | var/spack/repos/builtin/packages/spectre/package.py | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/var/spack/repos/builtin/packages/spectre/package.py b/var/spack/repos/builtin/packages/spectre/package.py index ba1d911fca..73abce11f6 100644 --- a/var/spack/repos/builtin/packages/spectre/package.py +++ b/var/spack/repos/builtin/packages/spectre/package.py @@ -47,10 +47,18 @@ class Spectre(CMakePackage): description="Executables to install") variant('python', default=False, description="Build Python bindings") variant('doc', default=False, description="Build documentation") - # TODO: support installation of executables with shared libs - # variant('shared', - # default=False, - # description="Build shared libraries instead of static") + # Build type and debug symbols: + # - Both Debug and Release builds have debug symbols enabled by default in + # the SpECTRE build system, so we can view backtraces, etc., when + # production code fails. + variant('build_type', values=('Debug', 'Release'), + default='Release', description='CMake build type') + # - Allow disabling debug symbols to reduce memory usage and executable size + variant('debug_symbols', default=True, + description="Build with debug symbols") + variant('shared', + default=False, + description="Build shared libraries instead of static") variant('memory_allocator', values=('system', 'jemalloc'), multi=False, @@ -110,6 +118,11 @@ class Spectre(CMakePackage): depends_on('py-beautifulsoup4', type='build') depends_on('py-pybtex', type='build') + # Incompatibilities + # - Shared libs builds on macOS don't work before + # https://github.com/sxs-collaboration/spectre/pull/2680 + conflicts('+shared', when='@:2022.01.03 platform=darwin') + # These patches backport updates to the SpECTRE build system to earlier # releases, to support installing them with Spack. In particular, we try to # support releases associated with published papers, so their results are @@ -155,11 +168,21 @@ class Spectre(CMakePackage): 'https://github.com/sxs-collaboration/spectre/commit/1b61e62a27b02b658cc6a74c4d46af1f5b5d0a4d.patch', sha256='07be176ca4dda74a2dd8e71c31dab638a9f3567c3a58eb7fddbfde001646fb8c', when='@:2022.01.03') + # - Backport fix for PCH builds with Spack + patch( + 'https://github.com/sxs-collaboration/spectre/commit/4bb3f25f905f83d8295a28a8036f6971dc4e75a2.patch', + sha256='cd39217614a40f080d812e20220044aa8b26b9413324a7cd7a304e2378a2b426', + when='@:2022.01.03') + # - Backport installation of shared libs + patch( + 'https://github.com/sxs-collaboration/spectre/commit/b7c54a2a20c6d62aae6b1c97e3468d4cd39ed6ad.patch', + sha256='29ad44594ecfd6442a64d2cb57ed2d712cb8d93707c6bceea8030a9a2682b7ed', + when='@:2022.01.03 +shared') def cmake_args(self): args = [ self.define('CHARM_ROOT', self.spec['charmpp'].prefix), - # self.define_from_variant('BUILD_SHARED_LIBS', 'shared'), + self.define_from_variant('BUILD_SHARED_LIBS', 'shared'), self.define('Python_EXECUTABLE', self.spec['python'].command.path), self.define_from_variant('BUILD_PYTHON_BINDINGS', 'python'), self.define('BUILD_TESTING', self.run_tests), @@ -168,8 +191,8 @@ class Spectre(CMakePackage): self.define_from_variant('USE_FORMALINE', 'formaline'), self.define_from_variant('MEMORY_ALLOCATOR').upper(), self.define_from_variant('ENABLE_PROFILING', 'profiling'), - # TODO: Fix PCH builds to reduce compile time - self.define('USE_PCH', False), + self.define('USE_PCH', True), + self.define_from_variant('DEBUG_SYMBOLS'), ] # Allow for more time on slower machines if self.run_tests: |