I am trying to use the coppeliasim simulator from c ++ for which I make use of Opencv, Visp and Pytorch c ++. In an independent file where I have opencv, visp and pytorch everything is going well, at the moment of integrating it with coppeliasim it starts to report errors in pytorch that I did not have before, I am using cmake, has someone been successful in using pytorch c ++ in coppeliasim?
CMakeLists.txt:
Code: Select all
# cmake
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(example-app)
set(CMAKE_CXX_STANDARD 14)
list(APPEND CMAKE_PREFIX_PATH "/home/carlos/pytorch1/libtorch-cxx11-abi-shared-with-deps-1.7.1+cpu/libtorch")
find_package(Torch REQUIRED)
find_package(OpenCV REQUIRED)
find_package(VISP REQUIRED)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -lm -ldl")
# vrep
include_directories(example-app remoteApi)
include_directories(example-app include)
add_definitions (-DNON_MATLAB_PARSING)
add_definitions (-DMAX_EXT_API_CONNECTIONS=255)
add_definitions (-DDO_NOT_USE_SHARED_MEMORY)
add_executable(example-app main.cpp remoteApi/extApi.c remoteApi/extApiPlatform.c)
target_link_libraries(example-app ${TORCH_LIBRARIES} ${OpenCV_LIBS})
set_property(TARGET example-app PROPERTY CXX_STANDARD 14)
Thank you very much .
Regards.