Skip to content

Commit

Permalink
keep platform generic for result consistency across platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
marekkokot committed Nov 27, 2024
1 parent fd4e498 commit b398b03
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
4 changes: 3 additions & 1 deletion build_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@

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

print(cmd)
build_release.run_cmd(cmd)
Expand Down
4 changes: 3 additions & 1 deletion build_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ def run_cmd_get_stdout(cmd):
sys.exit(1)

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

run_cmd("mkdir -p bin/example")

Expand Down
18 changes: 12 additions & 6 deletions refresh.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### REFRESH group macros - v.1.0.9 (2024-11-25)
### REFRESH group macros - v.1.0.10 (2024-11-27)

### Macros for initialization
define INIT_GLOBALS
Expand Down Expand Up @@ -556,11 +556,17 @@ define CHECK_OS_ARCH
$(if $(filter avx512,$(1)), \
$(eval ARCH_FLAGS:=-mavx512 -m64 -DARCH_X64) \
$(info *** x86-64 with AVX512 extensions ***), \
$(if $(filter x86_64,$(ARCH_TYPE)), \
$(eval ARCH_FLAGS:=-march=native -DARCH_X64) \
$(info *** Unspecified platform - using native compilation for x86_64 ***), \
$(eval ARCH_FLAGS:=-march=native -DARCH_ARM) \
$(info *** Unspecified platform - using native compilation for ARM ***))))))))
$(if $(filter generic,$(1)), \
$(if $(filter x86_64,$(ARCH_TYPE)), \
$(eval ARCH_FLAGS:=-DARCH_X64) \
$(info *** Unspecified platform - using generic compilation for x86_64 ***), \
$(eval ARCH_FLAGS:=-DARCH_ARM) \
$(info *** Unspecified platform - using generic compilation for ARM ***)), \
$(if $(filter x86_64,$(ARCH_TYPE)), \
$(eval ARCH_FLAGS:=-march=native -DARCH_X64) \
$(info *** Unspecified platform - using native compilation for x86_64 ***), \
$(eval ARCH_FLAGS:=-march=native -DARCH_ARM) \
$(info *** Unspecified platform - using native compilation for ARM ***)))))))))

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

0 comments on commit b398b03

Please sign in to comment.