From e18759642f44f5ab81ad379768db37f1ffe57ec7 Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Sat, 30 Jan 2016 20:56:36 -0800 Subject: [PATCH] Avoid running Chisel in parallel in the same directory It looks like Chisel fails when I try to run it in parallel. This adds a lock file to ensure that only a single Chisel instance is running at a time when running the regressions. --- regression/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/regression/Makefile b/regression/Makefile index 30d0d8b6..2a5ff90b 100644 --- a/regression/Makefile +++ b/regression/Makefile @@ -73,12 +73,12 @@ stamps/tools.stamp: stamps/submodules.stamp # Builds the various simulators stamps/$(CONFIG)/%-ndebug.stamp: stamps/submodules.stamp stamps/tools.stamp mkdir -p $(dir $@) - $(MAKE) -C $(abspath $(TOP))/$(patsubst stamps/$(CONFIG)/%-ndebug.stamp,%,$@) CONFIG=$(CONFIG) RISCV=$(abspath $(RISCV)) + +flock -x $(dir $@)/chisel-lock $(MAKE) -C $(abspath $(TOP))/$(patsubst stamps/$(CONFIG)/%-ndebug.stamp,%,$@) CONFIG=$(CONFIG) RISCV=$(abspath $(RISCV)) touch $@ stamps/$(CONFIG)/%-debug.stamp: stamps/submodules.stamp stamps/tools.stamp mkdir -p $(dir $@) - $(MAKE) -C $(abspath $(TOP))/$(patsubst stamps/$(CONFIG)/%-debug.stamp,%,$@) CONFIG=$(CONFIG) RISCV=$(abspath $(RISCV)) debug + +flock -x $(dir $@)/chisel-lock $(MAKE) -C $(abspath $(TOP))/$(patsubst stamps/$(CONFIG)/%-debug.stamp,%,$@) CONFIG=$(CONFIG) RISCV=$(abspath $(RISCV)) debug touch $@ # Runs tests on one of the simulators