From c076202f82a1155b7588a551b71288bc4d6505bc Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Fri, 18 Sep 2020 15:21:48 +0800 Subject: [PATCH] fix(whl/macos): set for osx compat version to 10.14 GitOrigin-RevId: 5dea6a6c6551e1d3479c5e324d74ab1d1e05f261 --- imperative/src/impl/interpreter_impl.cpp | 1 + imperative/src/test/helper.cpp | 1 + scripts/whl/macos/macos_build_whl.sh | 8 +++++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/imperative/src/impl/interpreter_impl.cpp b/imperative/src/impl/interpreter_impl.cpp index de521f22..748c3dcd 100644 --- a/imperative/src/impl/interpreter_impl.cpp +++ b/imperative/src/impl/interpreter_impl.cpp @@ -187,6 +187,7 @@ void ChannelImpl::produce_tensor(TensorInfo* dest, TensorPtr ptr) { } void ChannelImpl::process_one_task(Command& cmd) { + //TODO: remove std::visit for support osx 10.12 std::visit([this](auto& cmd) { using T = std::remove_reference_t; try { diff --git a/imperative/src/test/helper.cpp b/imperative/src/test/helper.cpp index 4f38813c..2c369ae6 100644 --- a/imperative/src/test/helper.cpp +++ b/imperative/src/test/helper.cpp @@ -107,6 +107,7 @@ void OprChecker::run(std::vector inp_keys) { auto graph = ComputingGraph::make(); graph->options().graph_opt_level = 0; for (size_t i = 0; i < nr_inps; ++ i) { + //TODO: remove std::visit for support osx 10.12 host_inp[i] = std::visit([&gen](auto&& arg) -> HostTensorND { using T = std::decay_t; if constexpr (std::is_same_v) { diff --git a/scripts/whl/macos/macos_build_whl.sh b/scripts/whl/macos/macos_build_whl.sh index bbf4a1b1..08b197f7 100755 --- a/scripts/whl/macos/macos_build_whl.sh +++ b/scripts/whl/macos/macos_build_whl.sh @@ -112,6 +112,10 @@ function do_build() { export EXTRA_CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${PYTHON_DIR} -DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR} " #config build type to RelWithDebInfo to enable MGB_ENABLE_DEBUG_UTIL etc export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=RelWithDebInfo " + #we use std::visit in src, so set osx version minimum to 10.14, but 10.14 have objdump + #issue, so we now config to 10.15, whl name to 10.14 + #TODO: can set to 10.12 after remove use std::visit + export EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 " #call build and install #FIXME: cmake do not triger update python config, after @@ -164,9 +168,7 @@ function do_build() { cd ${BUILD_DIR}/staging/dist/ org_whl_name=`ls Meg*.whl` index=`awk -v a="${org_whl_name}" -v b="-macosx" 'BEGIN{print index(a,b)}'` - #compat for osx version from 10.5(Leopard) - #FIXME: same no need at -macosx-version-min=10.5 for build so - compat_whl_name=`echo ${org_whl_name} |cut -b -$index`macosx_10_5_x86_64.whl + compat_whl_name=`echo ${org_whl_name} |cut -b -$index`macosx_10_14_x86_64.whl echo "org whl name: ${org_whl_name}" echo "comapt whl name: ${compat_whl_name}" cp ${BUILD_DIR}/staging/dist/Meg*.whl ${MACOS_WHL_HOME}/${compat_whl_name} -- GitLab