Skip to content

Instantly share code, notes, and snippets.

@fiedl
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fiedl/28928d7d6208d8610f30 to your computer and use it in GitHub Desktop.
Save fiedl/28928d7d6208d8610f30 to your computer and use it in GitHub Desktop.
Installing the IceCube Simulation Software on Mac OS X 10.9 Mavericks.

Installing IceCube Simulation Software on Mac OS X 10.9 Mavericks

Requirements

  • The Command Line Tools have to be installed.
  • Homebrew has to be installed.
  • The python installation provided by Mac OS should be used. It should neither be installed by homebrew nor by a binary package from python.org.
  • No installation of I3_PORTS. (No IceCube versions of ports or cmake are needed.)

Versions

This guide was written for the following software versions. Please feel free to update it to the current versions.

  • Mac OS X 10.9.2 Mavericks
  • Homebrew 0.9.5
  • Python 2.7.6
  • Simulation Trunk of 2014-05-12.

Modify .zshenv

Assuming one is using zsh, ~/.zshenv has to be modified. Duplications with ~/.zshrc are to be avoided. Using bash the file ~/.bashrc has to be modified respectively.

# ~/.zshenv
# ...

# homebrew
export PATH="/usr/local/bin:$PATH"
export PATH="/usr/local/sbin:$PATH"

# java
export JAVA_HOME="/Library/Java/Home"

# icecube
export ICECUBE_SOFTWARE="~/icecube/software"   # modify this to your needs!
export SVN="http://code.icecube.wisc.edu/svn"
export PYTHONPATH="/usr/local/lib/root/:/usr/local/lib/python2.7/site-packages:$PYTHONPATH"

export SIM="$ICECUBE_SOFTWARE/simulation-trunk-2014-05-12/debug_build"

Close your terminal and open a new one to load the changes.

Modify /etc/hosts

Make sure the code server is in your /etc/hosts:

Send a ping code.icecube.wisc.edu and add the ip to your /etc/hosts:

# /etc/hosts
# ...
128.8.164.186 code

That way, you can reference http://code.icecube.wisc.edu as http://code, which is needed for some packages.

Install Dependencies

brew update
brew tap homebrew/science
brew tap jvansanten/icecube
brew install boost cmake cdk gsl hdf5 libarchive cfitsio minuit2 mysql qt pyqt suite-sparse sprng2 geant clhep log4cpp doxygen rdmc ccache distcc

Install Root

First, try:

brew install root --cocoa

But ignore the homebrew comment about adding a thisroot.sh to your .bashrc or .bash_profile.

Troubleshooting: Installing xrootd

For some reason, installing xrootd fails for me with some xrdadler32 error.

Try to use this bottle:

brew install https://teamcity-dss.cern.ch:8443/repository/download/bt76/33118:id/xrootd-macosx-3.3.6.tar.bz2

Alternatively, manually:

I downloaded the current xrootd stable build for Mac OS from the build service to ~/Downloads/xrootd-3.3.6.

mkdir -p /usr/local/Cellar/xrootd
mv ~/Downloads/xrootd-3.3.6 /usr/local/Cellar/xrootd/3.3.6
brew link xrootd

brew info xrootd should confirm that xrootd is installed now.

Continue, installing root:

brew install root --cocoa

Install slalib-c

First, try:

brew install slalib-c

Troubleshooting: Download failed.

Make sure, the code server is added to your /etc/hosts as described above. Then, try again.

Installing simulation

Have a look at http://code.icecube.wisc.edu/svn/meta-projects/simulation/releases and find out which is the current release. At 2014-05-12, the current release is simulation V04-00-12.

Alternatively, try the trunk (which would be the master branch in git jargon).

mkdir -p $ICECUBE_SOFTWARE/simulation-trunk-2014-05-12/debug_build
cd $ICECUBE_SOFTWARE/simulation-trunk-2014-05-12
svn co $SVN/meta-projects/simulation/trunk/ src

cd $ICECUBE_SOFTWARE/simulation-trunk-2014-05-12/debug_build
cmake -D CMAKE_BUILD_TYPE=Debug -D SYSTEM_PACKAGES=true ../src

./env-shell.sh
make -j 2   # compile on 2 cores

Troubleshooting

cdk: 'dscale.h' file not found

Patch this file by including cdk/ in several #include directives:

// /usr/local/Cellar/cdk/5.0.20140118/include/cdk.h
// ...

/*
 * Generated headers:
 */
#include <cdk/dscale.h>
#include <cdk/fscale.h>
#include <cdk/scale.h>
#include <cdk/uscale.h>

#include <cdk/fslider.h>
#include <cdk/slider.h>
#include <cdk/uslider.h>

PROPOSAL: Python error: PyThreadState_Get: no current thread

To verify that this is the same problem, run the ./env-shell.sh script, start python and try:

# python
from icecube.dataclasses import I3Particle

If this causes python to crash, this is the same problem.

Attention: Do not delete the following files, which are the python system installation of Mac OS. Make sure you do have a backup:

/System/Library/Frameworks/Python.framework
/usr/bin/python
/usr/include/python*
/usr/lib/python*
/usr/lib/libpython*

Steps to resolve the issue:

  • Remove every python installation (homebrew, third-party binary) except for the system one, which is in /System/Library/Frameworks/Python.framework, /usr/bin/python, /usr/include and /usr/lib. In order to find other installations, sudo /usr/libexec/locate.updatedb && locate python might help.
  • brew uninstall boost root; brew install boost boost-build root.
  • sudo easy_install pip && sudo pip install numpy sphinx
  • echo '/usr/local/lib/python2.7/site-packages' > /Library/Python/2.7/site-packages/homebrew.pth
  • sudo pip install urwid
  • Then: Reconfigure and recompile simulation.

Boost not found

This takes 40 minutes:

brew uninstall boost; brew install boost --build-from-source --with-python

IPython

sudo easy_install pip
sudo pip install ipython

In order to make ipython qtconsole work:

sudo pip install python-qt
brew install pyqt pyside

mkdir -p ~/Library/Python/2.7/lib/python/site-packages
echo '/usr/local/lib/python2.7/site-packages' > ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth

sudo pip install pyzmq

ipython qtconsole

More information: http://ipython.org/ipython-doc/dev/interactive/qtconsole.html

Steamshovel

The event viewer of IceCube is Steamshovel.

cd $ICECUBE_SOFTWARE/simulation-trunk-2014-05-12/debug_build
./env-shell.sh
bin/steamshovel

Troubleshooting

dyld: Library not loaded: /usr/local/lib/libpng15.15.dylib

brew update
brew upgrade libpng
brew reinstall qt

See: Homebrew/legacy-homebrew#27898

ImportError: No module named sip

brew install sip
cd /usr/local/lib/python2.7/site-packages
ln -s /usr/local/Cellar/sip/4.15.5/lib/python2.7/site-packages sip

Make sure that /usr/local/lib/python2.7/site-packages is in your $PYTHONPATH.

ImportError: already imported an Incompatible QT Binding: pyside

brew uninstall pyside
brew install pyqt

Further Reference

Getting Help

Try the #icecube irc channel on irc.efnet.net. A good irc client for Mac OS is Colloquy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment