Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

configure: error: C preprocessor fails sanity check

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?

like image 847
RegedUser00x Avatar asked Feb 23 '13 15:02

RegedUser00x


2 Answers

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
like image 68
Mike Kinghan Avatar answered Oct 09 '22 01:10

Mike Kinghan


Thanks Menno, in my case exporting didn't quite do it but it was close. Passing CPP=... to configure did the trick:

mkdir build
cd build
../configure --prefix=/usr/local/gcc/ CC=/usr/local/gcc/bin/gcc \
 CXX=/usr/local/gcc/bin/g++ CPP='/usr/local/gcc/bin/g++ -E'
like image 35
user1983566 Avatar answered Oct 08 '22 23:10

user1983566