From ad5ff0361551b99ec1a2d00c71f18dab70a3c4bd Mon Sep 17 00:00:00 2001 From: CGH0S7 <776459475@qq.com> Date: Sat, 28 Feb 2026 17:16:00 +0800 Subject: [PATCH] build: switch allocator option to oneTBB tbbmalloc (cherry picked from commit e29ca2dca9f7ee7046944303d16c276379bb0476) --- AMSS_NCKU_source/makefile.inc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/AMSS_NCKU_source/makefile.inc b/AMSS_NCKU_source/makefile.inc index eddbf3a..247da77 100755 --- a/AMSS_NCKU_source/makefile.inc +++ b/AMSS_NCKU_source/makefile.inc @@ -10,6 +10,20 @@ filein = -I/usr/include/ -I${MKLROOT}/include ## Added -lifcore for Intel Fortran runtime and -limf for Intel math library LDLIBS = -L${MKLROOT}/lib -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lifcore -limf -lpthread -lm -ldl -liomp5 +## Memory allocator switch +## 1 (default) : link Intel oneTBB allocator (libtbbmalloc) +## 0 : use system default allocator (ptmalloc) +USE_TBBMALLOC ?= 1 +TBBMALLOC_SO ?= /home/intel/oneapi/2025.3/lib/libtbbmalloc.so +ifneq ($(wildcard $(TBBMALLOC_SO)),) +TBBMALLOC_LIBS = -Wl,--no-as-needed $(TBBMALLOC_SO) -Wl,--as-needed +else +TBBMALLOC_LIBS = -Wl,--no-as-needed -ltbbmalloc -Wl,--as-needed +endif +ifeq ($(USE_TBBMALLOC),1) +LDLIBS := $(TBBMALLOC_LIBS) $(LDLIBS) +endif + ## PGO build mode switch (ABE only; TwoPunctureABE always uses opt flags) ## opt : (default) maximum performance with PGO profile-guided optimization ## instrument : PGO Phase 1 instrumentation to collect fresh profile data