From f4e0e519c0f8c97147fdbf98274cdd026f9ad990 Mon Sep 17 00:00:00 2001 From: phoenix20162016 Date: Mon, 20 Nov 2023 10:49:04 +0800 Subject: [PATCH] add python lib search path (#707) --- pre_build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pre_build.sh b/pre_build.sh index 19d1ef72c..df6735645 100755 --- a/pre_build.sh +++ b/pre_build.sh @@ -40,8 +40,13 @@ rm -f python_headers ln -s ${PYTHON_INC_CONFIG} python_headers popd +#get python install prefix +PREFIX_PATH=`${PYTHON_CONFIG_CMD} --prefix` + #get python link option -CONFIG=`${PYTHON_CONFIG_CMD} --ldflags` && NEWLINE="[\"${CONFIG}\"] + [\"-lpython$U_V1.$U_V2\"]" +CONFIG=`${PYTHON_CONFIG_CMD} --ldflags` && { + NEWLINE="[\"-L${PREFIX_PATH}/lib ${CONFIG}\"] + [\"-lpython$U_V1.$U_V2\"]" +} # Compatible with MacOS sed -e "s|PLACEHOLDER-PYTHON3.X-CONFIG|${NEWLINE}|g" BUILD.bazel > BUILD.bazel.tmp && mv BUILD.bazel.tmp BUILD.bazel