Search code examples
c++boostboost-program-options

I'm lost in boost libraries (specifically boost_program_options)


Hi all I've been banging my head against the wall all day now.

So I want to move my program onto the university supercomputer, but it doesn't have boost (and I used boost program_options in my code). On my pc, I just have -lboost_program_options and that works fine, but obviously won't work anymore.

So, I need to package the necessary stuff along with my code so that it will compile on the supercomputer (using intel icpc)

My first hurdle was compiling the line in my makefile that had the code that wanted to include the boost header, but I ran the following in my code folder:

bcp --scan --boost=/usr/include/ main.cpp destination_folder/

And put the resulting files in my include directory. which solved that.

Boost program options isn't a header only package unfortunately, so i need something else. I need to get a library or something. Because i get errors when the compiler gets to the last task on my makefile (doing all the object files)

In my travels I found this question:

extractin/building boost program_options

I tried what the answer suggests, but putting "build" in my command doesn't generate any extra files...

Now totally stuck, don't know how to get this library thing. I've read so much stuff on bjam my head is spinning, I just don't have the level of understanding to process it all in my head.

OS: Linux both systems


Solution

  • One option is to build boost on that machine. Install it in your home. Change your CXXFLAGS and LDDFLAGS to point to the proper header and library directories and build your code there. The other option is to cross compile both on your PC (if you have such a cross toolchain). Link your code statically to boost and take the final binary to the super computer.