ignore OpenMP in C++ program on machine without it
I want to run a C++ program using OpenMP on several machines. Some of them have OpenMP installed and others don't because their GCC is below version 4.2.x which doesn't support OpenMP. .
How could I make the Makefile of my program know if a machine has no OpenMP and ask g++ to ignore in my code those "#include omp.h", OpenMP directives (like "#pragma omp parallel ...") and/or library functions (like "tid = omp_get_thread_num();") instead of failing compilation? So that I can run my program without multi-threading on those machines without OpenMP?
Thanks and regards!