configure: error: C preprocessor fails sanity check

RegedUser00x picture RegedUser00x · Feb 23, 2013 · Viewed 17.7k times · Source

I am compiling several libraries on Ubuntu 12.04 x86_64. First I compiled the libraries with GCC 4.7.2 and it went all well. Then I tryed to recompile them with Inte Composer 2013 u2. Fot that purpose i did:

export CC=/opt/intel/composer_xe_2013.2.146/bin/intel64/icc
export CPP=/opt/intel/composer_xe_2013.2.146/bin/intel64/icpc

Then I run ./configure and got the following error:

checking how to run the C preprocessor... /opt/intel/composer_xe_2013.2.146/bin/intel64/icpc
configure: error: in `/var/www/workspace/freetype/freetype-2.4.11/builds/unix':
configure: error: C preprocessor "/opt/intel/composer_xe_2013.2.146/bin/intel64/icpc" fails sanity check
See `config.log' for more details
make: *** [setup] Error 1

The config log file contains this error:

configure:3345: checking how to run the C preprocessor
configure:3415: result: /opt/intel/composer_xe_2013.2.146/bin/intel64/icpc
configure:3435: /opt/intel/composer_xe_2013.2.146/bin/intel64/icpc  conftest.c
conftest.c(14): error: identifier "Syntax" is undefined
             Syntax error
             ^

conftest.c(14): error: expected a ";"

compilation aborted for conftest.c (code 2)

configure:3435: $? = 2
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "FreeType"
| #define PACKAGE_TARNAME "freetype"
| #define PACKAGE_VERSION "2.4.11"
| #define PACKAGE_STRING "FreeType 2.4.11"
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
|            Syntax error
configure:3435: /opt/intel/composer_xe_2013.2.146/bin/intel64/icpc  conftest.c
conftest.c(14): error: identifier "Syntax" is undefined
             Syntax error
             ^

conftest.c(14): error: expected a ";"

compilation aborted for conftest.c (code 2)

What can be wrong here?

Answer

Mike Kinghan picture Mike Kinghan · Feb 27, 2013

The problem may well be that the GNU make implicit variable that denotes "your C++ compiler" is not CPP but CXX, whereas CPP is the implicit variable that denotes "your C preprocessor"; so your

export CPP=/opt/intel/composer_xe_2013.2.146/bin/intel64/icpc

tells configure that icpc is the preprocessor and leaves CXX presumably defaulting to g++.

This is supported by the ./configure error:

checking how to run the C preprocessor... /opt/intel/composer_xe_2013.2.146/bin/intel64/icpc

Try:

export CXX=/opt/intel/composer_xe_2013.2.146/bin/intel64/icpc

or just:

./configure CXX=/opt/intel/composer_xe_2013.2.146/bin/intel64/icpc