fix naml code compile error
This commit is contained in:
parent
be52337747
commit
fb53295a57
|
@ -40,10 +40,6 @@ include_directories(
|
||||||
../include/
|
../include/
|
||||||
)
|
)
|
||||||
|
|
||||||
if(target STREQUAL "Simulator_Function")
|
|
||||||
add_compile_options(-DFUNC_SIM)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# add host lib path
|
# add host lib path
|
||||||
link_directories(
|
link_directories(
|
||||||
${LIB_PATH}
|
${LIB_PATH}
|
||||||
|
@ -53,8 +49,8 @@ link_directories(
|
||||||
set(PROJECT_SRC_ROOT ${CMAKE_CURRENT_LIST_DIR}/)
|
set(PROJECT_SRC_ROOT ${CMAKE_CURRENT_LIST_DIR}/)
|
||||||
|
|
||||||
# Set include directory and library directory
|
# Set include directory and library directory
|
||||||
set(ACL_LIB_DIR $ENV{ASCEND_HOME}/acllib)
|
set(ACL_LIB_DIR $ENV{ASCEND_HOME}/fwkacllib)
|
||||||
set(ATLAS_ACL_LIB_DIR $ENV{ASCEND_HOME}/ascend-toolkit/latest/acllib)
|
set(ATLAS_ACL_LIB_DIR $ENV{ASCEND_HOME}/ascend-toolkit/latest/fwkacllib)
|
||||||
# Header path
|
# Header path
|
||||||
include_directories(${ACL_LIB_DIR}/include/)
|
include_directories(${ACL_LIB_DIR}/include/)
|
||||||
include_directories(${ATLAS_ACL_LIB_DIR}/include/)
|
include_directories(${ATLAS_ACL_LIB_DIR}/include/)
|
||||||
|
@ -63,6 +59,7 @@ include_directories(${PROJECT_SRC_ROOT}/../inc)
|
||||||
# add host lib path
|
# add host lib path
|
||||||
link_directories(${ACL_LIB_DIR})
|
link_directories(${ACL_LIB_DIR})
|
||||||
find_library(acl libascendcl.so ${ACL_LIB_DIR}/lib64 ${ATLAS_ACL_LIB_DIR}/lib64)
|
find_library(acl libascendcl.so ${ACL_LIB_DIR}/lib64 ${ATLAS_ACL_LIB_DIR}/lib64)
|
||||||
|
find_library(stdc libstdc++.so.6 /usr/)
|
||||||
|
|
||||||
add_executable(main
|
add_executable(main
|
||||||
./src/utils.cpp
|
./src/utils.cpp
|
||||||
|
@ -70,6 +67,6 @@ add_executable(main
|
||||||
./src/sample_process.cpp
|
./src/sample_process.cpp
|
||||||
./src/main.cpp)
|
./src/main.cpp)
|
||||||
|
|
||||||
target_link_libraries(main ${acl} stdc++ gflags)
|
target_link_libraries(main ${acl} ${stdc} gflags)
|
||||||
|
|
||||||
install(TARGETS main DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
install(TARGETS main DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||||
|
|
|
@ -58,15 +58,15 @@ echo $device_id
|
||||||
|
|
||||||
export ASCEND_HOME=/usr/local/Ascend/
|
export ASCEND_HOME=/usr/local/Ascend/
|
||||||
if [ -d ${ASCEND_HOME}/ascend-toolkit ]; then
|
if [ -d ${ASCEND_HOME}/ascend-toolkit ]; then
|
||||||
export PATH=$ASCEND_HOME/ascend-toolkit/latest/fwkacllib/ccec_compiler/bin:$ASCEND_HOME/ascend-toolkit/latest/atc/bin:$PATH
|
export PATH=$ASCEND_HOME/fwkacllib/bin:$ASCEND_HOME/fwkacllib/ccec_compiler/bin:$ASCEND_HOME/ascend-toolkit/latest/fwkacllib/ccec_compiler/bin:$ASCEND_HOME/ascend-toolkit/latest/atc/bin:$PATH
|
||||||
export LD_LIBRARY_PATH=/usr/local/lib:$ASCEND_HOME/ascend-toolkit/latest/atc/lib64:$ASCEND_HOME/ascend-toolkit/latest/acllib/lib64:$ASCEND_HOME/ascend-toolkit/latest/fwkacllib/lib64:$ASCEND_HOME/driver/lib64:$ASCEND_HOME/add-ons:$LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH=$ASCEND_HOME/fwkacllib/lib64:/usr/local/lib:$ASCEND_HOME/ascend-toolkit/latest/atc/lib64:$ASCEND_HOME/ascend-toolkit/latest/acllib/lib64:$ASCEND_HOME/ascend-toolkit/latest/fwkacllib/lib64:$ASCEND_HOME/driver/lib64:$ASCEND_HOME/add-ons:$LD_LIBRARY_PATH
|
||||||
export TBE_IMPL_PATH=$ASCEND_HOME/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe
|
export TBE_IMPL_PATH=$ASCEND_HOME/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe
|
||||||
export PYTHONPATH=${TBE_IMPL_PATH}:$ASCEND_HOME/ascend-toolkit/latest/fwkacllib/python/site-packages:$PYTHONPATH
|
export PYTHONPATH=$ASCEND_HOME/fwkacllib/python/site-packages:${TBE_IMPL_PATH}:$ASCEND_HOME/ascend-toolkit/latest/fwkacllib/python/site-packages:$PYTHONPATH
|
||||||
export ASCEND_OPP_PATH=$ASCEND_HOME/ascend-toolkit/latest/opp
|
export ASCEND_OPP_PATH=$ASCEND_HOME/ascend-toolkit/latest/opp
|
||||||
else
|
else
|
||||||
export PATH=$ASCEND_HOME/atc/ccec_compiler/bin:$ASCEND_HOME/atc/bin:$PATH
|
export PATH=$ASCEND_HOME/fwkacllib/bin:$ASCEND_HOME/fwkacllib/ccec_compiler/bin:$ASCEND_HOME/atc/ccec_compiler/bin:$ASCEND_HOME/atc/bin:$PATH
|
||||||
export LD_LIBRARY_PATH=/usr/local/lib:$ASCEND_HOME/atc/lib64:$ASCEND_HOME/acllib/lib64:$ASCEND_HOME/driver/lib64:$ASCEND_HOME/add-ons:$LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH=$ASCEND_HOME/fwkacllib/lib64:/usr/local/lib:$ASCEND_HOME/atc/lib64:$ASCEND_HOME/acllib/lib64:$ASCEND_HOME/driver/lib64:$ASCEND_HOME/add-ons:$LD_LIBRARY_PATH
|
||||||
export PYTHONPATH=$ASCEND_HOME/atc/python/site-packages:$PYTHONPATH
|
export PYTHONPATH=$ASCEND_HOME/fwkacllib/python/site-packages:$ASCEND_HOME/atc/python/site-packages:$PYTHONPATH
|
||||||
export ASCEND_OPP_PATH=$ASCEND_HOME/opp
|
export ASCEND_OPP_PATH=$ASCEND_HOME/opp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue