Instructions for Installing the OSG Client on Mac OS/X

From GlueXWiki
Revision as of 14:16, 17 January 2013 by Jonesrt (Talk | contribs) (Update of the gcc/gfortran/g++ compiler bundle)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page gives guidance to Mac OS/X users on how to install and configure the grid tools and libraries, and integrate them for running GlueX offline software. The reader is assumed to have sysadmin privileges on the target Mac OS/X machine, and to be familiar with standard command-line package installation procedures for Darwin platforms. The installation proceeds in several distinct stages.

Installation of the Xcode developer suite

The Xcode software development suite includes copies of the gnu c/c++ compilers and associated libraries that have been tweaked by Apple for the Darwin platform. If you have done any software development on your Mac, you probably have already installed this. If not, there is abundant help out there on the web for how to download and install it. It is downloaded from the Apple Appstore, but costs nothing. You are required to sign up as an Apple Developer before you can download the package. You might wonder why you have to install this bundle if (see below) in a few minutes you are going to install a more complete compiler suite that includes the gfortran compiler and libraries. Part of the answer lies in the fact that by becoming an "Apple Developer" you respect Apple licensing restrictions in the use of these compilers. Presumably that also covers you for any other versions of the compilers and libraries that you download and install later.

Installation of the apt package installer

You are probably familiar with the well-known open source software distribution and installation tool called Fink. However the Fink repository does not include the OSG Client stack, nor anything else that you need to run GlueX software. Instead, there are two other package installers that are recommended here: apt and pacman. Users familiar with common Linux distributions will recognize apt/dpkg as the Debian equivalent of Redhat's yum/rpm. HEP researcher Taizo Kobayashi has created an equivalent to apt for Mac OSX called OSXWS (Mac OS/X WorkShop) and his colleague Keisuke Fujii maintains an up-to-date OSXWS repository for common HEP/NP software and tools. You can browse his apt package tree to see all of the releases of OS/X that his repository covers. All software installed by the apt tool goes into the /usr/osxws tree, so no software already installed on your system will be overwritten. To install OSXWS on your system, please select the package corresponding to your OS release from the list below.

Once installed, the apt tool will automatically recognize which OS/X release you are running and fetch its downloads from the appropriate branch of the dpkg tree. You might notice that binary distributions of cernlib, geant4, etc. are available for immediate installation using apt-get. You are free to install any of these that you might find useful, but this is not necessary. The GlueX grid tools will download, build, and install specific revisions of these libraries that are known to work with GlueX offline software. All that is needed in this step is the apt tool itself.

Update of the gcc/gfortran/g++ compiler bundle

From Keisuke Fujii's web site:

gcc-4.X that comes with Apple's standard DevTools does not include "gfortran", the GNU fortran 95 compiler. Although its source tree does include one, building gfortran from Apple's source tree requires some patching to satisfy undefined references caused by Apple's modifications that broke Language independence. Moreover, the gfortran source files are not up-to-date and require a lot of patching to be usable: I had been using the patched versions for some time but recently switched to a more recent version gcc-4.Y. In order to make gcc-4.Y coexist with Apple's gcc-4.X, I decided to configure gcc-4.Y to be installed under /usr/osxws together with other "MacOSX WorkShop" packages.

In the previous step you installed the OSXWS apt tool on your system. Now you can use it to install a version of the gcc compiler suite that includes a version of gfortran that works on Mac OS/X. This is necessary in order to build applications from a mixture of c/c++ and fortran sources. From a terminal window, enter the following commands.

$ su
# apt-get update
# apt-get install imake openMotif-devel Libcompat
# apt-get install gcc 
# apt-get clean
# exit

If you open a new shell, you should see the new compilers appearing first in your path. For more information about a few idiosyncrasies of the gfortran compiler on the Mac, see REMARKS.

Installation of pacman

The packages installed so far have prepared your system to build and run GlueX offline software on your local machine in an environment identical to what is present when it runs on the grid. This will be essential when you are testing your application before submitting it to run on the grid, or when you are trying to understand what went wrong with a grid job. What remains is to install the applications that you will use to access grid resources. Since you will only be a user of grid resources and not a provider, all you need to install is the Grid Client package. At the present time, the best way to install the OSG Client is using the pacman package manager, and the VDT (Virtual Data Toolkit) distribution from the University of Wisconsin. Download and install the pacman application by issuing the following commands from within a work directory under the Users tree.

curl \
     > pacman-3.28.tar.gz
tar zxf pacman-3.28.tar.gz
cd pacman-3.28 # do NOT skip this step
source # or setup.csh for c-shell users

After this, you can source the setup script from any directory and pacman is ready to go. Pacman is written in python, so there is nothing to compile.

Installation of the VDT 2.0 OSG Client package

Create a directory in a location of your choice where you will install the OSG Client toolkit, which you might name something like "osg-client", then cd to that directory and issue the following commands. Pacman will ask for permission to approve things a few times, to which you should answer yes (y).

pacman -get

A log of the installation process that streams to the screen is also saved to a file, so there is no need to read every message as it prints. Let it proceed to the end, then review the log that is saved in the file vdt-install.log. Complete the installation with the following commands.

source # or setup.csh for c-shell types

In the future, all you will need to do is to source the setup script and the OSG client tools will be placed in your path, together with any dynamic libraries on which they depend. Before you can use the tools, you must install the list of approved certificate authorities (CA's) that the OSG uses to authenticate its resources. The following command installs the latest snap-shot of the approved CA list.

vdt-ca-manage setupca --location local --url osg
vdt-control --enable fetch-crl vdt-update-certs vdt-rotate-logs

The following command will make it possible for you to submit grid jobs directly from your Mac, and monitor their progress.

vdt-control --enable condor

If you want to be able to submit grid jobs from this machine, you should make sure that the command "hostname" returns a fully-qualified internet ip name for your host. Sometimes Mac's have stunted addresses like "myMac.local". If you don't want to change this, or if your Mac is a laptop and the IP address changes on a regular basis, you can just set the environment variable CONDOR_HOSTNAME to the FQDN of the host and the toolkit will use that instead of `hostname`.