How do I get autotools to compile with the Intel compiler?

Daisy Sophia Hollman picture Daisy Sophia Hollman · Aug 14, 2009 · Viewed 10.8k times · Source

I want my code to compile with the Intel compiler(s) or with gcc/g++ depending on a configure argument. Is this possible? What do I need to put in my configure.ac and Makefile.am files to make this happen?

Answer

freedrull picture freedrull · Feb 24, 2011

I would do this:

AC_PROG_CC([icc gcc])

This will look for the compilers in the order specified, unless overridden with an argument to ./configure

$ ./confgure CC=gcc