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

does Intel compiler set a preprocessor symbol LINUXI (on linux) to identify itself?

retspeej
Beginner
319 Views
I came across some code like this
#if (LINUXA || LINUXI || LINUXP)
which tested if it was Absoft, Intel or Portland linux compilers (as opposed to something unsupported).
I can't see these symbols defined anywhere in this particular package.
I recall a very old Microsoft compiler that had a predefined preprocessor symbol MSDOS so you could test if the code was being used on the appropriate platform.
Do Intel compilers generate some preprocessor symbol like LINUXI?
0 Kudos
3 Replies
TimP
Honored Contributor III
319 Views
When you run ICL you get the pre-processor symbols for VC plus the __INTEL_COMPILER symbols (same as for the linux version) which you can read about in the ICL documentation.
0 Kudos
SergeyKostrov
Valued Contributor II
319 Views
>>...Do Intel compilers generate some preprocessor symbol like LINUXI?..

What that macro I'm not sure. Where did you find it?

Every C/C++ compiler has some set of PredefinedANSI-Compliant macroslike __FILE__, __LINE__, __DATE__, etc., andPredefinedCompiler-Specific macros.All these macros are generated by a compiler.
0 Kudos
Om_S_Intel
Employee
319 Views
As Tim said, the__INTEL_COMPILER macro is defined in "Intel C++ compiler and User guide". You may download a copy of it from http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/cpp/lin/main_cls_lin.pdf.

0 Kudos
Reply