0

I have been trying to replace everything in xcode with stuff I can get from macports. So far, I installed xcode, then macports, then used macports to install gcc, gcc_select, gmake, elf-bintools, bintools, arm-bintools (just to be sure I replaced all the bintools), and then uninstalled all of xcode. I then linked /usr/bin/make with /opt/local/bin/gmake and used gcc_select to select gcc44--the one from macports. I also exported all the bintool executable paths into the .profile path.

I was sure this would work (although I should have known better after working on it for 48 hours straight), but nothing will configure, and the log files all have the common error: :info:configure configure: error: C compiler cannot create executables

I have a feeling it has something to do with libraries, but I am really not sure.

I use a mac 10.5.8.

If this is truely 'impossible', what parts of xcode to I need for macports to work? For example, I can uninstall the xcode folder without a problem.

10
  • 4
    One question, one word: why? You know you won't be able to compile Cocoa apps and iOS apps correctly without Apple's version of GCC or LLVM, right?
    – user142019
    Jan 3, 2011 at 19:36
  • 7
    No offense, but this is a terribly stupid idea. I guarantee that the hodge podge of packages you install via Macports will never work together as well as the tuned and refined single package you get from Apple. You're just going to end up littering your machine with a whole bunch of software that mostly works, but doesn't quite work, and that's maintained by volunteers. Jan 3, 2011 at 19:41
  • Well, it started with trying to replace apple's gcc with the more updated macports gcc. Then I figured I'd go on with openmpi. Then I figured, xcode doesn't seem to be nearly as well maintained as macports, so I wonder if I can replace xcode with macports.
    – Feynman
    Jan 3, 2011 at 19:46
  • There’s a reason why MacPorts and Fink don’t mess with system components: it will break something eventually. If you want a build environment based on toolchains and utilities provided by MacPorts, see how MacPorts does itself. Also, GCC is able to find its toolchain if you’ve installed it in a custom directory.
    – user557219
    Jan 3, 2011 at 19:47
  • If gcc is able to find its toolchain, how come I can't use the "as" command until I explicitly export its parent directory in PATH?
    – Feynman
    Jan 3, 2011 at 19:54

4 Answers 4

4

If you really mean "everything in Xcode", it's not possible. However, if you're just talking about the command-line tools (which is more likely) it may be possible, but it sounds like a terrible idea. If you're not writing Mac or iOS applications, the Xcode application itself may not be of interest to you.

Clarifying what you're actually hoping to accomplish with the minimal set of tools you plan to end up with would help us provide a better answer. The fact that you mention arm-bintools leads me to guess you may be hoping to develop iOS apps — and I'll echo the warnings from the comments that you'd be asking for pain and not gaining anything appreciable. I understand wanting to reduce disk usage, but shelling out for a larger hard drive will be much less expensive than the extra time you'd spend just trying to do what Xcode does. (Not just the setup cost, but loss of productivity in daily usage.)

BTW, one reason that the gcc version in Xcode may lag behind the one in MacPorts is because Apple is extremely invested in replacing gcc with clang-llvm, which you'll find is vastly faster and under more active development.


Edit in response to OP:

Given the clarification that the intent is to only develop scientific computing code, there's another option. You still want to install Xcode to get all the command-line tools, but you may be able to get rid of Xcode and the other GUI apps you don't care to use.

When running the Xcode installer, pause on the Installation Type screen — check "UNIX Development" and uncheck everything else you can. This will install components into /System/Library and /usr. (You can see the full list of files by selecting File > Show Files within the installer and expanding the UNIX Development sub-package.) The Essentials package (which is a required install) will install into a location of your choosing (default is /Developer) which can be deleted after the install completes. The extra Mac-related stuff installed in /System/Library is small enough (an order of magnitutde smaller than the Essentials package) that I'd recommend just leaving /System alone altogether.

This should leave you with the Xcode-provided artifacts in /usr/bin, /usr/lib, /usr/include, /usr/share/man, etc. and allow you to build whatever custom tools you need. I recommend building them into /usr/local/* to keep them from conflicting with existing tools. Good luck!

6
  • I am absolutely NOT trying to set up iOS apps. I am trying to write scientific code--mainly with fortran and openmpi with a touch of perl. I strongly prefer eclipse to xcode's interface (because of remote login plugins.) I like the idea of being able to install interfaces like octave (that I use to graph my results and store temporary data.) So I figured using macport's perl, gcc, etc would be more efficient than relying on that of xcode. That was my plan anyway.
    – Feynman
    Jan 3, 2011 at 20:07
  • Not to mention the HUGE number of dependencies macports installs while I know perfectly well my mac came with most of them (i.e. perl)
    – Feynman
    Jan 3, 2011 at 20:09
  • Thanks for clarifying. I updated my answer accordingly — it should be more helpful. :-) Jan 3, 2011 at 20:26
  • Thanks a lot! I appreciate you putting up with my novice experience. This undertaking of mine has taught me a great deal about how applications are built.
    – Feynman
    Jan 3, 2011 at 20:30
  • 2
    For the record, Apple’s GCC doesn’t ship the Fortran compiler, so Feynman does need to install non-Xcode GCC. Also, because of GPLv3 issues, Apple hasn’t worked on GCC since version 4.2.1.
    – user557219
    Jan 3, 2011 at 20:31
0

You can't do this as macports needs Xcode.

There are some macports that use a macports gcc - but most use Apple tools.

1
  • Wow. That is very very disappointing. I am going to wait another 20 minutes or so to see if I get a less disappointing answer before marking this as solved.
    – Feynman
    Jan 3, 2011 at 19:48
0

One issue you may be running into is that OSX doesn't use ELF binaries, so elf-bintools is probably not helping much...

0

Another way would be to use Gentoo prefix as the port system. This tries to use only code from itself so you end up using less Apple code which seems to be what you want/

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.