Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Matthew_Z_1
Beginner
409 Views

Parallel Studio XE 2016 Composer Xcode OpenMP Integration

Hi there,

So I've installed Parallel Studio 2016 XE Composer and have it integrated with my XCode.  In fact I am able to change my project build settings to use ICC Intel C++ Compiler latest release, or even version 16.0.  However, when I try to use #include <omp.h> at the top of my file, the compiler does not recognize omp.h.  I also tried installing this: https://www.openmprtl.org/download#stable-releases which is supposedly coupled with the latest parallel studio on Mac.  However, it uses clang, and after installing cmake and using cmake to install the OpenMP in that link, it turns out omp.h is still not recognized no matter which of the three compilers I use, whether it be Apple's clang or the other two intel compilers.  I also searched my file system for omp.h and it turns out that it is located in /opt/intel/compilers_and_libraries_2016.1.111/mac/compiler/include/.  I manually added that path to my header search paths in XCode, but my program still cannot find omp.h.  I also tried including <libiomp/omp.h> and <libomp/omp.h> to no avail.  Any ideas on how I can get openmp to function properly?

P.S.

When I run intel software manager, it seems that if I go under the licenses tab, there are buttons to activate five things on a list: Integrated performance primitives, math kernel library, parallel studio XE 2016 composer edition for c++, and other things.  It says support expires on 11/6/16, and if I click the activate button, it will ask for my serial number, and if I enter it and then click the second activate button, it will tell me that the license file cannot be saved and to make sure I have permissions to Intel license folders.  Could this be an issue?

Thanks!

0 Kudos
40 Replies
Matthew_Z_1
Beginner
299 Views

Well now after I chown the licenses directory for Intel and resubmit my serial, it will say that the product has been successfully activated, but nothing on that screen changes.  In other words, it still has buttons to activate the various licenses.  Maybe that's not the issue

Kittur_G_Intel
Employee
299 Views

Hi Mathew, did you use the -qopenmp option to enable openmp when you compile?

_Kittur

Matthew_Z_1
Beginner
299 Views

I just tried -qopenmp for Other C Flags under Apple LLVM 7.0 - Custom Compiler Flags, but an error occurred saying 'Unknown argument -qopenmp.'

 

I was using -fopenmp I believe, which was not working.

Matthew_Z_1
Beginner
299 Views

It turns out that I probably had to add a rule to Build Rules of my project target.

I added a rule to compile C++ files using the intel compiler 16.0

However, now I have an issue, a compiler error:

ipo: warning #11013: can not find -framework Accelerate

ipo: warning #11013: can not find -framework Accelerate

ipo: warning #11013: can not find -framework Cocoa

ipo: warning #11013: can not find -framework Cocoa

ipo: warning #11013: can not find -framework GLUT

ipo: warning #11013: can not find -framework GLUT

ipo: warning #11013: can not find -framework OpenGL

ipo: warning #11013: can not find -framework OpenGL

From

Command /usr/local/bin/icpc-16.0 failed with exit code 1

Matthew_Z_1
Beginner
299 Views

I also followed the instructions in the getting started guide in my filesystem.  I set my environment variables using compilevars.sh.  Still XCode does not recognize what omp.h is.  I also tried to include libiomp5.dylib directly in my XCode, but this does not work either.

Matthew_Z_1
Beginner
299 Views

I have now tried to directly put libiomp5.dylib into my project, and directly referenced the file from XCode.  My project will build and run and then give me the exact same issue that I came across when trying to run from the command line the first time:

 

dyld: Library not loaded: libiomp5.dylib

  Referenced from: /Users/matthew/Library/Developer/Xcode/DerivedData/ParallelTest-abdudqxfofvwrbfhvwgxzxpgdaas/Build/Products/Debug/ParallelTest

  Reason: image not found

Program ended with exit code: 9

This issue was fixed in the command line when I just exported the variable using:

 

export DYLD_LIBRARY_PATH="/opt/intel/compilers_and_libraries_2016.1.111/mac/compiler/lib/:$DYLD_LIBRARY_PATH"

 

 

or

 

source /opt/intel/bin/compilervars.sh intel64

 

 

However, every time I create a new terminal and try to 

echo $DYLD_LIBRARY_PATH

 

It comes up empty, which I think may be causing the problem since this implies that the shell script never permanently sets the path variable.

 

 

Matthew_Z_1
Beginner
299 Views

So now my project will actually build and run.

I had to manually edit the scheme and include DYLD_LIBRARY_PATH as an environment variable and set its value to /opt/intel/compilers_and_libraries_2016.1.111/mac/compiler/lib/

I also had to manually include libiomp5.dylib in the project.

However, my compiler still complains that it does not know what omp.h is, and shows up as a red error, even though it builds and runs.

Kittur_G_Intel
Employee
299 Views

Hi Matthew,
Thanks for your patience. I'd like to clarify a few things based on your earlier responses. There's a bug in the compiler related to DYLD_LIBRARY_PATH and a fix is expected to be the next update release (update 2).  I'll escalate this issue with our developers as well and keep you updated as soon as the release is out.  In the meantime try to see if using RPATH helps locate the libraries (@rpath/<path to the openmplib).  BTW, icl is the compiler that supports Clang FE and accepts clang options while ICC is an EDG based front-end and will not accept the clang options thereof. Hence, you cannot use clang options with icc.  That said, I'll let you know as soon as the fix for the DYLD_LIBRARY_PATH issue is fixed in the next update release. 

Also, can you let me know details on your mac system (OS and IDE info)?

Thanks,
Kittur 

Matthew_Z_1
Beginner
299 Views

Hi Kittur,

I'm not sure what an RPATH is, how it is used in XCode, or how it works.  I managed to get the XCode IDE to recognize omp.h eventually last night by manually adding a header build phase and adding the omp.h from the intel compiler folder to that build phase.  What is Clang FE and what is EDG?  Did I try to use clang options with the ICC compiler?

My mac is OS X 10.11.1 (El Capitan) and my IDE is XCode 7.1

Matt

Kittur_G_Intel
Employee
299 Views

Hi Matt,
SInce you're using the XCode IDE what you did is correct. Refer to the doc at:  https://software.intel.com/en-us/node/581681   
I couldn't reproduce the issue on my end on omp.h not getting recognized.  Anyways, can you ensure you have downloaded the latest Update 1 release of the version from the Intel registration center at: https://registrationcenter.intel.com/en/home/  and try it out?  The bug with the DYLD_LIBRARY_PATH issue exists and will be fixed in the update 2 release.  In the meantime, please try out the update 1 release and let me know if you still have issue with omp.h file not recognizing as well.   SInce you're using XCode IDE, ignore what I said about rpath.

With regard to your question on what's ICL, it's a compiler from Intel as well that supports the CLANG front-end You can read about it at  http://llvm.org/  BTW, ICL is not available presently in the 2016 release. Only icc/icpc is available as part of the package. That said, ICC supports EDG front-end (you can read about it at: https://www.edg.com/index.php?location=c_frontend 

Hope the above helps. For using the compiler and the options with ICC please refer to the doc at: https://software.intel.com/en-us/node/581608  
I'll keep you updated as soon as I am done with some investigation as well and will update you as soon as the release with the fix for the DYLD_LIBRARY_PATH issue is out.

Thanks,
Kittur 

 

Kittur_G_Intel
Employee
299 Views

Hi Matt,
Assuming you downloaded the update 1 release you should be able to resolve the openmp issue after setting the dynamic library path environment variable from commandline.  That said, let me update you on RPATH reference that I'd referred to in my earlier communication. You can search for rpath on google and understand more. Basically, you can ask the dynamic linker to search for the library in the path given using rpath which will ensure that the linker will try that location to search for the library as well.   With update 1, the use of rpath won't work but is fixed in update 2 release that is the  next scheduled release.  

The latest compiler release (16.0 U1) contains the OpenMP library without rpath fix. The fix to have OpenMP library installation name ‘@rpath/libiomp5.dylib’ was implemented recently and will be included into OpenMP library released with compiler 16.0 Update2. When update 2 release is out, you will be able to use “-Wl,-rpath,<path_to_lib>” option while linking an application.   I'll keep you updated as soon as that release is out.  Appreciate your patience through this.

 

Kittur
 

chinhster
Beginner
299 Views

I am able to successfully build with Xcode 7.1.1 and 16.0 U1 but am getting the following warnings:

 

Ld /Users/someuser/myapp/407/myapp/MyApp-MP.app/Contents/MacOS/MyApp-MP normal x86_64
    cd /Users/someuser/myapp/407/src/mac
    export MACOSX_DEPLOYMENT_TARGET=10.7
    /usr/local/bin/icpc-16.0.111 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -L/Users/someuser/myapp/407/myapp -L/Users/someuser/myapp/407/src/mac/../../olibxl -L/Users/someuser/myapp/407/src/mac/../../odistr -L/Users/someuser/myapp/407/src/mac/../../olibharu -L/Users/someuser/myapp/407/src/mac/../ICU/osxx86_64/lib -F/Users/someuser/myapp/407/myapp -filelist /Users/someuser/myapp/407/build/myapp.build/Release/MyApp-MP.build/Objects-normal/x86_64/MyApp-MP.LinkFileList -mmacosx-version-min=10.7 -multiply_defined warning -static-intel -qopenmp -stdlib=libc++ -framework ApplicationServices -framework Cocoa -framework QuartzCore -framework Security -framework SecurityFoundation -framework SystemConfiguration /Users/someuser/myapp/407/src/scintilla/cocoa/ScintillaFramework/build/Release/Scintilla.framework/Scintilla /Users/someuser/myapp/407/odistr/distr.a -lhpdfs /Users/someuser/myapp/407/olibxl/libxl.a -lstdc++ -licuio -liculx -licuuc -licui18n -licule -licutu -licudata -o /Users/someuser/myapp/407/myapp/MyApp-MP.app/Contents/MacOS/MyApp-MP
ipo: warning #11013: can not find -framework ApplicationServices
ipo: warning #11013: can not find -framework ApplicationServices
ipo: warning #11013: can not find -framework Cocoa
ipo: warning #11013: can not find -framework Cocoa
ipo: warning #11013: can not find -framework QuartzCore
ipo: warning #11013: can not find -framework QuartzCore
ipo: warning #11013: can not find -framework Security
ipo: warning #11013: can not find -framework Security
ipo: warning #11013: can not find -framework SecurityFoundation
ipo: warning #11013: can not find -framework SecurityFoundation
ipo: warning #11013: can not find -framework SystemConfiguration
ipo: warning #11013: can not find -framework SystemConfiguration

 

My application does run without problems but the warnings are a little disconcerting. Building the same project with Xcode 6.2 and XE Composer 2015 yields no such warnings.

 

Another warning I get is:

 

GenerateDSYMFile /Users/someuser/myapp/407/myapp/MyApp-MP.app.dSYM /Users/someuser/myapp/407/myapp/MyApp-MP.app/Contents/MacOS/MyApp-MP
    cd /Users/someuser/myapp/407/src/mac
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/someuser/myapp/407/myapp/MyApp-MP.app/Contents/MacOS/MyApp-MP -o /Users/someuser/myapp/407/myapp/MyApp-MP.app.dSYM

warning: (x86_64) /nfs/fx/proj/openmp/promo/20150922/tmp/mac_32e-rtl_5_nor_sta.rel.41.r1.c0.s0....h0-fxeomac08/libtbbmalloc/backend.o unable to open object file: No such file or directory
warning: (x86_64) /nfs/fx/proj/openmp/promo/20150922/tmp/mac_32e-rtl_5_nor_sta.rel.41.r1.c0.s0....h0-fxeomac08/libtbbmalloc/backref.o unable to open object file: No such file or directory
warning: (x86_64) /nfs/fx/proj/openmp/promo/20150922/tmp/mac_32e-rtl_5_nor_sta.rel.41.r1.c0.s0....h0-fxeomac08/libtbbmalloc/frontend.o unable to open object file: No such file or directory
warning: (x86_64) /nfs/fx/proj/openmp/promo/20150922/tmp/mac_32e-rtl_5_nor_sta.rel.41.r1.c0.s0....h0-fxeomac08/libtbbmalloc/large_objects.o unable to open object file: No such file or directory
warning: (x86_64) /nfs/fx/proj/openmp/promo/20150922/tmp/mac_32e-rtl_5_nor_sta.rel.41.r1.c0.s0....h0-fxeomac08/libtbbmalloc/tbbmalloc.o unable to open object file: No such file or directory

 

Again, no such warning when using XE 2015.

 

Kittur_G_Intel
Employee
299 Views

@chinhster: Hi,
Firstly, since the warnings are coming from IPO, did you use "-ipo" switch when building the application? If you're using then can you turn ipo off and see if the warning goes away?  Basically, if a whole program optimization is requested then all those warnings are telling is that it couldn't find those in the framework and hence couldn't may be do whole program optimization etc. 

Anyways, can you attach a small reproducer that can emit those warnings? It's hard to investigate this without one as we can't reproduce the issue on our systems, thanks.

_Kittur

chinhster
Beginner
299 Views

I'm not using IPO. It's already off in the build settings.

As I mentioned earlier, I built a project with Xcode 6.2 and XE Composer 2015 that builds with no warnings, took the exact same project and built it with Xcode 7.1.1 and XE Composer 2016 Update 1 and get those warnings. I'll see what I can do about creating an example. The makefile for the CLI version of my application also produces the warning with icc 16.0.1 but doesn't for icc 15.0.1.

Kittur_G_Intel
Employee
299 Views

Interesting, if that's the case it could be a bug but the warnings themselves shouldn't be an issue since the application was built. Yes, if you can attach a small test reproducer that'll be great as I can then file the issue with our developers, appreciate much.

_Kittur

Matthew_Z_1
Beginner
299 Views

Kittur,

The entire time I was able to run without problems, but I have the exact same warnings regarding the Cocoa frameworks

Kittur_G_Intel
Employee
299 Views

Hi Matthew, thanks for the update. With regard to the ipo error messages I could reproduce but not able to reproduce the warnings coming from openmp.  I will open an issue with the developers on  the IPO warning messages with the developers since I am able to reproduce in the meantime.

Also, if you use the option "“-no-ipo”  then it should fix the warnings issue coming from IPO and you can try that as a workaround. Again, thanks for your patience through this.  

@chinhster:  I'll await a reproducer from you for the warnings coming from openmp so I can file an issue as well for that. 
BTW,  the recommended linking for OpenMP library should be dynamic. Static linking is not recommended, fyi.

_Kittur

 

chinhster
Beginner
299 Views

Kittur Ganesh (Intel) wrote:

BTW,  the recommended linking for OpenMP library should be dynamic. Static linking is not recommended, fyi.

 

Static linking has not been recommended since when? Are you suggesting that we install the shared libraries when we install our application? That seems to go against the spirit of 99% of every OS X application I've ever used where you could just simply drag and drop to install the application. Or are you suggesting we make the shared libraries part of the application's bundle which kind of defeats the point of shared libraries?

 

PS, I'm having trouble creating a simple makefile that reproduces the ipo warnings. I created a makefile using the same compile and link flags I use to build my application but with a simple hello world program and can't reproduce the warnings.

Kittur_G_Intel
Employee
299 Views

@chinhster:  
Hi, well, by default the Intel Compiler performs a dynamic link of the OpenMP* libraries and is recommended.  The main reason for recommending dynamic linking is because the use of static OpenMP libraries might cause "multiple libraries to be linked" in an application.  This could lead to unpredictable results which needs to be avoided.  That said, of course one can explicitly link statically using say on the command line using the switch " -openmp-link-static " but again is not recommended due to the reasons I just attributed earlier.

_Kittur

 

Kittur_G_Intel
Employee
122 Views

@chinhster:  Also, thanks for looking into the reproducer.  I am able to reproduce the IPO warning issue and have filed the issue with the developers. If you happen to get a reproducer that outputs the other openmp warnings shown earlier in this thread by Mathew then you can attach that to this thread. Else, for ipo warnings emitted I've a reproducer, thanks.

_Kittur

Reply