Installing Scientific Packages on Mac OS X

If you decided to buy a Macbook, the first thing you need to know may be that “It’s not a Big Mac at all but rather it’s a Mac”. Don’t even think you can eat all the Mac Universe that goes around and is almost parallel to our universe. It even may take quite a lot of time to figure out what kind of a trouble you have, especially if you are someone in the scientific era. Don’t forget that some says “People who buy Macs are the same people who said BETA is better than VHS 15 years ago”.

For an average physicist like me, it may be long term run to build a useful system on Macbook.
Here is a list of softwares that a scientist may need:

Compilers:
gcc, g++, gfortran, g77, f77,Java, …etc.

Package Managers:

MacPorts, Fink, Darwin, RPM, Apt-get, …etc.

Analysis Softwares:

ROOT, Jas3, Aida, Octave, …etc.

Computing Softwares:

Mathematica, Matlab, …etc.

Physics Phenomenology Softwares:

Comphep, Calchep, Pythia, Fluka, Geant4, Madx,
Isajet, Prospino …etc.

Depended Packages:

Cernlib, Openmotif, X11, Latex …etc.

Office Tools:

Excel, Text Editors, Presentation tools, PDF, DVI, PS viewers, …etc.

Web Browsers

Mozilla Firefox, Internet Explorer, Safari, Opera, Netscape, …etc.

Next the main question comes up! How to install these softwares on Mac Os X 10.5.x ??

Here is a prescription for beginners:(1). First of all, install compilers(2). Install some package managers(3). Install other software packages using compilers and installed package managers.

(1)

GCC Compiler Installation: Use Macbook installation DVD, you will find a package called Xcode in the DVD, if you search for it. Just install Xcode development tool and your gcc compiler will also comes with it. Then open a terminal window and just write “gcc”. If its error turns like “no input file”, it means you successfully installed the gcc compiler.
Or you can check its location by writing “which gcc” on the command line.

G77 Compiler Installation: Unfortunately you may not find g77 support combining with any other packages or package managers. So you should install it manually:

Gfortran Compiler Installation: There’s an dmg installation file for gfortran compiler. So you should download and install it by just clicking on it.

(2)

MacPorts Installation:

MacPorts provides an open-source software for managing, compiling, installing, upgrading packages which include libraries, utilities on the Mac Os X operating system. One can easily install MacPorts downloading its dmg file and just click on it. After installation you can open a terminal and learn basic Macport commands writing “man port” . Recently for Mac users, MacPorts seem to be the most powerful package manager with almost 8000 packages. Some useful MacPorts commands are;

port list : Get the lists of all packages so that one can choose the package name before installation.

port deps: Shows you the dependencies of a package with other packages.

For complete list of commands, please read the documentation of MacPorts here.

FINK Installation:

Fink automates the process of downloading the binary package, or downloading source package, applying a patch, compling, and installing it. As a package manager, fink is the most advanced unix based software and one can easily find its documentations through web. There is an impressive number of applications you can install via fink. Fink was designed carefully as to not disturb or modify the system. It can be uninstalled with a single command ‘sudo rm -r /sw’ You definitely want f77, imagemagick, ghostscript for X, ispell, xdvi, and gimp if you want to edit graphics or xv to preview them.

Open a terminal window and write “fink” to learn its usage and options.

Write “apt-get” (Fink also installs apt-get package)

Fink downloads packages from mirror servers around the world. So I strictly recommend you to configure mirror settings. Write “fink configure” to configure mirror options. Fink will start to ask you questions about configurations. Press “Enter” for default values. When it asks a question about mirror choose “4- Nearest mirrors from your continent”. Choose your country. And answer all other questions to complete configuration definitions. If you cannot download packages from chosen mirrors while installations, you should reconfigure these settings.

Fink supports stable packages as well as the unstable ones which are not tested or has some exceptions during their running process. To see the supported package list write “fink list” on your command line.

To be able to install unstable packages write “fink configure” and activate unstable package option when it asks you about stable/unstable packages. Press “Enter” to give default answers to other questions.

WARNING: Fink automatically finds the dependencies of packages and usually downloads a set of package. That may probably extand your installation time. So i do not recommend anyone to download huge packages -ex. ROOT- via fink. Because it may take quite a lot of time with the related other packages like gcc4, X11, openmotif, …etc.

(3)

CERNLIB Installation:

First, make sure you installed fink and the compilers gcc, g77.

Open a terminal window and write “sudo fink install cernlib”

Fink will download and install cernlib in a few minutes.

Write “cernlib” on terminal window and see related cernlib locations. If you get an error message, make sure you installed fink and the compilers properly.

About Kuday

10 responses to “Installing Scientific Packages on Mac OS X”

totally agree on the amount of work to get OS X up and running to suit the needs of research (specifically physics). but what is great, is that it’s based on UNIX, which makes it really easy to compile open source apps. also, due to the change to intel based products, installing a linux distro is extremely easy…which makes everything better in the end haha

I followed your instruction for installing Cernlib on Mac using fink, but when finished, the cernlibs are not present under /sw/lib/
I get a cernlib equivalence with “-L/lib -lpacklib -lSystem” but the libraries are nowhere

Even if I install directly binaries from tar, I get ugly messages when compiling from dynamic libraries….

The problem is that the cernlib command defined by fink looks for the cernlib libraries in the /sw/lib folder but there isn’t any cernlib library there! I downloaded and installed them using the binary tar files (except for the variables part), they were saved in the /cern/pro/lib folder, i just copied them in the /sw/lib folder. Now it works! 🙂

I think Fink has some compatibility issues with the new versions of X-code. I don’t know your system but assuming you have a new x-code version, i suggest you not to use fink and try some other package managers like “macport”. Hope that helps..