30

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をインストールしようとしましたが、現在は

/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 関連か?) を思い出せません。

4

8 に答える 8

7

私は本当に答えを信用することはできませんが、同じことが私にも起こりました. ruby-1.9.3 の ruby​​ を入手してみました。RVM は gcc46 を取得し、homebrew にそれをインストールするように指示しました。しかし、rvm install コマンドはそれを好まなかった。それでbrew uninstall gcc46、それからbrew install apple-gcc42魅力のように働きました。

于 2014-10-11T19:39:11.217 に答える
6

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

xcode-select --install

私がそれをしたら、すべてがうまくいきました

于 2016-01-04T16:55:44.237 に答える
3
sudo ln -s \ 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ \
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain
于 2016-03-29T03:13:00.213 に答える
2
sudo gcc --version

Xcode/iOS ライセンスに同意するには、管理者権限が必要です。sudo 経由で root として再実行してください。

于 2016-05-02T15:13:50.070 に答える
1

Yosemite 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
于 2014-11-19T08:24:35.433 に答える