0

I am pretty new to c++. At the moment I am working on ONNX involving project and I have a question, if I have to make my application portable (assuming that person which will be using it does not have installed onnx on their machine) do I have to install whole library in my project folder or how should I do it?

Thanks for help

Bearnardd
  • 37
  • 5
  • 1
    I don't know what ONNX is, but typically, any framework you work with will supply runtime libraries which are intended for deployment. In some cases, they may even provide you with a docker image with the dependencies pre-installed, you can copy your application into it and should be fully portable. – Mansoor Aug 29 '20 at 12:31
  • 1
    another option is to link statically to everything you use, this lessens the requirements on client machines, basically you end up with a single exe that requires no particular installation/deployment folder to run. – Yann TM Aug 29 '20 at 15:12
  • @YannTM Sorry for stupid question, but it is my first with this technology, but is it possible for me to statically link library so the person using my application, does not need to have a particular library installed on their machine? If so would you be so nice and link so exmaple? – Bearnardd Aug 29 '20 at 17:07

1 Answers1

0

So one option is to link all your libraries statically, so the person using the application does not need to have a particular library installed on their machine

See this Q/A :

Compiling a static executable with CMake

I recommend setting up a CI machine where these libraries are available (or better yet with a reproducible installation script/container configuration) (yes this represents some work to set up for you) and then giving the statically linked binaries buit on this machine to your clients (so no hassle for them).

You'll read online about potential compatibility issues with statically linked binaries and complaints about exe size (some people believe -static is evil), but honestly this approach puts the least strain possible on client configuration.

Yann TM
  • 1,942
  • 13
  • 22