Skip to content

Commit 81573c8

Browse files
author
Henry Li
committed
scope changes for Azure Linux only
1 parent b89c71b commit 81573c8

File tree

3 files changed

+30
-9
lines changed

3 files changed

+30
-9
lines changed

third_party/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ ifneq (,$(wildcard hpl-tests/Makefile))
202202
tar xzf hpl-2.3.tar.gz && \
203203
cp Make.Linux_zen3 hpl-2.3 && \
204204
cp Make.Linux_zen4 hpl-2.3 && \
205-
make all
205+
make OS_SKU=$(OS_SKU) all
206206
cp -v ./hpl-tests/hpl-2.3/bin/Linux_zen3/xhpl $(SB_MICRO_PATH)/bin/xhpl_z3
207207
cp -v ./hpl-tests/hpl-2.3/bin/Linux_zen4/xhpl $(SB_MICRO_PATH)/bin/xhpl_z4
208208
cp -v ./hpl-tests/hpl_run.sh $(SB_MICRO_PATH)/bin/
@@ -215,7 +215,7 @@ cpu_stream: sb_micro_path
215215
ifneq (,$(wildcard stream-tests/Makefile))
216216
cd ./stream-tests && \
217217
wget https://www.cs.virginia.edu/stream/FTP/Code/stream.c && \
218-
make all
218+
make OS_SKU=$(OS_SKU) all
219219
cp -v ./stream-tests/stream* $(SB_MICRO_PATH)/bin/
220220
endif
221221

third_party/hpl-tests/Makefile

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,38 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT license.
33

4+
# OS_SKU is inherited from parent Makefile, but provide fallback if run independently
5+
OS_SKU ?= $(shell sort -r /etc/*-release | gawk 'match($$0, /^ID=(.*)$$/, a) { print toupper(a[1]); exit }')
6+
47
# Dynamically find AMD software paths
8+
ifeq ($(OS_SKU), AZURELINUX)
59
BLIS_PATH := $(shell find /opt -path "*/amd-blis" 2>/dev/null | head -1)
610
BLIS_LIB := $(shell find /opt -name "libblis-mt.so" 2>/dev/null | head -1)
711
AOCC_PATH := $(shell find /opt -path "*/aocc-compiler*/bin/clang" 2>/dev/null | head -1)
12+
endif
813

914
all: ZEN3 ZEN4 CONFIGURE
1015

1116
CONFIGURE:
1217
cp ./hpl-2.3/setup/Make.Linux_ATHLON_CBLAS ./hpl-2.3/Make.Linux_zen3
13-
sed -i 's/.*ARCH .*=.*/ARCH =$$(arch)/' ./hpl-2.3/Make.Linux_zen3
14-
sed -i 's/.*TOPdir .*=.*/TOPdir = ..\/..\/../' ./hpl-2.3/Make.Linux_zen3
18+
sed -i 's/.*ARCH .*=.*/ARCH =$$(arch)/' ./hpl-2.3/Make.Linux_zen3
19+
sed -i 's/.*TOPdir .*=.*/TOPdir = ..\/..\/../' ./hpl-2.3/Make.Linux_zen3
1520
sed -i 's/.*MPdir .*=.*/MPdir = $$(omp)/' ./hpl-2.3/Make.Linux_zen3
1621
sed -i 's/.*MPinc .*=.*/MPinc = -I$$(MPdir)\/include/' ./hpl-2.3/Make.Linux_zen3
1722
sed -i 's/.*MPlib .*=.*/MPlib = $$(MPdir)\/lib\/libmpi.so/' ./hpl-2.3/Make.Linux_zen3
23+
ifeq ($(OS_SKU), AZURELINUX)
1824
sed -i 's|.*LAdir .*=.*|LAdir = $(BLIS_PATH)|' ./hpl-2.3/Make.Linux_zen3
19-
sed -i 's/LAinc .*=/LAinc = -I$$(LAdir)\/lib\/include/' ./hpl-2.3/Make.Linux_zen3
2025
sed -i 's|.*LAlib .*=.*|LAlib = $(BLIS_LIB)|' ./hpl-2.3/Make.Linux_zen3
21-
sed -i 's|.*CC .*=.*|CC = $(AOCC_PATH)|' ./hpl-2.3/Make.Linux_zen3
26+
sed -i 's|.*CC .*=.*|CC = $(AOCC_PATH)|' ./hpl-2.3/Make.Linux_zen3
27+
sed -i 's|.*LINKER .*=.*|LINKER = $(AOCC_PATH)|' ./hpl-2.3/Make.Linux_zen3
28+
else
29+
sed -i 's/.*LAdir .*=.*/LAdir = \/opt\/AMD\/amd-blis/' ./hpl-2.3/Make.Linux_zen3
30+
sed -i 's/.*LAlib .*=.*/LAlib = $$(LAdir)\/lib\/LP64\/libblis-mt.so/' ./hpl-2.3/Make.Linux_zen3
31+
sed -i 's/.*CC .*=.*/CC = \/opt\/AMD\/aocc-compiler-4.0.0\/bin\/clang/' ./hpl-2.3/Make.Linux_zen3
32+
sed -i 's/.*LINKER .*=.*/LINKER = \/opt\/AMD\/aocc-compiler-4.0.0\/bin\/clang/' ./hpl-2.3/Make.Linux_zen3
33+
endif
34+
sed -i 's/LAinc .*=/LAinc = -I$$(LAdir)\/lib\/include/' ./hpl-2.3/Make.Linux_zen3
2235
sed -i 's/.*CCFLAGS .*=.*/CCFLAGS = $$(HPL_DEFS) -march=znver3 -fomit-frame-pointer -O3 -funroll-loops/' ./hpl-2.3/Make.Linux_zen3
23-
sed -i 's|.*LINKER .*=.*|LINKER = $(AOCC_PATH)|' ./hpl-2.3/Make.Linux_zen3
2436
cp ./hpl-2.3/Make.Linux_zen3 ./hpl-2.3/Make.Linux_zen4
2537
sed -i 's/.*CCFLAGS .*=.*/CCFLAGS = $$(HPL_DEFS) -march=znver4 -fomit-frame-pointer -O3 -funroll-loops/' ./hpl-2.3/Make.Linux_zen4
2638
ZEN3: CONFIGURE

third_party/stream-tests/Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT license.
33

4+
# OS_SKU is inherited from parent Makefile, but provide fallback if run independently
5+
OS_SKU ?= $(shell sort -r /etc/*-release | gawk 'match($$0, /^ID=(.*)$$/, a) { print toupper(a[1]); exit }')
6+
47
GENFLAGS := -DSTREAM_ARRAY_SIZE=120000000
58
ZEN3FLAGS := -DSTREAM_ARRAY_SIZE=400000000 -march=znver3
69
ZEN4FLAGS := -DSTREAM_ARRAY_SIZE=800000000 -march=znver4
@@ -23,9 +26,15 @@ ifeq ($(ARCH), aarch64)
2326
endif
2427

2528
# AMD AOCC clang present? add ZEN3 and ZEN4
26-
# Dynamically find AOCC compiler installation
29+
# Find AOCC compiler installation
30+
ifeq ($(OS_SKU), AZURELINUX)
2731
AOCC_CLANG := $(shell find /opt -path "*/aocc-compiler*/bin/clang" 2>/dev/null | head -1)
28-
ifneq ($(AOCC_CLANG),)
32+
else
33+
AOCC_CLANG := $(wildcard /opt/AMD/aocc-compiler-4.0.0/bin/clang)
34+
endif
35+
36+
# Configure compiler if AOCC is found
37+
ifneq ($(AOCC_CLANG),"")
2938
CC := $(AOCC_CLANG)
3039
CFLAGS := -Ofast -mcmodel=large -mavx2 -ffp-contract=fast -lomp -fopenmp \
3140
-fnt-store=aggressive -DNTIMES=10

0 commit comments

Comments
 (0)