I’ve followed the tutorials and successfully created an example program. While building the program, I encountered several common bugs like missing MKL-DNN libraries and fixed them by building it from the source. Finally, everything works perfectly on my computer
However, when I want to migrate it to a clean computer, the program crashed. The reported error was:
Dyld Error Message: Library not loaded: @rpath/libc10.dylib
I found it’s because of missing dynamic libraries in libtorch, but I cannot assume everyone has it.
I think the possible solutions are:
- compile the program by static linking.
- include the .dll/.dylib with the program
I am not familiar with C++. Are the proposed solutions correct? If so, how to achieve that, or what flags and path should I set in the CMAKE? I want my program being portable and no need to install extra dependencies on new computers.