提交 c076202f 编写于 作者: M Megvii Engine Team

fix(whl/macos): set for osx compat version to 10.14

GitOrigin-RevId: 5dea6a6c6551e1d3479c5e324d74ab1d1e05f261
上级 00de4cd9
......@@ -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<decltype(cmd)>;
try {
......
......@@ -107,6 +107,7 @@ void OprChecker::run(std::vector<InputSpec> 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<decltype(arg)>;
if constexpr (std::is_same_v<TensorShape, T>) {
......
......@@ -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}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册