How to Static libraries for pytorch to execute pytorch c++ code

Hi, I have loaded the model with pytorch c++ api. And compiled and executed with linking the dynamic libraries. Is there any way to create static libraries for pytorch and execute the code with them? Hope I get the solution of this.

1 Like

If you set the CMake flag BUILD_SHARED_LIBS to off, you will get static libraries.

Best regards


Thanks a lot for the quick solution to me. As of now my exe is using dynamic libraries only. If I set BUILD_SHARED_LIBS off, can it able to link the static libraries by it self and get the succesful execution!!! Can I get the more details about this in any forum…please