Thread: ignore OpenMP in C++ program on machine without it

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    159

    ignore OpenMP in C++ program on machine without it

    Hi,

    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!
    Last edited by lehe; 08-20-2009 at 06:11 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. c++ program for ATM machine
    By cplus2x in forum C++ Programming
    Replies: 2
    Last Post: 02-06-2008, 04:35 AM
  2. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  3. BOOKKEEPING PROGRAM, need help!
    By yabud in forum C Programming
    Replies: 3
    Last Post: 11-16-2006, 11:17 PM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM

Tags for this Thread