Skip to content

Commit

Permalink
add PYTHON_EXECUTABLE option
Browse files Browse the repository at this point in the history
  • Loading branch information
okapies committed Oct 1, 2018
1 parent a28b4f3 commit 8d373ea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .travis/init-build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,14 @@ function build_menoh() {
docker_exec_script \
"${PROJ_DIR}/scripts/build-menoh.sh" \
--build-type Release \
--source-dir "${PROJ_DIR}"
--source-dir "${PROJ_DIR}" \
--python-executable python3
else
docker_exec_script \
"${PROJ_DIR}/scripts/build-menoh.sh" \
--build-type Release \
--source-dir "${PROJ_DIR}" \
--python-executable python3 \
--link-static-libgcc ON \
--link-static-libstdcxx ON \
--link-static-libprotobuf ON
Expand Down
4 changes: 3 additions & 1 deletion .travis/init-build-osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ function build_menoh() {
if [ "${LINK_STATIC}" != "true" ]; then
bash -ex "${PROJ_DIR}/scripts/build-menoh.sh" \
--build-type Release \
--source-dir "${PROJ_DIR}"
--source-dir "${PROJ_DIR}" \
--python-executable python
else
# Does not set --link-static-libgcc and --link-static-libstdcxx in macOS
bash -ex "${PROJ_DIR}/scripts/build-menoh.sh" \
--build-type Release \
--source-dir "${PROJ_DIR}" \
--python-executable python \
--link-static-libprotobuf ON
fi
}
Expand Down
6 changes: 6 additions & 0 deletions scripts/build-menoh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ while [[ $# != 0 ]]; do
readonly ARG_MKLDNN_DIR="$2"
shift 2
;;
--python-executable)
ARG_PYTHON_EXECUTABLE="$2"
shift 2
;;
--link-static-libgcc)
readonly ARG_LINK_STATIC_LIBGCC="$2"
shift 2
Expand Down Expand Up @@ -63,6 +67,7 @@ if [ -n "${ARG_MKLDNN_DIR}" ]; then
readonly OPT_MKLDNN_LIBRARY=-DMKLDNN_LIBRARY=${ARG_MKLDNN_DIR}/lib/libmkldnn.so
fi

test -n "${ARG_PYTHON_EXECUTABLE}" || readonly ARG_PYTHON_EXECUTABLE=python
test -n "${ARG_LINK_STATIC_LIBGCC}" || readonly ARG_LINK_STATIC_LIBGCC='OFF'
test -n "${ARG_LINK_STATIC_LIBSTDCXX}" || readonly ARG_LINK_STATIC_LIBSTDCXX='OFF'
test -n "${ARG_LINK_STATIC_LIBPROTOBUF}" || readonly ARG_LINK_STATIC_LIBPROTOBUF='OFF'
Expand All @@ -77,6 +82,7 @@ cmake \
"-DCMAKE_INSTALL_PREFIX=${ARG_INSTALL_DIR}" \
"${OPT_MKLDNN_INCLUDE_DIR}" \
"${OPT_MKLDNN_LIBRARY}" \
-DPYTHON_EXECUTABLE=${ARG_PYTHON_EXECUTABLE} \
-DLINK_STATIC_LIBGCC=${ARG_LINK_STATIC_LIBGCC} \
-DLINK_STATIC_LIBSTDCXX=${ARG_LINK_STATIC_LIBSTDCXX} \
-DLINK_STATIC_LIBPROTOBUF=${ARG_LINK_STATIC_LIBPROTOBUF} \
Expand Down

0 comments on commit 8d373ea

Please sign in to comment.