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
This commit is contained in:
Scot Halverson 2021-12-13 11:06:57 -07:00 committed by GitHub
parent f876813531
commit 28d31316b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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')