Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion mfc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ if [ $code -ne 0 ]; then
fi

# Deactivate the Python virtualenv in case the user "source"'d this script.
# In prebuilt/spack mode the venv was never created, so there's nothing to deactivate.
# Guard against the case where no venv was activated (e.g. system Python).
if type deactivate > /dev/null 2>&1; then
log "(venv) Exiting the$MAGENTA Python$COLOR_RESET virtual environment."
deactivate
Expand Down
6 changes: 0 additions & 6 deletions toolchain/bootstrap/python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ MFC_PYTHON_MIN_MAJOR=3
MFC_PYTHON_MIN_MINOR=9
MFC_PYTHON_MIN_STR="$MFC_PYTHON_MIN_MAJOR.$MFC_PYTHON_MIN_MINOR"

# Prebuilt/spack mode: skip the venv entirely. The caller must already have
# python3 + the MFC toolchain deps + the `mfc` package importable on PYTHONPATH.
if [ -n "${MFC_PREBUILT_PREFIX:-}" ]; then
return 0
fi

is_python_compatible() {
if ! ${1:-python3} -c "import sys; exit(int(not (sys.version_info[0]==$MFC_PYTHON_MIN_MAJOR and sys.version_info[1] >= $MFC_PYTHON_MIN_MINOR)))"; then
return 1
Expand Down
8 changes: 1 addition & 7 deletions toolchain/mfc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from rich.text import Text

from .case import Case
from .common import MFCException, create_directory, debug, delete_directory, format_list_to_string, get_prebuilt_prefix, system
from .common import MFCException, create_directory, debug, delete_directory, format_list_to_string, system
from .printer import cons
from .run import input
from .state import ARG, CFG, gpuConfigOptions
Expand Down Expand Up @@ -336,9 +336,6 @@ def get_home_dirpath(self) -> str:
return os.sep.join([os.getcwd()])

def get_install_binpath(self, case: Case) -> str:
prebuilt = get_prebuilt_prefix()
if prebuilt:
return os.sep.join([prebuilt, "bin", self.name])
# <root>/install/<slug>/bin/<target>
return os.sep.join([self.get_install_dirpath(case), "bin", self.name])

Expand All @@ -362,9 +359,6 @@ def is_buildable(self) -> bool:
if ARG("no_build"):
return False

if get_prebuilt_prefix():
return False

if self.isDependency and ARG(f"sys_{self.name}", False):
return False

Expand Down
16 changes: 0 additions & 16 deletions toolchain/mfc/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,6 @@
default=False,
dest="no_build",
),
Argument(
name="prebuilt-prefix",
help="Use prebuilt MFC binaries from <PREFIX>/bin (e.g. a Spack install prefix). Implies --no-build. Also settable via MFC_PREBUILT_PREFIX.",
type=str,
default=None,
metavar="PREFIX",
dest="prebuilt_prefix",
),
Argument(
name="wait",
help="(Batch) Wait for the job to finish.",
Expand Down Expand Up @@ -445,14 +437,6 @@
default=False,
dest="no_build",
),
Argument(
name="prebuilt-prefix",
help="Use prebuilt MFC binaries from <PREFIX>/bin (e.g. a Spack install prefix). Implies --no-build. Also settable via MFC_PREBUILT_PREFIX.",
type=str,
default=None,
metavar="PREFIX",
dest="prebuilt_prefix",
),
Argument(
name="no-examples",
help="Do not test example cases.",
Expand Down
11 changes: 0 additions & 11 deletions toolchain/mfc/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,6 @@ def debug(msg: str):
MFC_BENCH_FILEPATH = abspath(join(MFC_TOOLCHAIN_DIR, "bench.yaml"))
MFC_MECHANISMS_DIR = abspath(join(MFC_TOOLCHAIN_DIR, "mechanisms"))


def get_prebuilt_prefix() -> typing.Optional[str]:
# Returns the prebuilt install prefix when MFC is run against pre-built binaries
# (e.g. a Spack install). The CLI flag --prebuilt-prefix takes precedence over the
# MFC_PREBUILT_PREFIX environment variable. Returns None when running normally.
from .state import ARG

cli = ARG("prebuilt_prefix", "") or None
return cli or os.environ.get("MFC_PREBUILT_PREFIX") or None


MFC_LOGO = """\
.=++*: -+*+=.
:+ -*- == =* .
Expand Down
Loading