How to set up a MacOSX machine to run Minos code. This works with Panther (10.3), but not Jaguar (10.2. 10.1, 10.0). The official WebDocs installation procedure for external packages and minossoft code now works for MacOSX. The procedure below is an alternative which short-circuits much of the work involved in configuring and building the software from scratch. I (gmieg) will get this into HTML format eventually. 1) Run Apple "Software Update" (regularly) from Apple menu in upper lefthand corner of screen. You want to update your initial setup if you haven't done so before now. You will have to update it at least twice to get all the updates that have occurred. 2) Download X11 from Apple Web site and install it: http://www.apple.com/macosx/features/x11/download/ The installer puts it into /Applications/Utilities/. You need to start it running before you can run any X application. If you ssh to another machine, you want to start X11 before you ssh, so that the X authority gets transferred and X environment gets set up right. I prefer to use Terminal for this, not the XTERM window which starts up with X11. 3) Install Apple Developer Tools (XCodeTools). I'm using the latest version 1.5 successfully, although the Fink Web site is warning that some of their packages are having trouble with 1.5. I haven't found any problem with the fink packages that we need. When installing XCodeTools, I clicked on "customize" on the "Installation Type" screen so that I could select a couple of packages that are not installed by default. I added "X11 SDK" and "CHUD Tools". I did *not* install "gcc 3.1", "gcc 2.95.2" or "Cross-Development". From the "Custom Install" screen, I then clicked "Upgrade", not "Easy Install". I'm not sure what the difference is. After you install XCodeTools, make a soft link for "gmake": cd /usr/bin; sudo ln -s make gmake; (respond to prompt with your password) 4) Download ROOT source from CVS into /ROOT/pro. Don't build it yet. 5) At Fermilab There are 2 tar balls in: /afs/fnal.gov/files/data/minos/d14/gmieg These are sw.tar.gz (303.9 MB) and macloon_20041019.tar.gz (471.5 MB). If you unpack sw.tar.gz it produces an "sw" folder that represents the fink installation I am using. Fink expects to find it in the root directory as /sw. An alternative way to create and populate /sw is to run the FinkCommander application after you have installed fink itself (which creates /sw). FinkCommander is a nice way to install and manage fink packages. I used the "+A" ("install binary packages") button in the upper left-hand corner, rather than the "+.h" ("install packages from source") button, to install the new packages. The extra packages I installed are: cernlib cernlib.dev dlcompat.shlibs g77 latex-xft-fonts latex2html latex2rtf tetex xfig You can also add xemacs. I don't use xemacs on MacOSX myself, because remote emacs sessions already open in an XEmacs window on the Mac when X11 is running, and I prefer to use the Apple XCode program to edit local files on the Mac. XCode comes with XCodeTools. It gets installed into /Developer/Applications/. The fink packages above, in turn, require a lot of other packages. When FinkCommander asks if these other packages are OK, just hit . xfig and tetex, in particular, add a lot of packages. The macloon_20041019.tar.gz file unpacks into a directory called macloon_20041019 containing a bunch of stuff I use: gmieg% ls -l drwxr-xr-x 11 gmieg staff 374 14 Sep 15:51 Applications drwxr-xr-x 4 gmieg staff 136 9 Sep 10:59 ROOT_eg_inc drwxr-xr-x 3 gmieg staff 102 9 Sep 11:05 doc drwxr-xr-x 8 gmieg staff 272 14 Sep 15:43 minosbase drwxr-xr-x 6 gmieg staff 204 14 Sep 15:53 user_account drwxr-xr-x 7 gmieg staff 238 9 Sep 11:05 var_db_openafs_etc The Applications directory contains several useful things, some of which you may already have. Some of these files are installers for the packages: gmieg% ls Applications DivX51Installer.sit MacGhostViewX_Folder Fink-0.7.0-Installer.dmg MacStumbler.app FinkCommander_0.5.3.dmg TinkerTool InstallSETI@homeOSX.sit XcodeTools1.5__CD.dmg These include: -- Use MacStumbler.App to monitor wireless signals in the air. This is useful when you have wireless problems. -- Install TinkerTool and run it to turn on Preferences to see "invisible" files in the Finder and some other options that users coming from UNIX like. Apple hides many of these Preferences to avoid scaring the Mac-faithful. -- DivX5 allows you to run Pete and Bernie's streaming offline tutorials from within Safari. -- MacGhostViewX is a viewer for ps and eps files. This is largely superceded by the Panther version of Apple PreView. However, it's still useful for problem ps files. The first time you use it you have to go to the menu item "Options"->"Set Search Paths" and set the ghostscript path to "/sw/share/ghostscript". -- The XcodeTools1.5 installer lets you install XCodeTools without signing up as an Apple Developer from the Apple Web Site. -- The SETI@homeOSX installer installs the SETI screensaver. This is obsolete now that the BOINC project provides integrated management of SETI and other volunteer network projects. See http://boinc.berkeley.edu/ ROOT_eg_inc contains one file, Hepevt.h. For ROOT releases starting with CVS ROOT of 7 April 2006 (ROOT 5.11/01), this file should be ignored. For ROOT prior to 7 April 2006, use the supplied file to replace Hepevt.h in $ROOTSYS/eg/inc before building ROOT. The minosbase folder can be moved directly into the machine root directory at /minosbase. It contains 4 sub-directories: bmaps dbm external minossoft The "external" directory contains the external packages already built, minus fink and ROOT. This includes the database packages and sigc++. The database stuff is configured and the tables just need to be primed as described below. INSTALLATION gets defined as "/minosbase/external/installation". $INSTALLATION/bin provides an extended version of the BSD getopt command which allows for long options, necessary for our DatabaseMaintenance and RunSummary packages. This getopt will get used provided $INSTALLATION/bin comes early enough in the binary PATH. It is set like this by my .cshrc, which sources setup_minossoft_chaos. [This is how I built and installed the extended getopt: This getopt.c is for MacOSX (which uses the BSD OS) only. getopt.c comes from: http://www.cygwin.com/ml/cygwin/2002-06/msg00129/getopt.c It is a modified version of BSD getopt.c which allows long options. I compiled it with: cc getopt.c -o getopt_with_long Then I put getopt_with_long in $INSTALLATION/bin with a soft link from getopt_with_long to $INSTALLATION/bin/getopt. This should override the /usr/bin/getopt on MacOSX. The long option feature is needed by $SRT_PUBLIC_CONTEXT/DatabaseMaintenance/tools/*.sh scripts to prime and dump the Minos offline database.] The user_account directory appears to be empty, but "ls -a" shows the presence of the .cshrc, .login and .logout files that I'm using. The .cshrc sources $SRT_DIST/setup/setup_minossoft_chaos, which should work for you as is. It sets up the paths and the rest of the minossoft environment. Note that .login wants you to have copied your .ssh directory from another machine where you have your .ssh keys already set for Fermilab CVS access. If you don't have these keys, you should get them according to our WebDocs page before you try to "cvs update" minossooft: http://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/cvs-rep.html The var_db_openafs_etc directory contains some files I copied into the /var/db/openafs/etc directory after I installed OpenAFS from the OpenAFS Website, and *before* I did the reboot at the end of the OpenAFS installation. gmieg% ls var_db_openafs_etc/* var_db_openafs_etc/CellServDB (an abridged list of known AFS cells to speed up AFS startup. The master copy of this, already in the directory, contains all known AFS cells worldwide.) var_db_openafs_etc/cacheinfo (not sure if I really need this) var_db_openafs_etc/ThisCell (Set to default "fnal.gov". You can edit the string for another AFS cell - e.g., "slac.stanford.edu") var_db_openafs_etc/config: (afsd.options went into my directory afsd.options /var/db/openafs/etc/config) 6) Set up minossoft build environment: source .cshrc (the one in macloon_20041019/user_account sources /minosbase/minossoft/setup/setup_minossoft_chaos which should work for your installation) 7) Build ROOT cd $ROOTSYS; unsetenv MAKEFLAGS; (for building ROOT only) cvs update -P -A -d; rootconfigure; (This is a script in $INSTALLATION/bin.) gmake; gmake cintdlls; setenv MAKEFLAGS $SRT_MAKEFLAGS; (turn back on for SRT) 8) Build minossoft cd $SRT_DIST; ./setup/msrt -l -v update; (uses ssh keys, not pserver) ./setup/msrt -l -v build; grep "Error " $SRT_PUBLIC_CONTEXT/build-logs/Darwin-GCC/*; Everything should build except TriD, which fails in the bin step. 9) Start database server Type "startmysql;". (This is a script in $INSTALLATION/bin.) It gives me an error message about "chown" privileges, which doesn't seem to matter. If I accidentally start it twice, mysql doesn't seem to work anymore. I eliminated the "chown" error message permanently by typing "sudo startmysql" one time, instead of simply "startmysql". This prompts for my Mac account password. Then the "sudo ..." command fails to start mysql. However, subsequent invocations of "startmysql" work without the chown error message. 10) Prime offline database Make sure that AFS is running. It usually starts up automatically when the network is live on boot-up, but sometimes it doesn't start if network startup is slow or delayed. Type "klog" or "tokens" to authenticate or check for tokens. If these commands don't work, type "startafs" (in $INSTALLATION/bin) to start the local AFS client daemon. Startafs asks for your Mac account (administrator) password. Edit $MINOS_SOFT/dbm/scripts/local.config, if necessary. You can change "gmieg\@slac.stanford.edu" to your own email address. You need the "\" before the "@". You can edit the "dbm_host" string to be the name of your own machine. It must be a single token with no embedded blanks. cd $SRT_PUBLIC_CONTEXT/DatabaseMaintenance/tools/; load_tables.sh --host localhost --password numi96 prime; Edit $MINOS_SOFT/dbm/work/FNAL_import.context to set the update number to the one which corresponds to what was loaded by load_tables.sh. This is initially "-1" before priming. Presuming you have built minossoft, you can use dbmjob to update the database: cd $MINOS_SOFT/dbm/scripts; run_import.sh; I run this every day or so to avoid having to reprime. You can also run "run_checksum.sh" to check your database against the Fermilab master. This is pretty slow. 11) Brian reminds users that makefiles for programs building with root classes need to include the appropriate macosx flags. See the sample in /$ROOTSYS/test/Makefile.macosx. Minossoft takes care of this in file: $SRT_PUBLIC_CONTEXT/SRT_MINOS/SoftRelTools/platforms/Darwin.mk Stand-alone programs need to handle the build-flags themselves. 12) Please send comments and corrections for this procedure or suggestions about streamlining it for new owners of Mac machines to gmieg@slac.stanford.edu. Thanks.