Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

This formula cannot be built with any available compilers #23580

Closed
lifepillar opened this issue Oct 25, 2013 · 13 comments
Closed

This formula cannot be built with any available compilers #23580

lifepillar opened this issue Oct 25, 2013 · 13 comments

Comments

@lifepillar
Copy link
Contributor

I've got the error “This formula cannot be built with any available compilers” for a couple of formulas since I have upgraded to OS X Mavericks. So, I have decided to re-install Homebrew from scratch. Now, I'm getting that error when trying to install mariadb:

brew  install -vD mariadb
Error: This formula cannot be built with any available compilers.
To install this formula, you may need to:
  brew install apple-gcc42

Installing apple-gcc42 does not fix it (I think the error message is misleading).

My brew --config:

HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/mxcl/homebrew
HEAD: dde0fbd8349594b036666eea02a075b6668003dc
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.9-x86_64
Xcode: 5.0.1
CLT: 5.0.1.0.1.1382131676
Clang: 5.0 build 500
X11: 2.7.4 => /opt/X11
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby

I have installed the Xcode command-line tools, too. Am I missing some other step?

@MikeMcQuaid
Copy link
Member

The error message is correct. This will be another issue. However, as you've posted no debugging information we're unable to help further. Please read this: https://github.com/mxcl/homebrew/wiki/Troubleshooting

@lifepillar
Copy link
Contributor Author

I've posted all the debugging information I get from brew install -v mariadb 2>&1 (before and after installing apple-gcc42 there's no difference). No log file is written, either.

One thing I've noticed, there's no LLVM-GCC line in the output of brew --config. Is that expected on Mavericks? I have llvm-gcc in /usr/bin. Apparently, MariaDB does not build with Clang, so that may be the reason.

Other formulas (for example, postgresql) build fine, and my system is raring to brew.

@MikeMcQuaid
Copy link
Member

Can you paste the output of brew uninstall apple-gcc42; brew install -v apple-gcc42 mariadb, please.

@lifepillar
Copy link
Contributor Author

Here it is: http://gist.github.com/lifepillar/7153442. Anyway, I've got MariaDB to build with --use-llvm.

I remember that, in these cases, Homebrew used to spit a warning along the lines: “this formula is reported not to build with clang; please, try --use-llvm or --use-gcc”. This is what I expected to see in this case, too.

@MikeMcQuaid
Copy link
Member

Very strange. @mistydemeo This seems like it may be an edge case?

@lifepillar
Copy link
Contributor Author

I've just learned that Apple has dropped LLVM-GCC from Xcode 5 (https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/xcode_5_0.html).

I was able to build MariaDB “by chance”, because in the past I had manually installed llvm-gcc-4.2 in /usr and had created the following symlinks in /usr/bin:

/usr/bin/llvm-cpp-4.2 -> ../llvm-gcc-4.2/bin/llvm-cpp-4.2
/usr/bin/llvm-g++-4.2 -> ../llvm-gcc-4.2/bin/llvm-g++-4.2
/usr/bin/llvm-gcc-4.2 -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2

(Interestingly enough, upgrading from 10.8 to 10.9 did not remove those symlinks and the llvm-gcc-4.2 directory.)

I have now deleted those symlinks and tried to build MariaDB again with --use-llvm, and, as expected, it fails.

Maybe, llvm-gcc could be added to Homebrew to let all formulas that don't build on Clang to continue to work? Would that be possible without creating a mess? Think about formulas B and C, both depending on formula A; formula B builds with Clang, but formula C requires --use-llvm. Now, assume that you brew B first, compiling B and A with Clang and libc++; then, formula C won't build with or without --use-llvm; in the former case, because Homebrew would complain about A being built with libc++ (Clang) instead of libstdc++ (llvm). I have already stumbled upon this situation and I don't know what to do.

@mistydemeo
Copy link
Member

Interesting that Homebrew didn't pick up on those links for fails_with fallbacks, but allows it for --use-llvm.

Maybe, llvm-gcc could be added to Homebrew to let all formulas that don't build on Clang to continue to work?

We already include an apple-gcc42 formula for the same use case! llvm-gcc is a modified version of gcc-4.2, so from your perspective there's not really a reason to prefer llvm-gcc.

I have already stumbled upon this situation and I don't know what to do.

This is definitely a mess, but unfortunately there's not much we can do about it until authors fix their software with clang. :/ Since Apple only ships clang now, it's the compiler we'll be preferring going forward.

@lifepillar
Copy link
Contributor Author

We already include an apple-gcc42 formula for the same use case! llvm-gcc is a modified version of gcc-4.2, so from your perspective there's not really a reason to prefer llvm-gcc.

That's fine. Shouldn't be better to drop, or at least deprecate, --use-llvm then?

Unfortunately there's not much we can do about it until authors fix their software with clang.

I'm pretty sure that in the past I had built a few formulas with gcc, but I've never had those conflicts between libc++ and libstdc++ that I'm seeing now that I'm re-installing on 10.9. Have I been just lucky or something has changed in 10.9 that causes those errors?

@mistydemeo
Copy link
Member

That's fine. Shouldn't be better to drop, or at least deprecate, --use-llvm then?

We've kept it around for the sake of users on older OS X versions whose Xcodes don't include gcc-4.2, but do include llvm-gcc.

Have I been just lucky or something has changed in 10.9 that causes those errors?

10.9 changed the default C++ standard library. On 10.8 and below, clang's default was libstdc++, so it was compatible with Apple-provided GCCs. On 10.9 it's now libc++.

@gregbair
Copy link

I also just ran into this. After installing apple-gcc42, I was able to successfully install mariadb -

==> Summary
🍺 /usr/local/Cellar/mariadb/5.5.32: 481 files, 114M, built in 6.8 minutes

@lifepillar
Copy link
Contributor Author

Ok, so brew install apple-gcc42; brew install mariadb --use-gcc solves this issue.

@gregbair
Copy link

Actually, it's just brew install apple-gcc42; brew install mariadb. Didn't have to use --use-gcc.

@lifepillar
Copy link
Contributor Author

Correct. It was failing for me earlier because I had messed up with my system.

@Homebrew Homebrew locked and limited conversation to collaborators Feb 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants