Skip to content

Commit b398b03

Browse files
committed
keep platform generic for result consistency across platforms
1 parent fd4e498 commit b398b03

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

build_docker.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828

2929
ver = build_release.get_ver("src/splash.py")
3030
#cmd = f"sudo docker build --no-cache -t {repo}:{ver} ."
31-
cmd = f"sudo docker buildx build --no-cache --platform linux/{hardware_platform} --build-arg PLATFORM={platform_for_make} -t {repo}:{ver} --load ."
31+
#cmd = f"sudo docker buildx build --no-cache --platform linux/{hardware_platform} --build-arg PLATFORM={platform_for_make} -t {repo}:{ver} --load ."
32+
#keep platform generic for result consistency across platforms
33+
cmd = f"sudo docker buildx build --no-cache --platform linux/{hardware_platform} --build-arg PLATFORM=generic -t {repo}:{ver} --load ."
3234

3335
print(cmd)
3436
build_release.run_cmd(cmd)

build_release.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ def run_cmd_get_stdout(cmd):
104104
sys.exit(1)
105105

106106
run_cmd(f"{make_command} clean")
107-
run_cmd(f"{make_command} CXX={cxx} CC={cc} PLATFORM={platform} STATIC_LINK=true -j")
107+
#run_cmd(f"{make_command} CXX={cxx} CC={cc} PLATFORM={platform} STATIC_LINK=true -j")
108+
#keep platform generic for result consistency across platforms
109+
run_cmd(f"{make_command} CXX={cxx} CC={cc} PLATFORM=generic STATIC_LINK=true -j")
108110

109111
run_cmd("mkdir -p bin/example")
110112

refresh.mk

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### REFRESH group macros - v.1.0.9 (2024-11-25)
1+
### REFRESH group macros - v.1.0.10 (2024-11-27)
22

33
### Macros for initialization
44
define INIT_GLOBALS
@@ -556,11 +556,17 @@ define CHECK_OS_ARCH
556556
$(if $(filter avx512,$(1)), \
557557
$(eval ARCH_FLAGS:=-mavx512 -m64 -DARCH_X64) \
558558
$(info *** x86-64 with AVX512 extensions ***), \
559-
$(if $(filter x86_64,$(ARCH_TYPE)), \
560-
$(eval ARCH_FLAGS:=-march=native -DARCH_X64) \
561-
$(info *** Unspecified platform - using native compilation for x86_64 ***), \
562-
$(eval ARCH_FLAGS:=-march=native -DARCH_ARM) \
563-
$(info *** Unspecified platform - using native compilation for ARM ***))))))))
559+
$(if $(filter generic,$(1)), \
560+
$(if $(filter x86_64,$(ARCH_TYPE)), \
561+
$(eval ARCH_FLAGS:=-DARCH_X64) \
562+
$(info *** Unspecified platform - using generic compilation for x86_64 ***), \
563+
$(eval ARCH_FLAGS:=-DARCH_ARM) \
564+
$(info *** Unspecified platform - using generic compilation for ARM ***)), \
565+
$(if $(filter x86_64,$(ARCH_TYPE)), \
566+
$(eval ARCH_FLAGS:=-march=native -DARCH_X64) \
567+
$(info *** Unspecified platform - using native compilation for x86_64 ***), \
568+
$(eval ARCH_FLAGS:=-march=native -DARCH_ARM) \
569+
$(info *** Unspecified platform - using native compilation for ARM ***)))))))))
564570

565571
$(if $(filter Darwin,$(OS_TYPE)), \
566572
$(eval SDK_PATH:=$(shell $(CXX) -v 2>&1 | grep -- '--with-sysroot' | sed -E 's/.*--with-sysroot=([^ ]+).*/\1/')) \

0 commit comments

Comments
 (0)