Skip to content

Commit 9f75d56

Browse files
committed
avoid make failure when klayout is not in path
Signed-off-by: habibayassin <[email protected]>
1 parent 6b719fb commit 9f75d56

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

flow/util/makeIssue.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
set -euo pipefail
44

5+
if [[ -z "$ISSUE_VARIABLES" ]]; then
6+
echo "ERROR: KLayout not found in PATH" 1>&2
7+
exit 1
8+
fi
9+
510
currentDate=$(date +"%Y-%m-%d_%H-%M")
611
ISSUE_TAG=${ISSUE_TAG:-"${DESIGN_NICKNAME}_${PLATFORM}_${FLOW_VARIANT}_${currentDate}"}
712
ISSUE_CP_DESIGN_FILE_VARS="SDC_FILE \
@@ -73,6 +78,7 @@ echo "Creating ${VARS_BASENAME}.sh/tcl script"
7378
rm -f ${VARS_BASENAME}.sh ${VARS_BASENAME}.tcl ${VARS_BASENAME}.gdb || true
7479

7580
EXCLUDED_VARS="MAKE|PYTHONPATH|PKG_CONFIG_PATH|PERL5LIB|PCP_DIR|PATH|MANPATH|LD_LIBRARY_PATH|INFOPATH|HOME|PWD|MAIL"
81+
7682
printf '%s\n' "$ISSUE_VARIABLES" | while read -r V;
7783
do
7884
if [[ ! ${V%=*} =~ ^[[:digit:]] && ${V} == *"="* && ! -z ${V#*=} && ${V%=*} != *"MAKE"* && ! ${V%=*} =~ ^(${EXCLUDED_VARS})$ ]] ; then

flow/util/utils.mk

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,20 @@ define \n
7676

7777

7878
endef
79-
export ISSUE_VARIABLES := $(foreach V, $(.VARIABLES),$(if $(filter-out environment% default automatic, $(origin $V)), $(if $(filter-out .% %QT_QPA_PLATFORM% %TIME_CMD%, $(V)),$V=$($V))${\n}))
79+
80+
ifneq ($(shell command -v klayout),)
81+
export ISSUE_VARIABLES := $(foreach V, $(.VARIABLES),$(if $(filter-out environment% default automatic, $(origin $V)), $(if $(filter-out .% %QT_QPA_PLATFORM% %TIME_CMD%, $(V)),$V=$($V))${\n}))
82+
else
83+
export ISSUE_VARIABLES =
84+
endif
8085

8186
$(foreach script,$(ISSUE_SCRIPTS),$(script)_issue): %_issue : versions.txt
8287
$(UTILS_DIR)/makeIssue.sh $*
8388

8489
clean_issues:
8590
rm -rf $(foreach issue, $(ISSUE_SCRIPTS), $(issue)_*.tar.gz)
8691
rm -rf $(VARS_BASENAME).sh $(RUN_ME_SCRIPT)
87-
92+
8893
$(RESULTS_DIR)/6_final_only_clk.def: $(RESULTS_DIR)/6_final.def
8994
$(TIME_CMD) $(OPENROAD_CMD) $(SCRIPTS_DIR)/deleteNonClkNets.tcl
9095

0 commit comments

Comments
 (0)