Doing something to activate OMP is existing behavior. That is not changing.
For example, on Linux, I need to add -fopenmp flag to CXXFLAGS. On Windows, I'm not sure what I have to do.
Yep, preserve existing behavior is an underlying theme. If the user does nothing, then nothing new happens.
Well, I think we can pick it up automatically based on user actions. If the user can activate OMP in one step (-fopenmp), then I don't think there's a reason to require two steps (-fopenmp and CRYPTOPP_OPENMP_AVAILABLE).
Also, OpenMP is incorporated with instrumentation though #pragmas, so I don't think there's much point in conditionally removing them. For example, exiting code:
#pragma omp parallel
#pragma omp sections
{
#pragma omp section
cp = ModularSquareRoot(cp, m_p);
#pragma omp section
cq = ModularSquareRoot(cq, m_q);
}
In the code above, the ModularSquareRoot always executes. Guarding code blocks with CRYPTOPP_OPENMP_AVAILABLE won't gain anything, and it makes us write more code:
#ifdef CRYPTOPP_OPENMP_AVAILABLE
#pragma omp parallel
#pragma omp sections
{
#pragma omp section
cp = ModularSquareRoot(cp, m_p);
#pragma omp section
cq = ModularSquareRoot(cq, m_q);
}
#else
cp = ModularSquareRoot(cp, m_p);
cq = ModularSquareRoot(cq, m_q);
#endif