It didn't. That is why I asked.

Thank you.

On Aug 6, 2011, at 1:31 AM, Marcus Karlsson wrote:


--On July 31, 2011 4:49:34 PM -0700 JongAm Park <jongamp...@sbcglobal.net > wrote:

Hello,

Because gcc now supports OpenMP, we can use pragmas for OpenMP without doing any special steps except for setting "Enable OpenMP" and "- fopenmp".

However, when I tried to use OpenMP functions like :
int omp_get_max_threads(void)
omp.h should be included.
However the location of omp.h is not /usr/inlcude, /usr/local/ include (
if any ) etc. It was under

/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/omp.h
/usr/lib/gcc/powerpc-apple-darwin10/4.2.1/include/omp.h
/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin10/4.2.1/include/omp.h

However, as you can see, they are under /usr/lib.
It means that Apple or GCC people wanted to hide the include directory ,
i.e. lib/gcc/i686-apple-darwin10/4.2.1/include for example, under a
specific compiler's folder under /usr/lib.

So, although it would be possible to set a header path, but to make the
compiler choose appropriate one ( as you can see, those three are for
different gcc versions, intel, powerpc and llvm-gcc ), I believe there should be some mechanism to include them in "directory-path-free" way.

Is there any such way to include the omp.h?
Or should their include path set just like other header path?

The reason why the header file is located in a per-compiler directory is that OpenMP has to be implemented by the compiler itself. That way, omp.h may change from compiler to compiler. It will also assure that an error is generated if OpenMP is not supported.

In general you shouldn't have to deal with where exactly the file is located. Just include <omp.h> and give the compiler the -fopenmp option. In Xcode setting "Enable OpenMP Support" should be sufficient. The compiler will find the correct header file.

Marcus


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to