3

One of the few Boost libraries that are not header only (therefore need to be compiled separately) is program_options.

I need to run a program that I compile on my PC in a cluster that has no Boost installed. I don't have administrative rights to install Boost and contacting the cluster's admin is too burocractic and slow.

How can I compile my program in my PC (which has Boost) such that it includes program_options (I think this is called static linking)?

Now, I plan to run several instances of my program. Is static linking the best approach? Every instance of my program will load a separate instance of program_options, which is wasteful. Is there a better alternative? Some sort of "local dynamic linking" that I can setup on the cluster without root access?

alfC
  • 14,261
  • 4
  • 67
  • 118
a06e
  • 18,594
  • 33
  • 93
  • 169

1 Answers1

1

You can compile and install Boost, or just Boost Options, as a local user. Then compile your program against this local version. Finally, run your code with an updated LD_LIBRARY_PATH environment variable that includes where the Boost Options library lives.

Charles L Wilcox
  • 1,126
  • 8
  • 18