11 ms·
Xcode, GCC, and Homebrew
- nohat 15y agoI remember a terrible experience trying to get gfortran working on osx. I ended up permanently borking my glibc. If this doesn't use the real gcc I imagine similar experiences may await. Nonetheless that is much better than downloading xcode just for GCC.
- ruediger 15y agoApple doesn't use glibc.
- nohat 15y agoI needed it for my gcc and gfortran install. I am not sure whether osx uses glibc for xcode. Somehow despite removing and replacing everything related to glibc, it was still broken. Never did figure it out.
- calloc 15y agoglibc is not used by the base system. So if you installed glibc yourself then the problem is not Apple's.
- nohat 15y agoSure, the problem was installing gfortran, which (as I recall) requires the real gcc. I suspect (though I never did figure out what exactly was wrong) that some sort of a library conflict with xcode's gcc was responsible. As this package is still not the real gcc (they don't want gpl v3 I believe) anyone who wants eg. gfortran will still need a separate installation.
- nknight 15y agogcc and glibc are different things, and gcc does not require glibc. I don't know that glibc even runs on OS X/Darwin, it would seem strange for any time to be invested in such an endeavour.
- nohat 15y agogfortran requires glibc.
- nknight 15y agoI can't find any evidence of that. The gfortran 4.3 release notes strongly imply it doesn't: "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.
- nohat 15y agohttp://old.nabble.com/GLIBC-and-executable-builds-on-Gfortran-Wiki-td27320153.html http://old.nabble.com/GLIBC-and-executable-builds-on-Gfortra... '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_2005.html 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...'
- nknight 15y agoYour first link is about gfortran executables for Linux (specifically a specific snapshot build, not the source code itself), not OS X. Your second one is about glibc systems, not OS X, is over six years old, and complains simply about buggy functions in glibc -- what is it that makes you think using glibc would solve a glibc problem? 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.
- singingwolfboy 15y agoWhen people listen to each other, wonderful things happen. Thank you for listening, Apple.
- BonsaiDen 15y agoIndeed, this also gives me some confidence that there are still a few people around at Apple who don't like walls around their gardens :)
- guns 15y agoDefinitely. For instance, X is still supported on OS X after all these years, in large part due to Jeremy Huddleston: http://lists.apple.com/archives/x11-users/2011/Nov/msg00058.html 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.
- frankPants 15y agoThis is indeed great news. Thanks to everyone who was involved in making this happen, it's fantastic news.
- pavlov 15y agoUnfortunately Apple's new Command Line Tools for Xcode doesn't include regular gcc, but Apple's gcc-compatible wrapper around LLVM (i.e. /usr/bin/gcc is a symlink that points to llvm-gcc). 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.
- nknight 15y agoYou really shouldn't be using terms like "regular gcc" or "real gcc", they don't mean what you seem to think they do. GCC is a modular system specifically to provide for things like LLVM-GCC. LLVM-GCC takes the same form as other GCC back-ends for other platforms. i386 has a GCC backend, ARM has a GCC backend, IA64, MIPS, SPARC... Which of these do you nominate to be "real gcc"? The only measure by which llvm-gcc is not "real" is that it's not included in the core gcc distribution.
- pavlov 15y agoPoint taken. But when llvm-gcc doesn't compile the code that every other instance of gcc found on modern platforms does, it's hard to argue that it's the same thing. 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." http://llvm.org/cmds/llvmgcc.html http://llvm.org/cmds/llvmgcc.html
- mhurron 15y ago"We will recommend you don't use Xcode from the App Store but instead the command-line-tools package" Ok why? If you install all of Xcode, you're going to have everything included in this tools package as well, aren't you?
- doe88 15y agoNo it doesn't. Xcode 4.3 is now a standalone .app package including only what is relevant to Xcode. These command line tools are a separate install even if you installed Xcode.
- calloc 15y agoActually it does. The binaries are all included in the .app, the secondary installer just places binaries in the various locations around the HD. 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.
- msbarnett 15y ago> 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.
- kzrdude 15y agoThat huge multi-gig download and install of Xcode is one reason I had for leaving OS X for linux. The hurdle for getting FOSS software was too big.
- pavel_lishin 15y agoHow big was your distro's installer download?
- ruediger 15y agoI'd guess something between 150 MiB and 4 GiB.
- amosrobinson 15y agoMine was 663mb... But I also changed back to Linux from OSX because the window manager sucked, and there was only poor package management then.
- jrockway 15y ago40MB.
- batista 15y agoYes, and then the installer downloads another 1-4 GB.
- catch23 15y agoto be fair, a basic headless environment (aka server install) is still fairly small (~300mb) even when it includes all the standard libraries, headers, and compilers. however, I doubt people would balk at 5gb on a laptop install as most people don't really have space limitations there.
- kzrdude 15y agoIf a linux install is 5GB, then you're choosing yourself which packages to install. Not so in this case. 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).
- soc88 15y ago> You can now setup a complete OS X develop environment with a single 171.7 MB package download. And then, I LOLed.
- kenneth_reitz 15y agoIt was 4GB.
- mapgrep 15y agoWhile this is a nice convenience for registered Apple developers, I noticed that this download requires me to sign a confidentiality agreement and an NDA as part of the registration process (since I am NOT a registered Apple developer). 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).
- kenneth_reitz 15y agoIt's a preview. The final version won't.
- cube13 15y agoThe NDA covers prerelease software, which this is not.
- mapgrep 15y agoNot true. In addition to keeping pre-release software confidential, you are obligated "not to disclose, publish, or disseminate any Apple Confidential Information" and "not to use Apple Confidential Information in any way." 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_developer_20100301.pdf 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.
- andrewstewart 15y agoOne problem I'm finding is that Ruby refuses to compile on this setup, giving the following prompt instead: http://cl.ly/EIbT http://cl.ly/EIbT I'm assuming this is because of Apple's GCC build just being wrappers around LLVM.
- calloc 15y agoTell ruby to fix their shit and use clang instead.
- reaganing 15y agoHaving the same issue here. And I'm guessing, from the submitted article, re-installing 'osx-gcc-installer' wouldn't work. Hopefully, Ruby will work with newer tools soon.
- jfirebaugh 15y agoAs of 1.9.3-p125, clang is officially supported by MRI. 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 https://github.com/wayneeseguin/rvm/issues/763
- deleted 15y ago[deleted]
- jkbr 15y ago> Before installing, note that from within Terminal you can use the XCRUN tool to launch compilers and other tools embedded within the Xcode application. Use the XCODE-SELECT tool to define which version of Xcode is active. Type "man xcrun" from within Terminal to find out more. > 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.
- weavejester 15y agoDoes anyone happen to know if this covers OSX developer header files like Appkit/Appkit.h? Emacs via Homebrew requires them to build, and they weren't included in the GCC for OSX package.
- jcurbo 15y agoIt's in the article. He says it includes OS X header files that he couldn't include in the other package.
- weavejester 15y agoOh, I managed to miss that part. Thanks for pointing that bit out!
- miles_matthias 15y ago"Open source is incredible." 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!
- derrida 15y ago"All you need is a free Apple ID" - seriously Apple, what is with tracking me every time I try to use my computer for something non-trivial?
- ballard 15y agoI needed a non-clang compiler to compile erlang and clang to translate PyPy. However, compiling gcc from Apple's open source did not seem particularly more trustworthy than "it works for me" refrain from a few developers. I came across the following method that works on both Snow Leopard and Lion: 1) Uninstall all versions of Xcode. 2) Install Xcode 4.1. 3) Upgrade to Xcode 4.2.1.
- losethos 15y agoI made my own compiler. God says... C:\LoseThos\www.losethos.com\text\YANKEE.TXT devil, to the ever courteous and thought- ful Lord High Stew d of the Palace's Third Assistant V t for several sau- ceTs of ice crEam a quality calculated to make the ey of the recipients hu- mid with grt ude; and it done it. When this administration wants to chalk up a desirable name for early promotion, the Hosannah would like a chance to sudgest. The Demoiselle Irene Dewlap, of South Astolat, is visiting her uncle, the popular host of the Cattlemen
- malkia 15y agoI've found a problem with CMAKE and gcc from the latest Xcode command-line tools. CMAKE simply can't discover the ABI. I've tried gcc, gcc-apple-4.2, llvm-gcc, but finally it was "clang" that worked. 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++
- boulderdash 15y agocan this live side by side the existing xcode system?