2013-02-23 39 views
4

我正在編譯Ubuntu 12.04 x86_64上的幾個庫。首先,我使用GCC 4.7.2編譯了這些庫,它運行良好。然後我嘗試用Inte Composer 2013 u2重新編譯它們。 FOT爲此我做:配置:錯誤:C預處理器未通過健全性檢查

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

然後我跑./configure並得到了以下錯誤:

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 

配置日誌文件包含此錯誤:

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) 

可以採取什麼錯在這裏?

+0

查看'conftest.c'文件以瞭解正在測試的內容。 – 2013-02-23 15:27:17

+0

某些本應編寫'conftest.c'文件(有用地包含在所示日誌中)的錯誤與「語法錯誤」有關,並且結果不能編譯。要了解這是什麼意思探索自動工具故障的波折(*不寒而慄*),也許是從以前的運行剩餘。在確定以前的版本不存在之後再試一次(可能是「使distclean」或類似的東西)。 – vonbrand 2013-02-24 03:46:12

+0

我試着用'make clean'和'make distclean'來清理,但仍然是同樣的問題。我下載了另一個庫並嘗試了相同的方式,但是它以相同的方式失敗。然後我切換回GCC並編譯這兩個庫。 – RegedUser00x 2013-02-24 08:32:21

回答

9

的問題可能是,在GNU使隱變量 表示「C++編譯器」不是CPPCXX,而CPP是 ,它表示「你的C預處理器」的隱含變量;所以 您

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

告訴configure是ICPC是預處理和葉CXX大概 默認爲G ++。

這是由./configure錯誤支持:

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

嘗試:

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

或者只是:

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

好趕上! (我忽略了它) – wildplasser 2013-02-27 22:59:42

3

FWIW,我就遇到了這個今天和我的解決辦法是

export CPP='<path to icpc> -E'

也就是說,要告訴configure預處理器應該與-E標誌一起運行。

0

謝謝門諾,在我的情況下出口沒有完全做到,但它很接近。通過CPP = ...進行配置訣竅:

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'