Skip to content

Commit

Permalink
add python lib search path (primihub#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix20162016 authored Nov 20, 2023
1 parent 162a61b commit f4e0e51
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pre_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f4e0e51

Please sign in to comment.