Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

Parallel Studio XE 2016 Composer Xcode OpenMP Integration

Matthew_Z_1
Beginner
1,921 Views

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
chinhster
Beginner
558 Views

foo.c:

#include <stdio.h>

int main(int argc, char *argv[])
{
        printf("Hello world!\n");
        return 0;
}
> icc --version
icc (ICC) 16.0.1 20151020
Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.

> icc -x c -arch x86_64 -mmacosx-version-min=10.7 -O3 -w1 -std=c99 -openmp -fvisibility=hidden -fp-model precise -fno-rtti -fno-inline -lncurses -multiply_defined warning -static-intel -openmp -framework Cocoa -lstdc++  foo.c   -o foo
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil foo -o foo.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
warning: no debug symbols in executable (-arch x86_64)

dsymutil is used to generate a bundle of debug symbols that I can use to convert crash logs to symbolized crash logs since my app is stripped when shipped.

0 Kudos
chinhster
Beginner
558 Views

Here's the result from using icc 15.0.1:

 

> icc --version
icc (ICC) 15.0.1 20141022
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

> icc -x c -arch x86_64 -mmacosx-version-min=10.7 -O3 -w1 -std=c99 -openmp -fvisibility=hidden -fp-model precise -fno-rtti -fno-inline -lncurses -multiply_defined warning -openmp -framework Cocoa -lstdc++  foo.c   -o foo
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil foo -o foo.dSYM
warning: no debug symbols in executable (-arch x86_64)

 

I'm not concerned with the no debug symbols warning.

0 Kudos
KitturGanesh
Employee
558 Views

@chinhster: Thanks for the code snippet but couldn't reproduce on our systems. I've passed on the same to the product team to see if they can try to reproduce and if so I'll keep you updated, appreciate much.

_Kittur

0 Kudos
chinhster
Beginner
558 Views

Kittur Ganesh (Intel) wrote:

@chinhster: Thanks for the code snippet but couldn't reproduce on our systems. I've passed on the same to the product team to see if they can try to reproduce and if so I'll keep you updated, appreciate much.

 

FWIW, I was able to reproduce the warnings on a Mac that had been wiped and recently had El Capitan freshly installed, then Xcode 7.1.1, then XE Composer 2016 Update 1. In addition, I always test new versions of Xcode and icc on a VM before I deploy to my development Mac and the VM I used is a clean El Capitan install as well. I was able to reproduce the problem on the El Capitan VM too. You should try to reproduce the problem on a stock Mac.

0 Kudos
KitturGanesh
Employee
558 Views

@chinhster:

Hi, thanks yes, we're able to reproduce the issue as well and the issue filed with the developers who'll work on a fix. I'll keep you updated as soon as the release with the fix is out. Again, thanks for all the feedback and appreciate your patience till then.

Regards,
Kittur

 

0 Kudos
chinhster
Beginner
558 Views

I figured out how to reproduce the ipo warnings.

 

foo.c:

#include <stdio.h>

int main(int argc, char *argv[])
{
        printf("Hello world!\n");
        return 0;
}

 

> icc --version
icc (ICC) 16.0.1 20151020
Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.

> icc -x c -arch x86_64 -mmacosx-version-min=10.7 -O3 -w1 -std=c99 -openmp -fvisibility=hidden -fp-model precise -fno-rtti -fno-inline -lncurses -multiply_defined warning -static-intel -openmp -framework Cocoa -lstdc++ -c foo.c
> /usr/local/bin/icpc-16.0.111 -arch x86_64 foo.o -mmacosx-version-min=10.7 -lncurses -static-intel -qopenmp -stdlib=libc++ -framework Cocoa -lstdc++ -o foo
ipo: warning #11013: can not find -framework Cocoa
ipo: warning #11013: can not find -framework Cocoa
>

 

> icc --version
icc (ICC) 15.0.1 20141022
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

> icc -x c -arch x86_64 -mmacosx-version-min=10.7 -O3 -w1 -std=c99 -openmp -fvisibility=hidden -fp-model precise -fno-rtti -fno-inline -lncurses -multiply_defined warning -static-intel -openmp -framework Cocoa -lstdc++ -c foo.c
> /usr/bin/icpc-15.0 -arch x86_64 foo.o -mmacosx-version-min=10.7 -lncurses -static-intel -qopenmp -stdlib=libc++ -framework Cocoa -lstdc++ -o foo
>

 

0 Kudos
chinhster
Beginner
558 Views

 

 

0 Kudos
KitturGanesh
Employee
558 Views

Yes, it's a double post but thanks much. We could reproduce the ipo warnings as well, appreciate much. The developer is already investigating and will address a fix for this issue. Again, I'll let you know as soon as the release with a fix is out.

Thanks,
Kittur

0 Kudos
Royi
Novice
558 Views

After all this,

How can one distribute an Application (Executable or Dynamic Library) which uses Intel OpenMP to work on any computer?

It means one must distribute the application file + libiomp5.dylib.
Is putting them in the same folder enough (For Executable? For Dynamic Library?) or one must put "libiomp5.dylib" in a folder defined by "DYLD_LIBRARY_PATH"?

What are the default folders defined in "DYLD_LIBRARY_PATH"?
Is one of them can be written into without special rights?

Thank You.

0 Kudos
chinhster
Beginner
558 Views

Royi wrote:

After all this,

How can one distribute an Application (Executable or Dynamic Library) which uses Intel OpenMP to work on any computer?

 

We've been using -static-intel -qopenmp for years to build a statically linked executable that does not require libiomp5.dylib. Despite Kittur's recommendation against it (which I can't find in the documentation), we'll continue to do so until it stops working. I really hate dependencies and feel most applications should be able to run without requiring an installer.

0 Kudos
KitturGanesh
Employee
558 Views

@Royi:  
You can use the DYLD_LIBRARY_PATH to set the path to where the libraries are placed on the system including placing in the folder where the application is run etc. and the compiler at runtime should find the library based on the search path set in the DYLD_LIBRARY_PATH variable. BTW, the link https://software.intel.com/en-us/articles/intelr-composer-redistributable-libraries-by-version points to the redistributable libraries one can download for the product version as well.

@chinster:  Thanks for your comments. If you look at the documentation page at: https://software.intel.com/en-us/node/522690 and under "Command-Line Examples, OS X*" you'll notice the recommendation: "By default, the Intel® C++ Compiler performs a dynamic link of the OpenMP* libraries. To perform a static link (not recommended), add the option -openmp-link static. The Intel® C++ Compiler option -openmp-linkcontrols whether the linker uses static or dynamic OpenMP* libraries on Linux* and OS X* systems (default is -openmp-link dynamic)."

It's the developers choice to link statically but the recommendation as I eluded to earlier was to avoid any issues that might cause"multiple libraries to be linked" just in case which can cause unpredictable results, that's all.

_Kittur

0 Kudos
Royi
Novice
558 Views

@Kittur,

The problem is it doesn't even run on the same computer it is compiled.
Have a look here:

https://software.intel.com/en-us/forums/intel-c-compiler/topic/603144

I'm really frustrated and no one at Intel give us solution.

0 Kudos
KitturGanesh
Employee
558 Views

@Royi:  Thanks, just saw the link you mentioned in your post.  I've asked the library support engineer to respond to your question on static linking issue with IPP and should get back to you soon. 

@Mathew, @chinster:    Regarding the issue with DYLD_LIBRARY_PATH issue a new KB article with a workaround was just published. You can go over and see if the workaround works as well. Again, the workaround should work with 2016 Update 1 release, thx. The link to the article is:

       https://software.intel.com/articles/os-x-1011-support-in-intel-parallel-studio-xe-2016 


_Kittur

0 Kudos
chinhster
Beginner
558 Views

Kittur Ganesh (Intel) wrote:

@Mathew, @chinster:    Regarding the issue with DYLD_LIBRARY_PATH issue a new KB article with a workaround was just published. You can go over and see if the workaround works as well. Again, the workaround should work with 2016 Update 1 release, thx. The link to the article is:

       https://software.intel.com/articles/os-x-1011-support-in-intel-parallel-studio-xe-2016 

_Kittur

 

From the KB:

 

... an application built with Intel® Parallel Studio version 2016 (Update 1) or earlier might not work since it is unable to locate dependent libraries such as libiomp5.dylib.

 

So you're saying had my app been dynamically linked to libiomp.dylib and a user upgraded to El Capitan, my app would've no longer worked on their Mac? That KB reinforced why I'm sticking with statically linking.

 

0 Kudos
KitturGanesh
Employee
558 Views

@chinster:  The fix for that issue (described in the KB) is coming in the next update 2 release but the workaround provided with the rpath option in the article should work until then.

_Kittur

 

0 Kudos
KitturGanesh
Employee
558 Views

Hi all,
Just letting you know that this issue is fixed in the latest 16.0 update 2 release which you can download and test it out. Thanks for bringing this issue to our attention and patience through this issue as well.
_Kittur

0 Kudos
chinhster
Beginner
558 Views

I still get warnings when built using Xcode 7.2.1 with icc (ICC) 16.0.2 20160204:

 

Ld /Users/cqn/projects/stata/stata/StataMP.app/Contents/MacOS/stata-mp normal x86_64
    cd /Users/cqn/projects/stata/src/mac
    export MACOSX_DEPLOYMENT_TARGET=10.7
    /usr/local/bin/icpc-16.0.146 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -L/Users/cqn/projects/stata/stata/StataMP.app/Contents/MacOS -L/Users/cqn/projects/stata/src/mac/../../olibxl -L/Users/cqn/projects/stata/src/mac/../../odistr -L/Users/cqn/projects/stata/src/mac/../../olibharu -L/Users/cqn/projects/stata/src/mac/../ICU/osxx86_64/lib -F/Users/cqn/projects/stata/stata/StataMP.app/Contents/MacOS -filelist /Users/cqn/projects/stata/build/stata.build/Release/stata-mp.build/Objects-normal/x86_64/stata-mp.LinkFileList -mmacosx-version-min=10.7 -lncurses -multiply_defined warning -static-intel -qopenmp -stdlib=libc++ -fobjc-link-runtime -framework Cocoa /Users/cqn/projects/stata/odistr/distr.a -lhpdfs /Users/cqn/projects/stata/olibxl/libxl.a -lstdc++ -licuio -liculx -licuuc -licui18n -licule -licutu -licudata -o /Users/cqn/projects/stata/stata/StataMP.app/Contents/MacOS/stata-mp

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

 

However, I no longer get warnings when following the example I provided in message #27 above using icc 16.0.2.

 

I also still get warnings when generating dSym files:

 

GenerateDSYMFile /Users/cqn/projects/stata/stata/StataMP.app.dSYM /Users/cqn/projects/stata/stata/StataMP.app/Contents/MacOS/StataMP
    cd /Users/cqn/projects/stata/src/mac
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/cqn/projects/stata/stata/StataMP.app/Contents/MacOS/StataMP -o /Users/cqn/projects/stata/stata/StataMP.app.dSYM

warning: (x86_64) /nfs/fx/proj/openmp/promo/20151208/tmp/mac_32e-rtl_5_nor_sta.rel.41.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/20151208/tmp/mac_32e-rtl_5_nor_sta.rel.41.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/20151208/tmp/mac_32e-rtl_5_nor_sta.rel.41.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/20151208/tmp/mac_32e-rtl_5_nor_sta.rel.41.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/20151208/tmp/mac_32e-rtl_5_nor_sta.rel.41.c0.s0....h0-fxeomac08/libtbbmalloc/tbbmalloc.o unable to open object file: No such file or directory

 

0 Kudos
KitturGanesh
Employee
558 Views

@chinhster:  Thanks, I've passed on your feedback to the developer and will  touch base with you as soon as I've an update from their investigation. Appreciate your patience through this. 

Kittur

0 Kudos
chinhster
Beginner
558 Views

I wanted to point out that with Xcode 6.4 and icc 16.0.2, I don't get the ipo warnings. I only get the dSYM warnings.

0 Kudos
KitturGanesh
Employee
462 Views

Thanks @chinster, yes that's what I assumed as well and have passed that on to the developers - appreciate much.
_Kittur

0 Kudos
Reply