@shyney7
It seems to me that your make file still breaks something in building chain. This is not caused by libtorch.
I am not familiar with QNX, from your error log, I can see it compiled c++ code using v1/memory instead of standard memory lib. libtorch is compiled with standard c++14 libs, we can not guarantee it compiled with other version libs. I checked QNX a little bit, v1/memory is used for llvm compiler infrastructure, while libtorch is compiled using gcc/g++. You should compile your code using the memory lib in 5.4.0 folder (same level as ‘v1’ folder).
Can you try this, I am not sure whether it will work though.
if ("${CMAKE_SYSTEM_NAME}" STREQUAL QNX)
set(CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} -std=gnu++14 -stdlib=libstdc++”)
endif()
And another thing is that, I think it would be better to add your libtorch path into CMAKE_FIND_ROOT_PATH and put back CMAKE_FIND_ROOT_PATH_MODE_PACKAGE from BOTH to ONLY.