提交 7e446198 编写于 作者: X Xiaoyang LI 提交者: Yan Chunwei

cherry-pick: Fix Mac & arm-linux build error (#2083)

上级 2a4eb485
...@@ -165,11 +165,13 @@ function(lite_cc_binary TARGET) ...@@ -165,11 +165,13 @@ function(lite_cc_binary TARGET)
) )
cc_binary(${TARGET} SRCS ${args_SRCS} DEPS ${deps} ${args_DEPS}) cc_binary(${TARGET} SRCS ${args_SRCS} DEPS ${deps} ${args_DEPS})
target_compile_options(${TARGET} BEFORE PRIVATE -Wno-ignored-qualifiers) target_compile_options(${TARGET} BEFORE PRIVATE -Wno-ignored-qualifiers)
if (NOT APPLE)
# strip binary target to reduce size # strip binary target to reduce size
add_custom_command(TARGET ${TARGET} POST_BUILD add_custom_command(TARGET ${TARGET} POST_BUILD
COMMAND "${CMAKE_STRIP}" -s COMMAND "${CMAKE_STRIP}" -s
"${TARGET}" "${TARGET}"
COMMENT "Strip debug symbols done on final executable file.") COMMENT "Strip debug symbols done on final executable file.")
endif()
# collect targets need to compile for lite # collect targets need to compile for lite
if (NOT args_EXCLUDE_COMPILE_DEPS) if (NOT args_EXCLUDE_COMPILE_DEPS)
add_dependencies(lite_compile_deps ${TARGET}) add_dependencies(lite_compile_deps ${TARGET})
......
...@@ -198,6 +198,7 @@ inline void gemm_int8_kernel(const int8_t* a_ptr, ...@@ -198,6 +198,7 @@ inline void gemm_int8_kernel(const int8_t* a_ptr,
bool is_relu, bool is_relu,
int k, int k,
int rem); int rem);
// clang-format off // clang-format off
#ifdef __aarch64__ #ifdef __aarch64__
#define GEMM_INT8_KERNEL \ #define GEMM_INT8_KERNEL \
......
...@@ -4,10 +4,12 @@ endif() ...@@ -4,10 +4,12 @@ endif()
configure_file(cupti_lib_path.h.in ${CMAKE_CURRENT_BINARY_DIR}/cupti_lib_path.h) configure_file(cupti_lib_path.h.in ${CMAKE_CURRENT_BINARY_DIR}/cupti_lib_path.h)
configure_file(warpctc_lib_path.h.in ${CMAKE_CURRENT_BINARY_DIR}/warpctc_lib_path.h) configure_file(warpctc_lib_path.h.in ${CMAKE_CURRENT_BINARY_DIR}/warpctc_lib_path.h)
lite_cc_library(target_wrapper_x86 SRCS target_wrapper.cc)
if (LITE_ON_MODEL_OPTIMIZE_TOOL)
return()
endif(LITE_ON_MODEL_OPTIMIZE_TOOL)
lite_cc_library(dynamic_loader SRCS dynamic_loader.cc DEPS glog gflags) lite_cc_library(dynamic_loader SRCS dynamic_loader.cc DEPS glog gflags)
lite_cc_library(dynload_mklml SRCS mklml.cc DEPS dynamic_loader mklml) lite_cc_library(dynload_mklml SRCS mklml.cc DEPS dynamic_loader mklml)
lite_cc_library(target_wrapper_x86 SRCS target_wrapper.cc)
lite_cc_library(x86_cpu_info SRCS cpu_info.cc DEPS xbyak) lite_cc_library(x86_cpu_info SRCS cpu_info.cc DEPS xbyak)
add_subdirectory(jit) add_subdirectory(jit)
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
// limitations under the License. // limitations under the License.
#include "lite/operators/range_op.h" #include "lite/operators/range_op.h"
#include <cmath>
#include <functional> #include <functional>
#include "lite/core/op_registry.h" #include "lite/core/op_registry.h"
......
...@@ -56,8 +56,12 @@ function build_model_optimize_tool { ...@@ -56,8 +56,12 @@ function build_model_optimize_tool {
prepare_thirdparty prepare_thirdparty
mkdir -p build.model_optimize_tool mkdir -p build.model_optimize_tool
cd build.model_optimize_tool cd build.model_optimize_tool
cmake .. -DWITH_LITE=ON -DLITE_ON_MODEL_OPTIMIZE_TOOL=ON -DWITH_TESTING=OFF -DLITE_BUILD_EXTRA=ON cmake .. -DWITH_LITE=ON \
make model_optimize_tool -j$NUM_CORES_FOR_COMPILE -DLITE_ON_MODEL_OPTIMIZE_TOOL=ON \
-DWITH_TESTING=OFF \
-DLITE_BUILD_EXTRA=ON \
-DWITH_MKL=OFF
make model_optimize_tool -j$NUM_PROC
} }
function make_tiny_publish_so { function make_tiny_publish_so {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册