家庭酿造失败“命令'gcc'失败,退出状态1”错误

时间:2013-07-14 03:44:15

标签: gcc homebrew gdal

我想开始使用geodjango,为此我必须安装gdal。我正在使用MacOS 10.8.3 为了在geodjango文档中建议使用brew,但我收到以下错误:

$brew install gdal 
==> Downloading http://download.osgeo.org/gdal/1.10.0/gdal-1.10.0.tar.gz
Already downloaded: /Library/Caches/Homebrew/gdal-1.10.0.tar.gz
==> ./configure --prefix=/usr/local/Cellar/gdal/1.10.0 --mandir=/usr/local/Cellar/gdal/1.10.0/share/man --with-local=/usr/local/Cellar/gdal/1.10.0 --with-threads --with-libtool -
==> make
==> make install
==> /Users/Lucas/.virtualenvs/geotest/bin/python setup.py install --prefix=/usr/local/Cellar/gdal/1.10.0 --record=installed.txt --single-version-externally-managed
gcc-4.2 -bundle -undefined dynamic_lookup -g -L/usr/local/opt/sqlite/lib -lsqlite3 -I/usr/local/opt/sqlite/include -arch x86_64 build/temp.macosx-10.6-intel-2.7/extensions/gdalconst_wrap.o -L../../.libs -L../../ -L/private/tmp/gdal-gOux/gdal-1.10.0/lib -lgdal -o build/lib.macosx-10.6-intel-2.7/osgeo/_gdalconst.so
Your Xcode and or CLT are mis-configured. Try some or all of the following:
    xcodebuild -license
    sudo xcode-select -switch /path/to/Xcode.app
error: command 'gcc-4.2' failed with exit status 1
READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting

These open issues may also help:
    https://github.com/mxcl/homebrew/issues/19845
    https://github.com/mxcl/homebrew/issues/20373
    https://github.com/mxcl/homebrew/pull/20457

据我所知,我做了:

xcodebuild -license

并同意许可证,然后:

sudo xcode-select -switch /Applications/Xcode.app

我也检查了这些问题,但没有一个是有用的。

我安装了Xcode 4.6.3并且过去已经酿造了许多其他配方而没有任何问题。

当我经营酿酒医生时,我得到:

$brew doctor
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:

    /Library/Frameworks/Python.framework/Versions/2.7/bin/python-config
    /Library/Frameworks/Python.framework/Versions/2.7/bin/python2-config
    /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
    /Applications/Postgres.app/Contents/MacOS/bin/gdal-config
    /Applications/Postgres.app/Contents/MacOS/bin/geos-config
    /Applications/Postgres.app/Contents/MacOS/bin/uuid-config
    /Applications/Postgres.app/Contents/MacOS/bin/xml2-config

我不想从我的路径中删除postgres.app,因为这对于postgres.app配置的CLI是必要的,如下所述:http://postgresapp.com/documentation#toc_1

关于来自库的python,我尝试使用以下方法删除它们:

PATH=$(echo $PATH |sed 's/\/Library\/Frameworks\/Python.framework\/Versions\/2.7\/bin//')

按照此处的建议:https://www.linuxquestions.org/questions/linux-newbie-8/how-to-remove-directory-from-%24path-483463/。但它没有从路径中删除任何东西。

所以我在这里不安装gdal ......

1 个答案:

答案 0 :(得分:0)

我在SO上找到了一个解决方法,我找不到原始帖子,但是在这个帖子上给出了类似的信息:Installing Scipy on Mac OS X Lion 10.7.5

所以我在.bashrc中添加了以下行,然后我设法brew install gdal。

export CC=gcc
export CXX=g++

请注意,这并没有完全解决我的问题,因为我仍然遇到了geodjango的配置问题,但至少我安装了gdal。