mxcl/homebrew — Issue #8415: installing postgis on lion troubles / issue with gcc?
Author: ddell
Created: 2011-11-02 03:08:37+00:00
State: open

Am running clean install of osx lion, with newly installed app store version of Xcode, and homebrew, installed in that order. brew update also ran and everything "Already up-to-date."

After some help from a friend and some tinkering, have managed to install postgresql and gdal, but am having issues with postgis.

brew install postgresql (success)
brew install gdal (success)
brew install postgis (fail - https://gist.github.com/1332704)

Per that gist, everything seems fine until the install phase: "PostGIS was built successfully. Ready to install.", so am not certain what's going on, that leads me to here:

"make -C postgis install
/usr/local/bin/gmkdir -p '/usr/local/Cellar/postgresql/9.0.4/lib'
make[1]: /usr/local/bin/gmkdir: No such file or directory
make[1]: *** [installdirs-lib] Error 1
make: *** [postgis-install] Error 2
==> Exit Status: 2
http://github.com/mxcl/homebrew/blob/master/Library/Formula/postgis.rb#L57"

brew doctor does yield:
✈ brew doctor
/usr/bin/gcc
Your gcc 4.2.x version is older than the recommended version. It may be advisable
to upgrade to the latest release of Xcode.

Which is confusing, as am running what must be the latest version of Xcode (Version 4.2 (4D199)), and gcc-v returns:
✈ gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~1/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~1/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)

yet in brew install there is:

"Xcode: 4.2
GCC-4.0: N/A
GCC-4.2: build 401 (5664 or newer recommended)
LLVM: build 2336 "

So something seems to be misaligned, and am not certain if that is part of the postgis install issue, or is the issue itself? However, have managed to install postgresql and others, so could it just be an isolated issue with postgis?

Any assistance greatly appreciated! Thanks!

Did you brew update? (yes)
Did you brew doctor? (yes - output above)
Are you running the latest stable version of XCode? (perhaps not? - see above)
Have you installed the Java Developer Update? (I don't have a developer account to be able to? but also don't see any error codes related to this?)
Have you completely removed Macports and/or Fink? (never installed)
Do you need to sudo chown -R $USER /usr/local and sudo chown -R $USER /usr/local/.git? (just tried it anyways - nothing changed)
Did you read through the Common Issues page? (yes)