Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Moses__Gil
Beginner
153 Views

Creating a universal binary using Intel compiler

In MacOSX, gcc command line accepts multiarchitecture options:

gcc -arch i386 -arch x86_64 etc.

... and creates a universal binary by compiling and linking for both archs and running lipo for gluing them together.

However using this command line with Intel, produces a compiler warning:

command line warning #10121: overriding '-arch i386' with '-arch x86_64'

The other option is to perform all 3 steps on my own, however since I'm using cmake - that forces an awkward workaround.

Am I doing something wrong or is this a compiler limitation?

0 Kudos
4 Replies
TimP
Black Belt
153 Views

The compiler doesn't support 32bit compatibility in an x86_64 build.  You would use the compiler targeting 32bit mode, which will run well on x86_64. If you really wish to target i386, Intel calls it ia32, but I doubt you would find a use for it.  You can choose to support older cpu such as sse3 and also include optimization for a newer one such as avx.

jimdempseyatthecove
Black Belt
153 Views

Have you considered building two dynamic libraries (one 32-bit, the other 64-bit) then have a dual architecture stub program load and call the appropriate dynamic library?

Jim Dempsey

Moses__Gil
Beginner
153 Views

Jim, as stated in my original post, I could manually do it - however I was hoping that it could work as easy as gcc works.

Gil.

Olga_M_Intel
Employee
153 Views

Intel Compiler 18.0 documentation clearly says you should build separate 32-bit and 64-bit binaries and combine them in a fat one

https://software.intel.com/en-us/cpp-compiler-18.0-developer-guide-and-reference-building-a-universa...

 

Reply