I installed Intel's compilers and applications bundled with their Parallel Studio the other day and I cannot compile without using icc. When using gcc, clang or mpicc, I get the following error:
In file included from z.main.c:13:0:
/opt/intel/include/math.h:29:3: error: #error "This Intel <math.h> is for
use with only the Intel compilers!"
# error "This Intel <math.h> is for use with only the Intel compilers!"
^
main
Normally I have to link to the math.h library with -lm, and this works with other files. The other cases I've tested do not include mpi.h, if it matters.
I don't care to uninstall the intel compilers; I was hoping to fix whatever problems I have locally before moving to working remotely via ssh.
Update
I ran gcc fvm.c -c --trace -lm to see where it was looking for the math library. Here is the result:
gcc z.fvm.c -c --trace -lm
. /usr/include/stdio.h
.. /usr/include/features.h
... /usr/include/x86_64-linux-gnu/sys/cdefs.h
.... /usr/include/x86_64-linux-gnu/bits/wordsize.h
... /usr/include/x86_64-linux-gnu/gnu/stubs.h
.... /usr/include/x86_64-linux-gnu/gnu/stubs-64.h
.. /opt/intel/include/stddef.h
.. /usr/include/x86_64-linux-gnu/bits/types.h
... /usr/include/x86_64-linux-gnu/bits/wordsize.h
... /usr/include/x86_64-linux-gnu/bits/typesizes.h
.. /usr/include/libio.h
... /usr/include/_G_config.h
.... /opt/intel/include/stddef.h
.... /usr/include/wchar.h
... /opt/intel/include/stdarg.h
.. /usr/include/x86_64-linux-gnu/bits/stdio_lim.h
.. /usr/include/x86_64-linux-gnu/bits/sys_errlist.h
. /usr/include/stdlib.h
.. /opt/intel/include/stddef.h
.. /usr/include/x86_64-linux-gnu/bits/waitflags.h
.. /usr/include/x86_64-linux-gnu/bits/waitstatus.h
... /usr/include/endian.h
.... /usr/include/x86_64-linux-gnu/bits/endian.h
.... /usr/include/x86_64-linux-gnu/bits/byteswap.h
..... /usr/include/x86_64-linux-gnu/bits/wordsize.h
..... /usr/include/x86_64-linux-gnu/bits/byteswap-16.h
.. /usr/include/x86_64-linux-gnu/sys/types.h
... /usr/include/time.h
... /opt/intel/include/stddef.h
... /usr/include/x86_64-linux-gnu/sys/select.h
.... /usr/include/x86_64-linux-gnu/bits/select.h
..... /usr/include/x86_64-linux-gnu/bits/wordsize.h
.... /usr/include/x86_64-linux-gnu/bits/sigset.h
.... /usr/include/time.h
.... /usr/include/x86_64-linux-gnu/bits/time.h
... /usr/include/x86_64-linux-gnu/sys/sysmacros.h
... /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h
.... /usr/include/x86_64-linux-gnu/bits/wordsize.h
.. /usr/include/alloca.h
... /opt/intel/include/stddef.h
.. /usr/include/x86_64-linux-gnu/bits/stdlib-float.h
. /opt/intel/include/math.h
.. /usr/include/math.h
... /usr/include/x86_64-linux-gnu/bits/huge_val.h
... /usr/include/x86_64-linux-gnu/bits/huge_valf.h
... /usr/include/x86_64-linux-gnu/bits/huge_vall.h
... /usr/include/x86_64-linux-gnu/bits/inf.h
... /usr/include/x86_64-linux-gnu/bits/nan.h
... /usr/include/x86_64-linux-gnu/bits/mathdef.h
... /usr/include/x86_64-linux-gnu/bits/mathcalls.h
... /usr/include/x86_64-linux-gnu/bits/mathcalls.h
... /usr/include/x86_64-linux-gnu/bits/mathcalls.h
In file included from fvm.c:10:0:
/opt/intel/include/math.h:29:3: error: #error "This Intel <math.h> is for
use with only the Intel compilers!"
# error "This Intel <math.h> is for use with only the Intel compilers!"
^
. /usr/include/time.h
.. /opt/intel/include/stddef.h
.. /usr/include/x86_64-linux-gnu/bits/time.h
.. /usr/include/xlocale.h
. fvm.h
. lab_mpi.h
Multiple include guards may be useful for:
/usr/include/wchar.h
/usr/include/x86_64-linux-gnu/bits/byteswap-16.h
/usr/include/x86_64-linux-gnu/bits/byteswap.h
/usr/include/x86_64-linux-gnu/bits/endian.h
/usr/include/x86_64-linux-gnu/bits/huge_val.h
/usr/include/x86_64-linux-gnu/bits/huge_valf.h
/usr/include/x86_64-linux-gnu/bits/huge_vall.h
/usr/include/x86_64-linux-gnu/bits/inf.h
/usr/include/x86_64-linux-gnu/bits/mathdef.h
/usr/include/x86_64-linux-gnu/bits/nan.h
/usr/include/x86_64-linux-gnu/bits/select.h
/usr/include/x86_64-linux-gnu/bits/sigset.h
/usr/include/x86_64-linux-gnu/bits/stdio_lim.h
/usr/include/x86_64-linux-gnu/bits/stdlib-float.h
/usr/include/x86_64-linux-gnu/bits/sys_errlist.h
/usr/include/x86_64-linux-gnu/bits/typesizes.h
/usr/include/x86_64-linux-gnu/bits/waitflags.h
/usr/include/x86_64-linux-gnu/bits/waitstatus.h
/usr/include/x86_64-linux-gnu/gnu/stubs-64.h
/usr/include/x86_64-linux-gnu/gnu/stubs.h
fvm.h
lab_mpi.h
How can I tell gcc, mpicc where to look and ignore the Intel math library?
Thanks in advance.