Xcode, GCC, and Homebrew
kennethreitz.com
kennethreitz.com
llvm-gcc doesn't compile many projects correctly, including gcc itself (as of Xcode 4.2 there were reports that it's not possible to compile a gcc cross-compiler using llvm-gcc). Hopefully there have been improvements in this regard.
Still, anyone who needs the real gcc will have to install it through some other means.
(And llvm-gcc is based on that version, which is 4.2.1 or something, about 5 years old)
This is problematic for the Cocotron project [1], which is an Xcode-compatible cross-compiler environment for creating Windows/Linux ports of Cocoa apps. Currently one has to revert to Xcode 4.0.2 to build Cocotron's cross-compiler, then upgrade back to 4.2... This is not terribly convenient. (I guess the long-term solution is that Cocotron either has to add a dependency on a non-Apple gcc, or needs to switch to clang for its cross-compiler.)
The only measure by which llvm-gcc is not "real" is that it's not included in the core gcc distribution.
Edit -- the llvm-gcc project doesn't seem to share your opinion of the project as being "just another back-end". They certainly don't claim that it's fully compatible, only that it supports "many" features, "most" options, "a number of" extensions:
"Being derived from the GNU Compiler Collection, llvm-gcc has many of gcc's features and accepts most of gcc's options. It handles a number of gcc's extensions to the C programming language."
You don't even have to go as far as kernel developers. From a 'write once, compile everywhere' perspective, GCC is actually pretty bad. I used to work at a company that built and deployed to somewhere in the neighborhood of 20 different *nix platforms, over 6 different hardware architectures, running various GCC versions. Working around version- or backend-specific GCC issues was almost a daily task, and it wasn't getting any better with later versions.
It's not that GCC is 'bad', but it's not holy either, not by any stretch of imagination. There's a reason Apple decided to push clang as an alternative. I believe clang+LLVM will some day replace GCC on Linux and other platforms that use GCC as well.
All the backends which gcc publish share huge amounts of code, in particular all the optimizations framework in the shape of the SSA representation and GIMPLE, support for generating debugging information via DRAWF.
LLVM-GCC just takes the minimum amount of GCC and replaces the entire back-end.
Do you mean something more specific?
http://stackoverflow.com/questions/7137480/how-do-i-add-ppc-...
http://www.cocoabuilder.com/archive/xcode/299924-no-ppc-from...
It's been 6 years. The world has moved on, and Apple no longer has any commercial interest in PowerPC. You really expect them to keep bothering with it?
Lion is the _second_ version of OS X not to even run on PPC. Why should the developer tools they distribute for Lion support it at all?
Apple isn't actually stopping you from compiling for PPC. They just aren't shipping the compiler themselves. AFAIK, they don't ship any compilers for hardware they don't support — no VAX, no MIPS, no M68k — PPC is not special in that respect. I don't see what's so terrible about that.
Also available are 1.5, 2.3, 2.4, 2.4.1, 3.0, 3.1, 3.1.1, on through to the latest 4.x versions, free for the taking. All versions prior to 4 will happily build code for PowerPC.
What is it you think they're preventing anyone from doing again?
I wonder if there's a compelling reason for these add-on distros (Fink, Homebrew, Macports) to be strictly "build from source" with no option for binary package downloads. For me, it just seems to add long delays in getting a tool installed, and adds frustrating dependencies on my Xcode version.
For that to happen, someone has to take responsibility for creating, managing, and distributing those binary packages. That's much easier said than done.
So, the simple answer is that no one has, as of yet, volunteered to do the work.
Fink ships apt-get which is still perfectly capable of using them.
For example Qt has a bottle: https://github.com/mxcl/homebrew/blob/master/Library/Formula...
The reason we aren't doing this for more packages is basically people power and hosting (as I'm not sure Sourceforge would be happy we hosting the number of binaries we'd want to have).
Hope that explains a bit. Feel free to comment if you think we're taking a good/bad approach here.
http://lists.macosforge.org/pipermail/macports-users/2011-Ju...
In my experience, those are quite common now - most of the packages I install are delivered as binaries.
[1] https://github.com/mxcl/homebrew/wiki/Acceptable-Formula
While strictly true, it's kind of irrelevant. The official stance is that GCC is the only compiler that is supported to build recent versions of GCC. This has been true since some point around GCC 4.0.
Clang is a faster and BSD-licensed compiler that Apple is putting all its weight behind now. LLVM-GCC has also been deprecated as it was removed as-of LLVM 3.0.
Clang is the future and it's the default compiler with the Command Line Tools. We just need to wait for upstreams to fix the various issues.
It's worth noting that this is why monocultures are bad. For all the love of GCC (and it is great) we now have a huge quantity of open-source software that only compiles with one compiler. This is a shame and hopefully Clang will help rectify that.
http://lists.apple.com/archives/x11-users/2011/Nov/msg00058....
It's reassuring that I will be able to continue to use my Mac and rxvt-unicode into the forseeable future.
The nice thing about just installing the OS X developer tools off the OS X DVD is that you do not need to enter into these sorts of legal agreements with Apple (beyond a standard software EULA).
Apple Confidential Information is defined to include, in addition to pre-release software, "pre-release hardware," "[pre-release] related documentation and materials," and "any information disclosed by Apple to you in connection with Apple Events or Paid Content (defined below)." Paid Content is "certain proprietary content (including, without limitation, video presentations and audio recordings) that Apple may make available to you from time to time for a separate fee." Apple Events are defined to include "certain Apple developer conferences, technical talks, and other events (including online or electronic broadcasts of such events)."
Also, Apple may "modify this Agreement, including any rules and policies at any time. You will be responsible for reviewing and becoming familiar with any such modification."
Relevant clauses below. I've highlighted the above quoted bit in context. Full PDF at https://developer.apple.com/programs/terms/registered_apple_...
If you're fine abiding these terms, by all means use this installer. I'm not saying this is evil or even neccesarily onerous. I Am Not A Lawyer. What I am saying is that this is a new layer of legal agreements which can be bypassed via the DVD install. So there is some degree of tradeoff.
(Update: Added modification clause quote, URL to full agreement.)
---
4. Confidentiality. You agree that any Apple pre-release software and/or hardware (including related documentation and materials) provided to you as a Registered Apple Developer ("Pre-Release Materials") and any information disclosed by Apple to you in connection with Apple Events or Paid Content (defined below) will be considered and referred to as "Apple Confidential Information". Notwithstanding the foregoing, Apple Confidential Information will not include: (i) information that is generally and legitimately available to the public through no fault or breach of yours, (ii) information that is generally made available to the public by Apple, (iii) information that is independently developed by you without the use of any Apple Confidential Information, (iv) information that was rightfully obtained from a third party who had the right to transfer or disclose it to you without limitation, or (v) any third party software and/or documentation provided to you by Apple and accompanied by licensing terms that do not impose confidentiality obligations on the use or disclosure of such software and/or documentation.
5. Nondisclosure and Nonuse of Apple Confidential Information.
[PREVIOUSLY QUOTED BIT]
--------->Unless otherwise expressly agreed or permitted in writing by Apple, you agree not to disclose, publish, or disseminate any Apple Confidential Information to anyone other than to other Registered Apple Developers who are employees and contractors working for the same entity as you and then only to the extent that Apple does not otherwise prohibit such disclosure. Except for your authorized purposes as a Registered Apple Developer or as otherwise expressly agreed or permitted by Apple in writing, you agree not to use Apple Confidential Information in any way, including, without limitation, for your own or any third party's benefit without the prior written approval of an authorized representative of Apple in each instance. You further agree to take reasonable precautions to prevent any unauthorized use, disclosure, publication, or dissemination of Apple Confidential Information. You acknowledge that unauthorized disclosure or use of Apple Confidential Information could cause irreparable harm and significant injury to Apple that may be difficult to ascertain. Accordingly, you agree that Apple will have the right to seek immediate injunctive relief to enforce your obligations under this Agreement in addition to any other rights and remedies it may have. If you are required by law, regulation or pursuant to the valid binding order of a court of competent jurisdiction to disclose Apple Confidential Information, you may make such disclosure, but only if you have notified Apple before making such disclosure and have used commercially reasonable efforts to limit the disclosure and to seek confidential, protective treatment of such information. A disclosure pursuant to the previous sentence will not relieve you of your obligations to hold such information as Apple Confidential Information.
6. Confidential Pre-Release Materials License and Restrictions. If Apple provides you with Pre-Release Materials, then subject to your compliance with the terms and conditions of this Agreement, Apple hereby grants you a nonexclusive, nontransferable, right and license to use the Pre-Release Materials only for the limited purposes set forth in this Section 6; provided however that if such Pre-Release Materials are accompanied by a separate license agreement, you agree that the license agreement accompanying such materials in addition to Sections 4 and 5 of this Agreement shall govern your use of the Pre-Release Materials. You further agree that in the event of any inconsistency between Section 4 and 5 of this Agreement and the confidentiality restrictions in the license agreement, the license agreement shall govern. You agree not to use the Pre-Release Materials for any purpose other than testing and/or development by you of a product designed to operate in combination with the same operating system for which the Pre-Release Materials are designed. This Agreement does not grant you any right or license to incorporate or make use of any Apple intellectual property (including for example and without limitation, trade secrets, patents, copyrights, trademarks and industrial designs) in any product. Except as expressly set forth herein, no other rights or licenses are granted or to be implied under any Apple intellectual property. You agree not to decompile, reverse engineer, disassemble, or otherwise reduce the Pre-Release Materials to a human-perceivable form, and you will not modify, network, rent, lease, transmit, sell, or loan the Pre-Release Materials in whole or in part.
It does not cover xcode, no matter what where the installation comes from or the GCC bundle. That is release software, and is not defined in the context of the confidential information.
There is no reference anywhere to being restricted to iOS or iPhone/iPad, including in the paid content section.
But if you're a lawyer (?) and certain of this point, I'd be relieved to take your advice, as I've purposely avoided registering as an Apple dev :)
Here is the agreement (PDF) https://developer.apple.com/programs/terms/registered_apple_...
(Updates: Link to agreement, quote from agreement.)
It seems not a week goes by without another reason to be glad I never touch that platform.
Fellow software developers, show some self respect. Quit enabling this abuse.
Ok why? If you install all of Xcode, you're going to have everything included in this tools package as well, aren't you?
Look at man xcrun and man xcode-select. Both of which can be used to switch to different Xcode versions easily. In the future it looks like they are planning on making it easier to switch between different versions of Xcode.
And using xcrun one could set up a build environment for make/config with CXX/CC/and all other environment variables pointing to the right location in your /Applications/Xcode.app/ folder.
One thing I don't understand is why Apple didn't just symlink the various binaries into the Xcode app if the Xcode app is installed, instead of having to download another 170MB file.
Probably consistency. If Xcode symlinked its binaries, then either the CLI Tools team and the Xcode team have to sync all of their releases up, or what version of the tools you have will depend on whether you installed Xcode or the CLI Tools (or, if you installed both, the order in which you installed them), and projects like Homebrew would have to account for both scenarios.
Far easier to have everyone using the CLI tools using the version the CLI team is putting out, and letting the Xcode team just worry about shipping the versions they need for Xcode, and not supporting other usage scenarios.
edit: even if the CLI Tools never ship a release except at the same time as an Xcode release, it's still one fewer scenario to QA.
> Downloading this package will install copies of the core command line tools and system headers into system folders, including the LLVM compiler, linker, and build tools.
Yup, I agree. Also, with the news of Mountain Lion today, I've been worried about how much Apple will continue making OS X a platform that any developer can innovate on. This story has re-affirmed that further for me. Awesome!
So for anyone using CMAKE, and having problems, this might save you (I was able to recompile GLFW and CEGUI this way):
CMAKE_C_COMPILER=clang
CMAKE_CXX_COMPILER=clang++
I'm assuming this is because of Apple's GCC build just being wrappers around LLVM.
And I'm guessing, from the submitted article, re-installing 'osx-gcc-installer' wouldn't work.
Hopefully, Ruby will work with newer tools soon.
If ruby-build refuses to compile with clang, you should open an issue. I've done so for rvm: https://github.com/wayneeseguin/rvm/issues/763
however, I doubt people would balk at 5gb on a laptop install as most people don't really have space limitations there.
I decided this in 2005, when a multi-GB download and 4GB install was relatively larger. And no it's not just a one-time thing, I had multiple laptops and I did reinstall them (adding linux to try out etc).
Almost all of the tools I need I can install in minutes in Debian with apt-get. It's reliable, easy and gets me doing work instead of crying while I open 20 tabs trying to find solutions to obscure bugs on Google.
Although, the en vogue thing to do is to use a Linux in a VM. You get to keep OS X and all it's friendliness and indispensable proprietary programs, and you get to have a full Linux dev environment that's also easy to backup and "snapshot".
(Now, if the commercial software for OS X, from iWork to Photoshop, and from XCode to pro audio/video drivers, is not "indispensable" to you, by all means, use Linux).
Not necessarily just one though, they could be 2-3 proprietary options that have absolutely nothing competitive in OSS land.
(If people use Wine for some of them, its beside the point: that only re-inforces they do find them indispensable. Not to mention that very few pros use Wine for their work, and that Wine doesn't work 100% glitch free).
As for what programs I think. Well,
• Photoshop is one of them, sure. GIMP misses a lot still that professional graphic designers need and use everyday, especially in it's CMYK workflow. Same for Illustrator.
• InDesign (or Quark for some) is also indispensable. The only OSS competitor, Scribus, is not even close.
• Programs to design and edit fonts. Nothing with the breadth/ease of the few commercial options.
• Logic/Cubase/Sonar/Live/Pro Tools are also indispensable. Nothing comparable to OSS. Same for the multitude of pro quality plugins, from Waves to UAD.
• Premiere/Avid/FCP(X) etc. Video in OSS land is a royal pain, and nothing of the short and extend of those programs exist.
So, graphic design/dtp/video/music/sound (anything media/multimedia in short) is a no go. And I think not only in the high end, but also in the everyday consumer space. GIMP does't have the ease of use of Photoshop Elements. Nor is there something as powerful but simple as Premiere Elements or iMovie. Something as simple as editing your daughter's birthday video and adding one two effects and titles can be a world of pain. Tons of other things, from big to small, like CD labeling or card-making software with hundreds of templates to pick.
Lots of other things I guess, but as they are not exactly in my workflow, I don't know about them. Is there Mathematica/Matlab for example? or Autocad? What's the state of 3D modelers? etc.
"Support for backtraces on glibc-based systems via the -fbacktrace option is now implemented. On all systems, a coredump can be generated for errors in the run-time library using `-fdump-core`."
The GCC suite has a pretty clear history of not being dependent on glibc, and some searching brings up no mention of it requiring glibc, and a few mentions of people clearly building it without glibc.
'I have been attempting unsuccessfully to try the latest gfortran snapshot executables...The reason for the problem is that they require the bleeding-edge version of GLIBC to run:'
http://www-zeuthen.desy.de/linear_collider/cernlib/cernlib_2...
key excerpt being: 'One problem is that the functions csqrt, csqrtf, csqrtl of libm (glibc) which are used by gcc4 are still buggy for x86_64 architectures...'
Neither of these in any way imply a general dependency on glibc. On the contrary, the second one implies you'd have more luck without it, if the issue were still extant -- which it's not, the bugs were closed out six years ago.
Second: just another example (by descending order of googleableness) of the main gcc requiring glibc.
Quite possibly there is an osx (or other bsd) specific c library that can substitute for glibc, but I did not find it, and gfortran will complain without it.
'what is it that makes you think using glibc would solve a glibc problem?' Eh? I used glibc to solve a 'missing glibc' problem. I then had other problems with glibc which I attempted to solve.
The second example is, again, an issue of gcc being built against glibc. You can build it against any libc you want, but when built against glibc, the resulting binaries are obviously going to use glibc.
You appear to have a fundamental misunderstanding of the difference between the requirements of source code, and the requirements of the binaries built from them. The latter are not the same as the former, and will vary depending on how you built the source code.
And when I just built gfortran, it didn't complain about the lack of glibc at all. If yours was complaining, I think you must have configured something incorrectly, though it escapes me what that could be.
And then, I LOLed.