It seems the #error
in Intel's <math.h>
is rather blunt and obvious: The header is guarded against use with other compilers, probably because it depends on specific extensions (e.g., built-in functions) not available in other compilers. If it really is <math.h>
it would be part of the standard C or C++ library and as such tied to the compiler unless it is explicitly part of the platform ABI which doesn't seem to be the case.
It doesn't quite look as if you want to use Intel's <math.h>
but only other headers from Intel's library. In that case one of the following techniques may work:
- Specify the location of the system/gcc
<math.h>
with another -I
option preceding the one for Intel's headers: the order in which headers are searched is generally the same order in which the -I
options appear.
- Do not use a
-I
directive to find Intel's headers but include them with a path name or with a relative path name (the latter in combination with a -I
option, e.g., -I/opt/intel
).
- Create a custom directory with symbol links to the headers/directories in
/opt/intel/include
and remove any header which you want to get picked up from somewhere else. Alternatively, work the other way around: create a symbolic link to each header needed from /opt/intel/include
.
Since this directory doesn't seem to be constructed to be usable as a drop-in for other compilers, it is quite possible that none of this won't work: headers shipping with a specific compiler have a tendency to be specific to that compiler. For example, you'll also need to link to the corresponding Intel libraries and I'm not sure if the Intel compiler and gcc use the same ABI (on Linux they may use a common ABI, though).