tags:

views:

167

answers:

3

I just got Macports installed on my mac, of which os version is Snow Leopard (10.6). I used Macports to install several packages through 'sudo port install' command, and all these packages are reported active after the installation. I just wonder that whether these packages are really working? For example, macports tells me that 'gcc44 @4.4.2_0 (active)', however in python it says '[GCC 4.0.1 (Apple Inc. build 5493)] on darwin'.

So I just want to know that if there is some problem with my method of installing or my macports needs some configuration after installation?

Any help is appreciated! I am really new in Mac OS.

+1  A: 

I believe Python is declaring the version of gcc used to build it which should be the gcc installed on your Mac i.e. the version that came with the Mac OS Development tools. This should be located in /usr/bin/gcc.

You should find the gcc version matches when you execute

/usr/bin/gcc -v

I do not think anything is wrong with your setup or configuration. It just shows Python was compiled using the gcc provided by Apple

houmam
Thanks for your answer. Now I know Macports is working correctly. BTW can you please tell me how can I change the environment path so that the '$python' command directs to the python I installed by macports?(i.e. change to /opt/local/bin/python2.4)
Jim
Unfortunately I do not do this I prefer to know which version of python I am using by what I am referring to so if I use python2.4 I know I am using 2.4 from macports and if I use python2.5 I know am using macports python 2.5 and just plain python is python provided by apple. Might be worth asking in another question on stackoverflow if you NEED that functionality
houmam
I'll take that advice, thank you.
Jim
A: 

It probably is just that compiler that was picked by the build was that installed by XCode. You can try typing which gcc to see which one is in your path. The macports one would by default be in /opt/local somewhere.

HawaiianSpork
Thanks for the answer. Can you tell me how to change the environment path so that '$python' refers to the python installed by macports?(as I described in the comment below)
Jim
+1  A: 

Macports installs software not to conflict with the versions provided by Apple. If they replaced the C compiler and libraries, really bad things might happen when Apple provided operating system updates.

gcc is the command for Apple's version of gcc, at /usr/bin and version 4.0.1 for Leopard.

gcc-mp-4.4 is the command for gcc version 4.4 as provided by MacPorts, located at /opt/local/bin.

Similarly there will be versions of python in /opt/local/bin.

Like houmam, I prefer to explicitly invoke versions by name. If you want to connect particular versions to python, I think that the MacPorts package *python_select* implements this by using symbolic links. I've never used it.

M. S. B.