From fe8954fd2cdf55f1061c0761b73b03b53a1fa437 Mon Sep 17 00:00:00 2001 From: siju-felsite Date: Sat, 27 Jun 2026 16:37:02 +0530 Subject: [PATCH] Build: autodetect Boost.Python version (fix boost_python312 hard-coding) Hard-coding -lboost_python312 fails to link on hosts whose Boost.Python targets a different Python 3 minor version. Detect the active Python's major.minor and link boost_python accordingly. No behavioural change; verified by building and running the AES_Sbox_DOM_d1 example on Python 3.12. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3cf474a5..91d2627f 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ CXX_TEST_FLAGS = -Wall -Wextra -Wshadow -pedantic -fopenmp -O3 -g -DBOOST_LOG_ # Linker options. Add libraries you want to link against here. LINK_PYTHON3=`pkg-config --libs python3-embed` LINK_FLINT = -lflint -lmpfr -lgmp -lm -LINK_BOOST = -lboost_log -lboost_log_setup -lboost_thread -lboost_system -lpthread -lboost_filesystem -lboost_program_options -lboost_python312 +LINK_BOOST = -lboost_log -lboost_log_setup -lboost_thread -lboost_system -lpthread -lboost_filesystem -lboost_program_options -lboost_python$(shell python3 -c 'import sys; print("%d%d" % sys.version_info[:2])') # LINK_BOOST = -lboost_filesystem -lboost_program_options -lboost_python312 LINK_GDSTK = -lgdstk -lclipper -lqhull_r -lz BENCHMARK_LINK_FLAGS = -L$(LIB_DIR) -fopenmp -ldl $(LINK_PYTHON3) $(LINK_FLINT) $(LINK_BOOST) $(LINK_GDSTK)