Skip to content

Commit

Permalink
Enable clang++ for fast-chess
Browse files Browse the repository at this point in the history
  • Loading branch information
vondele committed Jul 10, 2024
1 parent f17bfdd commit b4e7b79
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion worker/sri.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"__version": 241, "updater.py": "Mg+pWOgGA0gSo2TuXuuLCWLzwGwH91rsW1W3ixg3jYauHQpRMtNdGnCfuD1GqOhV", "worker.py": "fVKhQAq40Q4MpaR/eJc0+3vBgVs76JpHasMV51cO7TJBGOpr26A7KN06gbpWuI9l", "games.py": "WZWABDxNfVg2hrily964O6GZy4WCXXEcTEGerRHOxplUuINLa1nXpVOw3CDEaqLQ"}
{"__version": 241, "updater.py": "Mg+pWOgGA0gSo2TuXuuLCWLzwGwH91rsW1W3ixg3jYauHQpRMtNdGnCfuD1GqOhV", "worker.py": "xFW+gG/u1RMdmd0bS//C7v65w8ub4hV0p3y5KaZgphbdrGZ+AJmurFEYPUdmqSDp", "games.py": "WZWABDxNfVg2hrily964O6GZy4WCXXEcTEGerRHOxplUuINLa1nXpVOw3CDEaqLQ"}
21 changes: 11 additions & 10 deletions worker/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def verify_required_fastchess(fastchess_path):
return True


def setup_fastchess(worker_dir):
def setup_fastchess(worker_dir, compiler):
# Create the testing directory if missing.
testing_dir = worker_dir / "testing"
testing_dir.mkdir(exist_ok=True)
Expand Down Expand Up @@ -477,7 +477,8 @@ def setup_fastchess(worker_dir):
prefix = os.path.commonprefix([n.filename for n in file_list])
os.chdir(tmp_dir / prefix)

cmd = "make -j USE_CUTE=true"
cmd = f"make -j USE_CUTE=true CXX={compiler}"
print(cmd)
with subprocess.Popen(
cmd,
shell=True,
Expand Down Expand Up @@ -1492,26 +1493,26 @@ def worker():
print("Exception verifying worker version:\n", e, sep="", file=sys.stderr)
return 1

# Assemble the config/options data as well as some other data in a
# "worker_info" dictionary.
# This data will be sent to the server when a new task is requested.

compiler, major, minor, patchlevel = options.compiler
print("Using {} {}.{}.{}".format(compiler, major, minor, patchlevel))

# Check for common tool chain issues
if not verify_toolchain():
return 1

# Make sure we have a working fast-chess
if not setup_fastchess(worker_dir):
if not setup_fastchess(worker_dir, compiler):
return 1

# Check if we are running an unmodified worker
unmodified = verify_remote_sri(worker_dir)
if unmodified is None:
return 1

# Assemble the config/options data as well as some other data in a
# "worker_info" dictionary.
# This data will be sent to the server when a new task is requested.

compiler, major, minor, patchlevel = options.compiler
print("Using {} {}.{}.{}".format(compiler, major, minor, patchlevel))

uname = platform.uname()
worker_info = {
"uname": uname[0] + " " + uname[2] + (" (colab)" if IS_COLAB else ""),
Expand Down

0 comments on commit b4e7b79

Please sign in to comment.