diff --git a/.travis/init-build-linux.sh b/.travis/init-build-linux.sh index a5e5f16..ae5f0db 100644 --- a/.travis/init-build-linux.sh +++ b/.travis/init-build-linux.sh @@ -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 diff --git a/.travis/init-build-osx.sh b/.travis/init-build-osx.sh index c1228d8..afe593a 100644 --- a/.travis/init-build-osx.sh +++ b/.travis/init-build-osx.sh @@ -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 } diff --git a/scripts/build-menoh.sh b/scripts/build-menoh.sh index 38c4fed..5184c4e 100755 --- a/scripts/build-menoh.sh +++ b/scripts/build-menoh.sh @@ -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 @@ -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' @@ -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} \