forked from mindspore-Ecosystem/mindspore
commit
e1259078e6
|
@ -1,9 +1,16 @@
|
|||
# set cross-compiled system type, it's better not use the type which cmake cannot recognized.
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_SYSTEM_PROCESSOR arm)
|
||||
|
||||
if(DEFINED ENV{HISI_TOOLCHAIN_PATH})
|
||||
set(TOOLCHAIN_PATH $ENV{HISI_TOOLCHAIN_PATH}/hisi-linux/x86_arm)
|
||||
else()
|
||||
set(TOOLCHAIN_PATH "/opt/linux/x86-arm")
|
||||
endif()
|
||||
|
||||
# when hislicon SDK was installed, toolchain was installed in the path as below:
|
||||
set(CMAKE_C_COMPILER /opt/linux/x86-arm/aarch64-mix210-linux/bin/aarch64-mix210-linux-gcc)
|
||||
set(CMAKE_CXX_COMPILER /opt/linux/x86-arm/aarch64-mix210-linux/bin/aarch64-mix210-linux-g++)
|
||||
set(CMAKE_C_COMPILER ${TOOLCHAIN_PATH}/aarch64-mix210-linux/bin/aarch64-mix210-linux-gcc)
|
||||
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PATH}/aarch64-mix210-linux/bin/aarch64-mix210-linux-g++)
|
||||
|
||||
find_path(GCC_PATH gcc)
|
||||
find_path(GXX_PATH g++)
|
||||
|
|
|
@ -27,10 +27,10 @@ elseif(TARGET_MIX210)
|
|||
dpico_acl_adapter svp_acl dl securec protobuf-c stdc++)
|
||||
if(${MSLITE_REGISTRY_DEVICE} STREQUAL "SD3403")
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/dpico)
|
||||
message("34xx_sdk_SOURCE_DIR:${34xx_sdk_SOURCE_DIR}.")
|
||||
include_directories(${34xx_sdk_SOURCE_DIR}/include)
|
||||
include_directories(${34xx_sdk_SOURCE_DIR})
|
||||
link_directories(${34xx_sdk_SOURCE_DIR}/lib)
|
||||
message("SD3403_SDK_PATH:${SD3403_SDK_PATH}.")
|
||||
include_directories(${SD3403_SDK_PATH}/include)
|
||||
include_directories(${SD3403_SDK_PATH})
|
||||
link_directories(${SD3403_SDK_PATH}/lib)
|
||||
endif()
|
||||
else()
|
||||
set(BENCHMARK_LINK_LIB ${BENCHMARK_LINK_LIB} mindspore::json)
|
||||
|
|
|
@ -1,22 +1,26 @@
|
|||
cmake_minimum_required(VERSION 3.14)
|
||||
project(DPICO_Custom)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../../../cmake/utils.cmake)
|
||||
__download_pkg(34xx_sdk
|
||||
http://mindspore-repo.csi.rnd.huawei.com/mindspore/enterprise/dpico/34xx_sdk.tar.gz
|
||||
f64a9129615b3b41b63debe17c6785af)
|
||||
|
||||
if(DEFINED ENV{HISI_SDK_PATH})
|
||||
set(SD3403_SDK_PATH $ENV{HISI_SDK_PATH}/sd3403_sdk/dpico_acl_adapter/3403_sdk)
|
||||
else()
|
||||
message("error, no sdk found")
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
include_directories(${34xx_sdk_SOURCE_DIR})
|
||||
include_directories(${34xx_sdk_SOURCE_DIR}/include)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../runtime)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../runtime/include)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../runtime/include/third_party)
|
||||
link_directories(${34xx_sdk_SOURCE_DIR}/lib)
|
||||
include_directories(${SD3403_SDK_PATH})
|
||||
include_directories(${SD3403_SDK_PATH}/include)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/runtime)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/runtime/include)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/runtime/include/third_party)
|
||||
link_directories(${SD3403_SDK_PATH}/lib)
|
||||
|
||||
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src COMMON_SRC3)
|
||||
|
||||
set(LINK_LOCAT_LIB ${34xx_sdk_SOURCE_DIR}/lib/libsvp_acl.so
|
||||
pthread ${34xx_sdk_SOURCE_DIR}/lib/libsecurec.so dl
|
||||
${34xx_sdk_SOURCE_DIR}/lib/libprotobuf-c.so.1 stdc++)
|
||||
set(LINK_LOCAT_LIB ${SD3403_SDK_PATH}/lib/libsvp_acl.so
|
||||
pthread ${SD3403_SDK_PATH}/lib/libsecurec.so dl
|
||||
${SD3403_SDK_PATH}/lib/libprotobuf-c.so.1 stdc++)
|
||||
|
||||
add_library(dpico_acl_adapter SHARED
|
||||
${COMMON_SRC3})
|
||||
|
|
Loading…
Reference in New Issue