onnx / tutorials

Tutorials for creating and using ONNX models
Apache License 2.0
3.4k stars 631 forks source link

Can you provide a clear CMakeLists.txt example on how to make the project? #230

Closed julycetc closed 3 years ago

julycetc commented 3 years ago

In the CmakeList.txt, there are many paths which need to be added, like PATH_TO_ONNXRUNTIME_TEST_UTIL_INCLUDE_DIR, PATH_TO_ONNXRUNTIME_LIB, PATH_TO_ONNXRUNTIME_INCLUDE_DIR. But i am not sure which path they are,can you provide a clear example and explain the path clearly? Thanks very much!

cmake_minimum_required(VERSION 3.10) project (customop) add_definitions(-std=c++11)

set(TEST_SOURCE custom_op_test.cc) set(HEADER custom_op.h) set(SOURCE custom_op.h) add_executable(customop ${SOURCE} ${HEADER} ${TEST_SOURCE})

Include path to header files for Custom Op

include_directories() include_directories()

Include path to header files for Custom Op Test

include_directories()

Linking dependencies for Custom Op

find_library(ONNXRUNTIME_LIBRARY onnxruntime HINTS ) target_link_libraries(customop PUBLIC ${ONNXRUNTIME_LIBRARY})

prasanthpul commented 3 years ago

There is no cmakelist.txt in this repo. If this is still an issue for you, please open it in the appropriate repo that you are having the trouble with

ahangchen commented 3 years ago

here is the https://github.com/onnx/tutorials/blob/master/PyTorchCustomOperator/ort_custom_op/CMakeLists.txt