Showing posts with label MacPorts. Show all posts
Showing posts with label MacPorts. Show all posts

Monday, November 09, 2009

MacPorts for Weather and Science

Not much of an actual blog post as much as a reminder list for myself when it comes to setting up a new mac for developing code for science. A while back I posted an entry about selecting between MacPorts and Fink (link) so I won't discuss that here... bottom line is that they are both great and both work, it mostly depends on which you are more comfortable with and secondly specific individual ports that are not in both, but the number is few.

Anyways so here is my list that I install (and in order of how I installed them the last time):
  1. gcc (latest version available unless otherwise needed, at the time of writing this, gcc45 is the latest and includes gfortran)
  2. gcc_select (with mac ports, I don't think it is available on fink, but there is probably a similar package)
  3. gnuplot
  4. python (latest 2.x and 3.x versions)
  5. python_select
  6. netcdf, netcdf-bin
  7. hdf5
  8. grads
  9. vis5d
  10. gdal
  11. grass
  12. gmt
  13. gnupg
  14. wget
  15. py26-setuptools (or latest/equivalent to the version of python installed)
  16. py26-numpy
  17. py26-scipy
  18. py26-matplotlib
Now this is the list I've installed specifically, I won't even begin to list the number of packages that are prerequisites for packages that are installed as well.

Friday, May 09, 2008

Fink vs MacPorts

Well a few weeks ago I decided that my Fink installation had gotten crazy. There were tones of apps and libraries installed that I needed at one time but no more. I decided it was time to start fresh. Basically I've been using Fink since the Mac OSX 10.0 days. For the most part I've just simply upgraded over the older versions and continued right along. With Apple's ability to migrate between machines, I've even migrated my Fink installation a few times. This all said, it was pretty nasty, so I decided it was time to clean house, also I've been programming in Python lately and realized that I had ended up with multiple versions of Python and add-on modules. So again another reason to flush and start clean.

So first step: 'sudo rm -rf /sw', wises first step, maybe not, but in reality I didn't care. Second step install Fink again... well I didn't do that. A few years ago I gave DarwinPorts a try, liked it but many of the needed libraries and such just weren't available and the few that weren't in Fink but in Ports, I was willing to manually install. But sometime last year (maybe the year before) DarwinPorts became MacPorts and was moved to a host sponsored by Apple. Whether or not this means that Apple endorses or supports MacPorts over Fink is not mentioned anywhere [side note: the name Fink is German for Finch].

Anyways... I decided to give the latest MacPorts a try. Initially (and still am) I was impressed by the available list of ports and its simplicity of use. Fink is based on the Debian package system, while MacPorts is based on the BSD Ports system. I personally am a Debian fan and a Ubuntu desktop user, but Mac OSX is and since the NeXTStep days been based on BSD, so presuminingly, the BSD model should be a better match. Overall both Fink and MacPorts provide mirror functionality, so it should make no difference which route you choose.

So again back to my discussion.....

Well I chose MacPorts this time. Installation - no problem, usage - no problem (besides naming/systax the only main difference is that for MacPorts you need to implicitly call 'sudo', with Fink, it is integrated), package availability - no problem. So where do the problems begin... well they don't... well sort of... well they have nothing to do with MacPorts vs Fink... they have to do with the fact that it is nearly impossible to remember every package you need, want or use. Now I'm remembering why atleast since 10.2 I've always simply upgraded my Fink and not done a full re-install.

Now some packages are easy to remember, like the latest GCC (4.4 with gfortran), and Latex (or Tetex). And since I'm working in the meteorological/science community, NetCDF, HDF5, GDAL, GRADS, qGis, GnuPlot and so forth. But then I added Python to my portfolio, I needed to make sure that I had the right libraries there too. ... This is where I think I went wrong....

When I first started learing Python, I simply found online the packages I needed/wanted, then checked Fink and installed them. Since then (and since I've been using Trac on a project management site for work) I've learned about 'easy_install' for Python. So this time I decided to install most of my Python modules/packages the Python way with easy_install. Well maybe I did something wrong or what not, but I don't think I did something right... so who know... but when I tried to run some of my Python code, it didn't work. So well then I tried the MacPort equivalent to the Fink route, and yes I found that they too had many of the packages available I was looking for, so maybe the easy_install way doesn't work for a Mac, don't know haven't checked... but the bottom line is that in the process of trying to clean things out... I've made things worse so today... I've remove all the MacPorts stuff (sudo rm -rf /opt).

And now.... lets try this again........

Oh yeah... if you didn't guess about the results of MacPorts vs Fink... I personally still think that it doesn't matter.... so you choose.