本文介绍了在Mac上编译:如果我的编译器未能进行完整性检查,这意味着什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图安装一些天文学软件包,特别是cfitsio。使用内置mac gcc / g ++编译器和HPC编译器,我得到以下错误:

  configure:错误:C预处理程序/ usr / local / bin / g ++无法进行完整性检查
configure:error:C预处理程序/ usr / bin / g ++无法进行完整性检查



$ / usr / local / bin / g ++ --version
g ++(GCC)4.8.1
版权所有(C)2013 Free Software Foundation,Inc.
这是免费软件;请参阅复制条件的来源。没有任何b $ b保修;甚至不适用于适销性或针对特定用途的适用性。


$ / usr / bin / g ++ --version
配置:--prefix = / Applications / Xcode.app /目录/ Developer / usr --with-gxx -include-dir = / usr / include / c ++ / 4.2.1
Apple LLVM版本5.0(clang-500.2.79)(基于LLVM 3.3svn)
目标:x86_64-apple-darwin13.0.2
线程模型:posix

查看 config.log code>,正如所暗示的那样,是相当不真实的:

  configure:3409:检查如何运行C预处理器
configure:3479:result:/ usr / local / bin / g ++
configure:3499:/ usr / local / bin / g ++ conftest.c
conftest.c:14:8:error:'语法'不命名类型
语法错误
^

我的安装命令看起来像:

  CPP = / usr / local / bin / g ++ CXX = / usr / local / bin / g ++ CC = / usr / bin / gcc CFLAGS = -  arch x86_64 -g -O2./configure 
CPP = / usr / bin / g ++ CXX = / usr / bin / g ++ = - arch x86_64 -g -O2./configure

谷歌搜索迄今没有取得丰硕成果。我错过了什么或做错了什么? 解答方案

答案由@ n.m标识。在注释中:环境变量 CPP 被错误地设置为指向 g ++ ,这当然不起作用。 cpp 是我系统上C预编译器的名称。


I'm trying to install some astronomy packages, specifically cfitsio. Using both the "built-in" mac gcc/g++ compilers and the HPC compilers, I get the following errors:

configure: error: C preprocessor "/usr/local/bin/g++" fails sanity check
configure: error: C preprocessor "/usr/bin/g++" fails sanity check



$ /usr/local/bin/g++ --version
g++ (GCC) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


$ /usr/bin/g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.2
Thread model: posix

Looking at config.log, as suggested, is rather unrevealing:

configure:3409: checking how to run the C preprocessor
configure:3479: result: /usr/local/bin/g++
configure:3499: /usr/local/bin/g++  conftest.c
conftest.c:14:8: error: 'Syntax' does not name a type
        Syntax error
        ^

My install commands look like:

CPP=/usr/local/bin/g++ CXX=/usr/local/bin/g++ CC=/usr/local/bin/gcc CFLAGS="-arch x86_64 -g -O2" ./configure
CPP=/usr/bin/g++ CXX=/usr/bin/g++ CC=/usr/bin/gcc CFLAGS="-arch x86_64 -g -O2" ./configure

Googling has so far yielded no fruitful results. What am I missing or doing wrong?

解决方案

The answer was identified by @n.m. in the comments: The environmental variable CPP was incorrectly set to point to g++, which of course will not work. cpp is the name of the C precompiler on my system.

这篇关于在Mac上编译:如果我的编译器未能进行完整性检查,这意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 23:51