Skip to content

Commit

Permalink
tasks: fix llvm major version usage
Browse files Browse the repository at this point in the history
  • Loading branch information
csegarragonz committed Feb 13, 2024
1 parent 97ca4fc commit 874402d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
9 changes: 4 additions & 5 deletions tasks/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
FAABRIC_SHARED_BUILD_DIR,
FAABRIC_STATIC_BUILD_DIR,
FAABRIC_INSTALL_PREFIX,
LLVM_VERSION,
LLVM_VERSION_MAJOR,
PROJ_ROOT,
)

Expand Down Expand Up @@ -41,15 +41,14 @@ def cmake(
if build not in build_types:
raise RuntimeError("Expected build to be in {}".format(build_types))

llvm_major_version = LLVM_VERSION.split(".")[0]
cmd = [
"cmake",
"-GNinja",
"-DCMAKE_INSTALL_PREFIX={}".format(FAABRIC_INSTALL_PREFIX),
"-DCMAKE_BUILD_TYPE={}".format(build),
"-DBUILD_SHARED_LIBS={}".format("ON" if shared else "OFF"),
"-DCMAKE_CXX_COMPILER=/usr/bin/clang++-{}".format(llvm_major_version),
"-DCMAKE_C_COMPILER=/usr/bin/clang-{}".format(llvm_major_version),
"-DCMAKE_CXX_COMPILER=/usr/bin/clang++-{}".format(LLVM_VERSION_MAJOR),
"-DCMAKE_C_COMPILER=/usr/bin/clang-{}".format(LLVM_VERSION_MAJOR),
"-DFAABRIC_USE_SANITISER={}".format(sanitiser),
"-DFAABRIC_SELF_TRACING=ON" if prof else "",
"-DFAABRIC_CODE_COVERAGE=ON" if coverage else "",
Expand Down Expand Up @@ -120,7 +119,7 @@ def coverage_report(ctx, file_in, file_out):

# First, merge in the raw profiling data
llvm_cmd = [
"llvm-profdata-13",
"llvm-profdata-{}".format(LLVM_VERSION_MAJOR),
"merge -sparse {}".format(file_in),
"-o {}".format(tmp_file),
]
Expand Down
4 changes: 2 additions & 2 deletions tasks/format_code.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from invoke import task
from tasks.util.env import PROJ_ROOT
from tasks.util.env import LLVM_VERSION_MAJOR, PROJ_ROOT
from subprocess import run


Expand Down Expand Up @@ -52,7 +52,7 @@ def format(ctx, check=False):
)

clang_cmd = [
"clang-format-13",
"clang-format-{}".format(LLVM_VERSION_MAJOR),
"--dry-run --Werror" if check else "-i",
" ".join(files_to_check),
]
Expand Down
1 change: 1 addition & 0 deletions tasks/util/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# faasm/cpp/faasmtools/env.py. Ideally, both versions will be in sync but it
# is not strictly necessary.
LLVM_VERSION = "17.0.6"
LLVM_VERSION_MAJOR = LLVM_VERSION.split(".")[0]


def get_version():
Expand Down

0 comments on commit 874402d

Please sign in to comment.