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

Creating a universal binary using Intel compiler

Moses__Gil
Beginner
797 Views

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
Honored Contributor III
797 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.

0 Kudos
jimdempseyatthecove
Honored Contributor III
797 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

0 Kudos
Moses__Gil
Beginner
797 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.

0 Kudos
Olga_M_Intel
Employee
797 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-universal-binary-from-the-command-line

 

0 Kudos
Reply