I'm working on a library that implements a template function which is parallelized using OpenMP.
I want to compile my library using the -fopenmp
option so that anyone who links against my library gets the parallel version, at least as long as they're using instantiations with the same types used internally in the library.
However, since the template function is defined in a header, my understanding is the user's compiler will also compile the function. If they don't use -fopenmp
won't there be two separate versions of the template, one with OpenMP and one without? Which version will the user's code get?