Tag Archive | x11

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:

  • Download tar file which is most suitable for your computer g77-intel-bin.tar.gz (Intel Mac only) or g77-bin.tar.gz (PowerPC only)
  • Open a terminal window and write “gunzip g77-bin.tar.gz”
  • Write “sudo tar -xvf g77-bin.tar -C /.” for install the spesific files into your usr/bin/ folder.

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 upgrade <pkgname> : Upgrades the specific packages with newest versions.
  • port search <pkgname>: Search the package name (or a part of it) in the complete list of packages. You can make wild card searches like *root* or *X11*..etc.
  • port install <pkgname>: –Most used MacPort command- downloads, compiles, stages and installs the package you entered.
  • port installed: Shows the installed packages on your computer.
  • port uninstall <pkgname>: Deactivate the package.
  • 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.

To download Fink visit http://www.finkproject.org and install its dmg file on your Macbook.

  • 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.
  • To download and install a package write “sudo fink install packagename” on the command line. (ex. “sudo fink install cernlib”)
  • 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.

OR you may prefer to install Cernlib Manually to avoid non-standard installation.

COMPHEP Installation:

  • Visit Comphep’s website, be a member and then download its .tar files.
  • Make sure you installed the compilers gcc and g77 properly.
  • Open a terminal window in the folder that comphep’s .tar file exits.
  • Write “sudo tar -xvf comphep-4.5.1.tar”
  • Write “cd comphep-4.5.1”
  • Write “./configure”
  • Follow the commands and write “make” to complete installation.
  • Write “make setup WDIR=calculations” to create a user file called calculations.
  • To run the application write “cd calculations” and “./comphep”

ROOT Installation:

  • Download ROOT analysis framewok visiting ROOT official web site at CERN. If you’r obsessed to perfection, you should download the latest version for your system. (Mac OS X intel or power pc)
  • To open the related .tar file write “sudo tar -xvf root_v5-1.24.00.macosx105-i386-gcc-4.0.tar” on the command line.
  • Write “cd rroot_v5-1.24.00.macosx105-i386-gcc-4.0”
  • Write “./confgure –help” and “./configure” to make installation settings.
  • Write “make” and complete the installation.

You can also set environmental variables to run root for anytime you open a terminal window by writing “root” command. To edit bash and add environmental variables;

  • Open a termianl window and write “cd /” to go root directory.
  • Write “sudo nano etc/bashrc” to open a editor to edit bash profile.
  • Add the following lines in to bashrc file, save and exit (CTRL-O and CTRL-X)
    • export ROOTSYS=/usr/local/root
    • export DYLD_LIBRARY_PATH=$ROOTSYS/lib
    • export PATH=$PATH:$ROOTSYS/bin
  • You should change $ROOTSYS variable (first line) if you installed ROOT framework in to another directory.

General Instructions for Installations:

  • Download the software in tarball.
  • Decompress tarball writing “sudo tar -zxvf <software>.tar”
  • Cd into folder and edit Makefile. DON’T FORGET TO EDIT IT IN COMPATIBLE WITH YOUR PATHS and COMPILERS or UPDATE YOUR COMPILERS.
  • Write “./install” or “./configure” if you have such shell files to run.
  • Write “make” and start compiling.
  • Trace errors if you have any.

I strongly recommend you to register Apple’s developer website http://developer.apple.com/ for recent updates and development tools.