From b4e7b79fda5be64aa0acb382218959af4197d000 Mon Sep 17 00:00:00 2001 From: Joost VandeVondele Date: Wed, 10 Jul 2024 21:54:35 +0200 Subject: [PATCH] Enable clang++ for fast-chess --- worker/sri.txt | 2 +- worker/worker.py | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/worker/sri.txt b/worker/sri.txt index 13d33f393..95b702d3b 100644 --- a/worker/sri.txt +++ b/worker/sri.txt @@ -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"} diff --git a/worker/worker.py b/worker/worker.py index ff38e6293..f2d975995 100644 --- a/worker/worker.py +++ b/worker/worker.py @@ -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) @@ -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, @@ -1492,12 +1493,19 @@ 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 @@ -1505,13 +1513,6 @@ def worker(): 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 ""),