From 28d31316b759d42b17fca769a7f190882335e55e Mon Sep 17 00:00:00 2001 From: Scot Halverson Date: Mon, 13 Dec 2021 11:06:57 -0700 Subject: [PATCH] CPU Architecture support (#27924) * CPU Architecture Support This commit removes the `native` variant in favor of Spack's built-in support for specifying a target cpu architecture. It also passes this information to the Legion build system so that it correctly passes the architecture to GASNet when built internally * fixing whitespace * Update package.py based on a conversation with @streichler, this change sets `BUILD_MARCH` to an empty string, which will prevent legion's CMake build system from inserting `-march=native` and allow Spack to provide the correct architecture flags. * Update package.py adding a comment on what problem this MR solves. * Update package.py formatting --- var/spack/repos/builtin/packages/legion/package.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/var/spack/repos/builtin/packages/legion/package.py b/var/spack/repos/builtin/packages/legion/package.py index 85373b53fb..fe13d19736 100644 --- a/var/spack/repos/builtin/packages/legion/package.py +++ b/var/spack/repos/builtin/packages/legion/package.py @@ -198,9 +198,6 @@ def validate_gasnet_root(value): variant('max_fields', values=int, default=512, description="Maximum number of fields allowed in a logical region.") - variant('native', default=False, - description="Enable native/host processor optimizaton target.") - def cmake_args(self): spec = self.spec cmake_cxx_flags = [] @@ -339,10 +336,9 @@ def cmake_args(self): maxfields = maxfields << 1 options.append('-DLegion_MAX_FIELDS=%d' % maxfields) - if '+native' in spec: - # default is off. - options.append('-DBUILD_MARCH:STRING=native') - + # This disables Legion's CMake build system's logic for targeting the native + # CPU architecture in favor of Spack-provided compiler flags + options.append('-DBUILD_MARCH:STRING=') return options @run_after('install')