web-dev-qa-db-ja.com

OS X 10.9.2:Cコンパイラーが動作するかどうかを確認します...いいえ

Texinfo 5.2をインストールしようとしていますが、./configureは、Cコンパイラに関連していると思います。 Snow Leopardからアップグレードしたときに、クリーンインストールを実行しなかったため、おそらく問題の一部です。とにかく、ここに私が持っているものがあります:

ryansmacbook:texinfo-5.2 ryan$ Sudo ./configure CC="gcc -Arch i386 -Arch x86_64 -Arch ppc -Arch ppc64"                  CXX="g++ -Arch i386 -Arch x86_64 -Arch ppc -Arch ppc64"                  CPP="gcc -E" CXXCPP="g++ -E"
Password:
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '0' is supported by ustar format... yes
checking whether GID '0' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking for Perl... /usr/bin/Perl
checking Perl version and Encode module... yes
checking for gawk... (cached) awk
checking for gcc... gcc -Arch i386 -Arch x86_64 -Arch ppc -Arch ppc64
checking whether the C compiler works... no
configure: error: in `/Users/ryan/Downloads/texinfo-5.2':
configure: error: C compiler cannot create executables
See `config.log' for more details

これに関連する他の質問をいくつか読んだので、コマンドラインツールをインストールしようとしました。

ryansmacbook:~ ryan$ xcode-select -p
/Applications/Xcode.app/Contents/Developer

そのため、App StoreからインストールされたXcode 5.1を実行していますが、それらはインストールされていないようです。私が読んだものから、コマンドラインツールをインストールする必要がありますが、私は試しました

$ xcode-select --install

とにかく、インストールするように指示すると、「ソフトウェアアップデートサーバーから現在利用できないため、ソフトウェアをインストールできません」というメッセージがポップアップ表示されます。

http://www.topbug.ne​​t/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-で回避策と思われるものを見つけましたmac-os-x / 、だから私は次のことをした:

ryansmacbook:Tools ryan$ brew install coreutils
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
==> Downloading http://ftpmirror.gnu.org/coreutils/coreutils-8.22.tar.xz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/coreutils/8.22 --program-prefix=g --w
==> make install
==> Caveats
All commands have been installed with the prefix 'g'.

If you really need to use these commands with their normal names, you
can add a "gnubin" directory to your PATH from your bashrc like:

    PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"

Additionally, you can access their man pages with normal names if you add
the "gnuman" directory to your MANPATH from your bashrc as well:

    MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"

/usr/local/share/info/dir: Permission denied
==> Summary
????  /usr/local/Cellar/coreutils/8.22: 211 files, 10M, built in 2.4 minutes

しかし、私はまだ./configure 問題。

参考のために、

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-Apple-darwin13.1.0
Thread model: posix

先日gcc-4.7をインストールしようとしましたが、現在はgcc-4.7

/usr/gcc-4.7.2/bin/gcc-4.7

コマンドラインからコマンドとして実行する方法がわかりません

$ gcc-4.7 --version
-bash: gcc-4.7: command not found

私が今得ているものですが、それはここでもそこでもないかもしれません。

編集:これはCコンパイラが動作するかどうかをチェックすることに関する私の質問に直接答えないので、私はこれを答えとして提出していません。試してみましたbrew install texinfo、そしてそれは魅力のように働いた。この時点で、ソースからtexinfoをインストールしようとした理由を本当に思い出せず、必要なものを思い出せません(おそらく何かGNU Make関連またはEmacs関連?)。

26
Ryan M

Xcodeをインストールした後、この同じ問題に直面しました。私がしなければならなかったのは、gccを実行することだけでした。次に、Xcodeライセンスに同意するように求められました。その後、それはうまくいきました。

これが誰かを助けることを願っています。

12
GeneralBecos

私はその答えを本当に信用することはできませんが、同じことが起こりました。 Ruby-1.9.3 Rubyを取得しようとしました。 RVMはgcc46を取得し、homebrewにインストールするように指示しました。しかし、rvm installコマンドはそれを気に入らなかった。そう brew uninstall gcc46 その後 brew install Apple-gcc42は魔法のように働いた。

7
Ben Johnson
Sudo ln -s \ 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ \
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain
3
olivetree123

私にとっては、問題は実行していなかった

xcode-select --install

一度やったらすべてうまくいった

3
kellyfj

私のヨセミテMacでも同様の「Cコンパイラが動作するかどうかをチェックします...いいえ」という問題がありました。

私はいくつかのことをチェックしました:

$ which gcc
gcc: aliased to nocorrect gcc
$ ll /usr/bin/gcc
-rwxr-xr-x  1 root  wheel    14K 27 Sep 04:06 /usr/bin/gcc
$ gcc
gcc: fatal error: no input files
compilation terminated.
$ gcc --version
gcc: warning: couldn't understand kern.osversion '14.0.0
gcc (GCC) 4.8.3
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.

それから私はそれをインストールしました:

$ brew install gcc
Error: You must `brew link cloog' before gcc can be installed
$ brew link cloog
Linking /usr/local/Cellar/cloog/0.18.1... 8 symlinks created
$ brew install gcc
Error: gcc-4.8.3 already installed
To install this version, first `brew unlink gcc'
$ brew unlink gcc
Unlinking /usr/local/Cellar/gcc/4.8.3... 39 symlinks removed
$ brew install gcc
....

そしてそれはうまくいきました:

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
Target: x86_64-Apple-darwin14.0.0
Thread model: posix
1
santifinland

Python3のインストール中に同様の問題。私のホームブリューは古くなっていました。ホームブリューユーティリティを更新するだけです。

0
GDSM