Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion easybuild/framework/easyconfig/easyconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
from easybuild.tools.modules import modules_tool
from easybuild.tools.py2vs3 import OrderedDict, create_base_metaclass, string_type
from easybuild.tools.systemtools import check_os_dependency, pick_dep_version
from easybuild.tools.systemtools import get_cpu_architecture, AARCH64
from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME, is_system_toolchain
from easybuild.tools.toolchain.toolchain import TOOLCHAIN_CAPABILITIES, TOOLCHAIN_CAPABILITY_CUDA
from easybuild.tools.toolchain.utilities import get_toolchain, search_toolchain
Expand All @@ -96,6 +97,9 @@
# prefix for names of local variables in easyconfig files
LOCAL_VAR_PREFIX = 'local_'

ARCH_HARD_FILTER = {
AARCH64: ['Yasm'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'm not a big fan of this approach...

I would rather implement something more flexible, where you can configure EasyBuild to opt-in to or opt-out of optional dependencies based on certain condition (i.e. aarch64, GPU system, etc.).

In this particular case, configuring EasyBuild with --filter-deps=Yasm should be sufficient?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ugly for sure. Using --filter-deps=Yasm should work, but it would need to always be done so for aarch64.

Dynamic dependencies would be interesting, could spiral into "we depend on cuda if we see a compatible GPU", but absolute exceptions like Yasm would need to be defined somewhere in EasyBuild itself. I have no good/better ideas on how to achieve that.

}

try:
import autopep8
Expand Down Expand Up @@ -986,8 +990,23 @@ def parse_filter_deps(self):
"""Parse specifications for which dependencies should be filtered."""
res = {}

filter_list = []

build_option_filter_deps = build_option('filter_deps')
if build_option_filter_deps:
filter_list.extend(build_option_filter_deps)

# Architecture specific filtering.
try:
arch = get_cpu_architecture()
arch_filter = ARCH_HARD_FILTER[arch]
filter_list.extend(arch_filter)
self.log.warning("Hard architecture filtering of " + ','.join(arch_filter) + " for " + self.name)
except KeyError:
pass

separator = '='
for filter_dep_spec in build_option('filter_deps') or []:
for filter_dep_spec in filter_list:
if separator in filter_dep_spec:
dep_specs = filter_dep_spec.split(separator)
if len(dep_specs) == 2:
Expand Down