program and shared library

General OpenMP discussion

program and shared library

Postby AikidoGuy » Fri Oct 18, 2013 12:32 pm

Hello Everyone,

gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

I am fairly new to OpenMP. I have a program P that I compile to E and then E creates code C and compiles C into a shared library S at runtime.

Should both P and C be compiled with -fopenmp? or is it sufficient to compile only P with -fopenmp? I am a little unclear about what/when things are happening in this situation.

And links/tips/explanations would be much appreciated. Thanks!
Posts: 1
Joined: Fri Oct 18, 2013 12:17 pm

Re: program and shared library

Postby ftinetti » Sat Oct 19, 2013 8:11 am


I don't fully understand your description, but as a "rule" to compile: if you have a OpenMP directives in your source code, then you should use the -fopenmp flag when compiling that source code. In a first try, I think that compiling everything with -fopenmp flag would not hurt... but maybe I'm losing something.


Posts: 603
Joined: Wed Feb 10, 2010 2:44 pm

Return to Using OpenMP

Who is online

Users browsing this forum: No registered users and 6 guests