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

Migration from gcc compiler to icc compiler

vijay_jain
Beginner
881 Views
Hi All,

We are planning to use icc compiler instead of existing gnu compiler. Though the icc compiler states that libraries compiled with gnu are compatible to use with icc. But we would prefer to re-compile the open source codes for ldap, xerces and openssl code with icc compiler.

So I would like to know if someone has experience of compiling these open source codes with icc compiler? Are there any known issues that needs to be taken care of during compilation with icc? Do the make file providedwith the code has flags to changes the compiler to icc.

Pointer to any documents such as readme or instructions to followed for compiling the open source codes for ldap, xerces and openssl ldap c code with icc compiler would help.

Also in the intel compiler documentation i always see documentation about compatibility with gcc compilers. But i have never seen documentation about migration from gcc to intel complier. Pointers to such documents which provides information about consideration for migration to icc compiler would also help.

Please share your knowledge at the earliest.

Thanks,
Vijay

0 Kudos
5 Replies
TimP
Honored Contributor III
881 Views
Current icc 9.1 is compatible with gcc versions from about 3.2 through 4.1.1. You shouldn't have much trouble with applications which run OK with those gcc versions. If you do, you are certainly entitled to ask about it here, or file an issue on your premier.intel.com account. If an application depends on an older version of gcc, that is probably outside the scope of this forum.
A few of the icc command line options are accepted with the gcc names. Perhaps there should be a more accessible documentation of a few of the common differences, e.g.
1) gcc defaults to -O0, while icc defaults to -O2, except when -g is set. icc -O is the same as -O2, while gcc -O is like -O1.
2) icc -fp-model fast (the default) is somewhat analogous to gcc -ffast-math. More reliable usually, but also more aggressive. -fp-model precise is closer to what you get from gcc without -ffast-math.
3) 32-bit icc defaults to code for an Intel CPU which is long out of production. The most commonly used option, -xW, has about the same effect as gcc -march=pentium4 -ftree-vectorize -mfpmath=sse.
4) the system for profile (feedback) guided optimization is different.
0 Kudos
mazterthe
Beginner
881 Views

Regarding: "3) 32-bit icc defaults to code for an Intel CPU which is long out of production".. Which CPU is that? and does the windows comiler do the same, if so, which one?

Sorry for hijacking this thread, hope your problems will be solved, vijay_jain

TZ

0 Kudos
TimP
Honored Contributor III
881 Views
The default 32-bit code is compatible with early Pentium CPUs prior to Pentium II/Pro, and the option to optimize specifically for those CPUs has been dropped. For code which is a compromise between P-III compatibles and more recent CPUs, you should be using -xK (-QxK Windows). That is the oldest CPU family for which a specific flag is available.
0 Kudos
Rick_Paulson
Beginner
881 Views

Documentation onmigrating gcc apps to Intelis planned forthe 10.0 release.

-Rick

0 Kudos
John_O_Intel
Employee
881 Views

Hi,

We have a white paper 'Intel Compilers for Linux* - Compatibility with GNU Compilers' at http://cache-www.intel.com/cd/00/00/28/47/284736_284736.pdf. In general, you shouldn't need to make source changes to use icc vs gcc. There are a few obscuregcc language extensions that icc doesn't support, but most gcc language extensions are supported. For C++ you might need to make minor source code changes dealing with template code that do not follow the C++ standard. The Intel Compiler matches the behavior of the particular version of gcc you are using, but it's possible you may find a corner case that hasn't been covered. I recently worked on a mult-million line enterprise C++ application, and porting to icc boiled down to 6 source changes, all of these dealt with code not following the C++ standard, with simple source code changes.

I've built Xerces with icc for many years, and the Xerces configuration files support icc. I also downloaded & built openssl.Here's how to build the latest version, I did this on IA-32 with icc 9.1.045:

#Extract tarfile
$ tar zxvf xerces-c-current.tar.gz
$ cd xerces-c-src_2_7_0/
$ export XERCESCROOT=`pwd`
$ cd src/xercesc/
$ ./runConfigure -x icpc -c icc -p linux > runConfigure.log
$ gmake >& gmake.log &

Downloaded from http://www.openssl.org/source/openssl-0.9.8d.tar.gz
tar zxvf openssl-0.9.8d.tar.gz
cd openssl-0.9.8d
./Configure linux-ia32-icc
make >& gmake.log &

I haven't builtldap or ran Xerces or openssl, but ifyou run into problems you can post. Do you have benchmarks or workloads that you use to evaluate performance of these packages ?

Regards,

_|ohnO

0 Kudos
Reply