Homebrew doesn't work on snow leopard - xcode

I have a fresh installation of OsX 10.6.8
Yesterday I installed XCode 3.x and then homebrew.
brew doctor << was ok
brew update << updated ok
brew install python << gave an error similar to this one:
==> ./configure --prefix=/usr/local/Cellar/readline/6.2.4 --mandir=/usr/local/Ce
checking for gcc... llvm-gcc
checking for C compiler default output file name...
configure: error: in `/private/tmp/readline-lGgV/readline-6.2':
configure: error: C compiler cannot create executables
See `config.log' for more details.
READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting
I thought was a problem due to my old XCode, so I uninstalled it and then loaded GCC-10.6.pkg but the error was the same.
I thought that also osx-gcc could be outdate so I managed to find a XCode 4.2 and I installed it, but the error doesn't change
I found out that there is no "Command Line Tools for Xcode" for osX 10.6.8 so now I'm out of options.
There is a newer version of XCode (4.3.2) that is compatible with 10.6.8 but I wasn't able to get it, and sincerely, now I don't think that that could be the problem.
So, now, I'm out of options.
I can't upgrade to Lion, because my laptop doesn't support it.
The sad thing is that yesterday I decided to format my hd and reinstall OsX just to have a new, fresh, clean installation of homebrew!!!!!
Please.....help!!!!

Related

Clang version 1.6 cannot be updated

I have a very strange issue with clang. I'm running OSX 10.10.1 and have installed XCode 6.1.1 from here. For another project, I wanted to update Ruby from 2.1.2 to 2.2.0 via rbenv install 2.2.0. The command prints the following error:
Downloading ruby-2.2.0.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/7671e394abfb5d262fbcd3b27a71bf78737c7e9347fa21c39e58b0bb9c4840fc
Installing ruby-2.2.0...
BUILD FAILED (OS X 10.10.1 using ruby-build 20141225)
Inspect or clean up the working tree at /var/folders/4z/s4lwbd314_lg3hprgp72qsqr0000gn/T/ruby-build.20150112115924.6502
Results logged to /var/folders/4z/s4lwbd314_lg3hprgp72qsqr0000gn/T/ruby-build.20150112115924.6502.log
Last 10 log lines:
Via: 1.1 2ce6276171358bf7d052aa190ed98f8d.cloudfront.net (CloudFront)
X-Amz-Cf-Id: 42q6Sa73ORpGbCgaHIpsBwTRP8ycUAhsdTolikEbyxqMrn9uePtfCA==
/var/folders/4z/s4lwbd314_lg3hprgp72qsqr0000gn/T/ruby-build.20150112115924.6502/ruby-2.2.0 /var/folders/4z/s4lwbd314_lg3hprgp72qsqr0000gn/T/ruby-build.20150112115924.6502 /usr/bin
checking build system type... x86_64-apple-darwin14.0.0
checking host system type... x86_64-apple-darwin14.0.0
checking target system type... x86_64-apple-darwin14.0.0
clang: error: invalid version number in '-mmacosx-version-min=10.10.0'
configure: error: clang version 3.0 or later is required
make: *** No targets specified and no makefile found. Stop.
Googled for invalid version number in '-mmacosx-version-min=10.10.0' but I did not find any helpful information. By running clang --version it turns out that my clang executable is version 1.6 (!):
Apple clang version 1.6 (tags/Apple/clang-70)
Target: x86_64-apple-darwin14
Thread model: posix
This seems very weird, because XCode is usually shipped with LLVM 6. I tried to (re)install the Command Line Tools (in which clang should be located), but XCode doesn't offer me the option to download/update them:
Trying to install them via xcode-select via the command line: xcode-select --install as suggested here results in showing the help message, indicating that the --install-command is unknown (xcode-select is version 895). I also tried to download and install it manually but it has absolutely no effect. The xcode-select-path is /Applications/Xcode.app/Contents/Developer but I also tried /Applications/Xcode.app.
I also tried to update clang via Homebrew:
$ brew install llvm --with-clang --with-asan
[...]
LLVM executables are installed in /usr/local/opt/llvm/bin.
Extra tools are installed in /usr/local/opt/llvm/share/llvm.
$ brew install llvm --with-clang --with-asan
Warning: llvm-3.5.0_2 already installed
but in none of the two paths is a clang executable.
So my question is: Is there a way to update clang? Or a workaround to install ruby 2.2.0 anyway? I'm stuck here for days, any help is greatly appreciated!
EDIT
I found out that newer XCode versions (I think from 5.0 upwards) come with LLVM/Clang inside the XCode.app-folder. A few months ago, I installed XCode 4.something for testing purposes - these versions overwrite system tools like clang and xcode-select. Reinstalling XCode 6 will not update them.
I fixed it by copying /usr/bin from another Mac, but there must be a way to fix it without this workaround.

Install any version of ruby with RVM on mavericks

I've just upgraded to osx mavericks, and I want to install ruby 2.0, but I'm getting configure: error: cannot run C compiled programs. errors.
I update rvm with rvm get stable and then type rvm install 2.0.0 and get an error directing me to a log file. The log file contains:
configure: WARNING: unrecognized options: --without-tcl, --without-tk
checking build system type... x86_64-apple-darwin13.0.0
checking host system type... x86_64-apple-darwin13.0.0
checking target system type... x86_64-apple-darwin13.0.0
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/Users/mattroberts/.rvm/src/ruby-2.0.0-p247':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
So, I tried listing the versions I do have. It tells me i have 1.9.3-p392 so I uninstall that one and re-install to see if that works - same error.
Do I need to re-install / update xcode, or is there another solution?
Thanks!
If you haven't upgraded Xcode after upgrading to Mavericks you should do so
After that, open a command prompt and type:
xcode-select --install
This will install xcode command tools that have been deleted by OSX update.
After that it should work okay.
The suggested solutions did not solve my issue (XCode at newest version, command line tools installed). I used rvm install ruby-1.9.3 --with-gcc=clang and that worked.
I thought rvm used to use clang for OSX by default. Not sure if I remember that wrong or something changed / this is no longer the best thing to do. Nevertheless it made the install work for me.
After Edu's comment, the github rvm issues page he referenced warns:
#marksands please be sure you know what you are duing, ruby 1.9.3
compiled with clang is not "safe", it can segfault, thread related
issues to be expected, consider reinstalling ruby --with-gcc=gcc42 or
just let rvm install gcc 4.6, only ruby 2.0.0 is fully compatible with
clang
This issue points out issue with gcc46 on Mavericks:
The gem in question uses different language - not C/C++, it uses
Objective-C - so it's not the compiler fault, you can build gcc-4.6
with support for Objective-C - it's just not done by default.
You have two options now, both start with uninstallig gcc-4.6 and
then:
• Install apple-gcc42
• Install gcc-4.6 with --enable-objc
this is supposed to be fixed, run:
rvm get head
rvm remove 1.9.3
rvm install 1.9.3
do not use extra flags
What ended up working for me was installing XCode then RUNNING Xcode then trying to reinstall.
Running
rvm_configure_env=('LDFLAGS=-L/opt/sm/pkg/active/lib' 'CFLAGS=-I/opt/sm/pkg/active/include' 'CPATH=/opt/sm/pkg/active/include')
Corrected my compiler issue in Mavericks
Solution:
unset SDKROOT
This worked for me. I hope it would for you too.
I tried to reinstall xcode along with xcode developer tools. Didn’t work. The same error.
Try to run with env -i bash —noprofile —norc to see whether your env vars are causing the issue to further investigate.
Ran into the very same issue (on 10.8.5, all up to date). Ruby 2.0.0 installed fine, but not 1.9.3. This solution worked for me.
cd into the ruby path (found in config.log), then
issue .configure (with all options, as found in config.log)
make
make install
Then:
rvm use 1.9.3 --create

Set up g++ on OS X

I just updated to OS X Mavericks and it seems it messed up my whole compiler setup. Not only do I have to reinstall a JDK in order to use a Java compiler, I get the following error when I'm trying to compile C/C++ using GCC/G++:
/usr/local/Cellar/gcc/4.7.2/gcc/lib/gcc/x86_64-apple-darwin12.2.1/4.7.2/../../../../include/c++/4.7.2/cwchar:46:19: fatal error: wchar.h: No such file or directory
Not sure what to think other than upgrading messed it up. My question is: how do I set up g++ to compile on OS X? If it's already set up, what is the problem here?
If I can provide more information, please let me know.
Note: I've installed gcc 4.7 using homebrew, but it doesn't seem to work. When I use g++-4.7 code.cpp specifically, I get the same error.
Installing the Command Line Tools (OS X Mavericks) for Xcode - Late October 2013 solved it for me. Here is the link:
OSX: Xcode Downloads
The often mentioned xcode-select --install command kept saying it cannot find the requested software.
To clarify: You need to already have gcc-4.7 installed using Homebrew. The update to the latest version of CMD Tools only fixes compatibility issues caused by upgrading from Mountain Lion to Mavericks.

Install gcc in Mountain Lion

I need GCC for some Ruby gems. And I need LLVM as well for iOS development using Xcode 4.4. I already have LLVM installed through Xcode.
How can I install GCC in Mountain Lion without affecting any of LLVM binaries?
The fact is that because you have Xcode you already have GCC installed on your system. If you're trying to run GCC from the terminal and getting "command not found" then the reason is, starting with OS X 10.8 (Mountain Lion), the GCC "command line tools" are not installed by default with Xcode. The install procedure depends on your version of OS X and Xcode:
Installing the GCC command line tools in OS X 10.8 (Xcode 4.4):
Xcode -> Preferences -> Download -> Components -> Command Line Tools -> install
Installing the GCC command line tools in OS X 10.9 (Xcode 5.02):
I have not tried these instructions myself, but I'll move them here if someone tries them and they work:
http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/
Had the same issue after upgrading to Mountain Lion.
My fix, I found make and gcc etc in /Developer/usr/bin.
setenv PATH $PATH":/Developer/usr/bin"
Puts them back in the path.
Oh yeah, I was on Xcode 3.x.
Install macports and run:
$ sudo port install gcc
from the command line. There are about 20 different versions of gcc available as Macports.
I had Homebrew. So I did this.
brew install --enable-all-languages https://raw.github.com/Homebrew/homebrew-dupes/master/gcc.rb
It worked!
The easiest way to install anything on a Mac is by using Homebrew. There is a package for this very purpose:
brew tap homebrew/dupes
brew install apple-gcc42

Can't use GCC in OS X Terminal

I have installed the developer tools. I can compile code via Xcode and according to the docs /usr/bin/gcc & /usr/bin/cc should point to /usr/bin/gcc-4.0. Neither the symlinks or gcc-4.0 exist on my system (Snow Leopard). All I wish to do is compile some C on the terminal! I'm amazed by how complicated this task is. The command GCC is unsurprisingly returning "gcc: command not found".
Can anyone shed some light on this?
No! Reinstalling is the wrong answer!
Newer versions of XCode require you to install the command-line versions of the tools separately. In XCode, go to Preferences | Downloads, check the Components tab, and install them from there:
These binaries should be there after installing xcode. Check your path settings, and if you still don't have these reinstall xcode
Command line tools are no longer included with the latest XCode (even as an add on). Now you can download them here:
https://developer.apple.com/downloads/index.action
Did you install the latest Xcode after installing Snow Leopard, or is this the version of Xcode from a previous OS installation?
On my system with a clean Snow Leopard install the default compiler (and the one symlinked from cc and gcc) is gcc-4.2
I do have gcc-4.0 too, although it's not the default.

Resources