Difference between revisions of "BBP on OS X Guide"

From SCECpedia
Jump to navigationJump to search
Line 6: Line 6:
 
The following section describes one developers experiences installing Broadband Platform on their Mac running Yosemite OS.
 
The following section describes one developers experiences installing Broadband Platform on their Mac running Yosemite OS.
  
There are several known issues or limitations related to the BBP on a Mac.  
+
There are several installation issues or limitations related to the BBP on a Mac. The primary target operating system for BBP is Linux. Mac's OS  is somewhat different environment, so installation on a Mac is more complex.  
  
An important requirements is that the Mac has a full installation of Python. The BBP needs optional Python packages including Numpy, matplotlib, and others. In the following description, the installation of anaconda is the process by which this full Python installation is done.
+
Key Mac Specific Issues Include:
 
+
* Mac must have a full Python installation that includes bumpy, scipy, matplotlib and other packages
Also, one of the methods, SDSU, does not pass all Unit tests when compiled on a Mac. This is a known issue that was introduced converting from Intel to Gnu compilers. This issue will cause of the twelve BBP Unit Tests to fail on the Mac. We will provide a resolution as soon as possible.
+
* Mac must have a gcc compiler environment, obtained through Max XCODE software
 +
* Mac must have a gcc fortran compiler installed, not available in XCODE. If you follow the instructions given in the first section, it will required administrator account privileges because these will be required to install the fortran compiler in the default location.
 +
* Mac must have specialized python language geographic project module pyproj installed
 +
* SDSU bbptoolbox is not validated for the Mac environment due to use of certain math libraries without Mac environment equivalents. As a result the SDSU does not pass all Unit tests when compiled on a Mac. This is a known, Mac-specific issue. The SDSU method passes all tests in the target Linux environment. We will provide a resolution to this know limitation of the Mac-version of the BBP, as soon as one is available.
  
 
#Install anaconda python:
 
#Install anaconda python:
Line 24: Line 27:
 
SHELL=/bin/bash
 
SHELL=/bin/bash
 
TERM=xterm-256color
 
TERM=xterm-256color
TMPDIR=/var/folders/52/gd67hpb90f9b_3qftg4hnn_00000gt/T/
 
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.JEvsdrGEeL/Render
 
 
TERM_PROGRAM_VERSION=343.7
 
TERM_PROGRAM_VERSION=343.7
 
TERM_SESSION_ID=177D5090-D37D-4EFD-998D-9290C7DD789B
 
TERM_SESSION_ID=177D5090-D37D-4EFD-998D-9290C7DD789B
 
USER=maechlin
 
USER=maechlin
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.WDI4RcLb1g/Listeners
+
PATH=/Users/maechlin/anaconda/bin:/opt/local/gmt/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
__CF_USER_TEXT_ENCODING=0x1FA:0x0:0x0
 
PATH=/Users/maechlin/anaconda/bin:/Users/maechlin/.composer/vendor/drush/drush/:/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php5.5.14/bin:/opt/local/gmt/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Developer/Tools/Panda3D:/usr/texbin
 
 
PWD=/Users/maechlin
 
PWD=/Users/maechlin
 
LANG=en_US.UTF-8
 
LANG=en_US.UTF-8
Line 38: Line 37:
 
SHLVL=1
 
SHLVL=1
 
HOME=/Users/maechlin
 
HOME=/Users/maechlin
PYTHONPATH=/Users/maechlin/anaconda/lib:/Users/maechlin/Documents/dev/workspace/lib/python
+
PYTHONPATH=/Users/maechlin/anaconda/lib
LOGNAME=maechlin
+
 
_=/usr/bin/env
 
 
scecadms-MBP:~ maechlin$ which python
 
scecadms-MBP:~ maechlin$ which python
 
/Users/maechlin/anaconda/bin/python
 
/Users/maechlin/anaconda/bin/python
  
#Download 6 files from BBP web site:
+
#Download the minimum set of required BBP files from the BBP web site:
 +
*bbp-dist-15.3.0.tar.gz
 +
*bbp-dist-15.3.0.tar.gz.md5
 +
*labasin-velocity-model-15.3.0.tar.gz
 +
*labasin-velocity-model-15.3.0.tar.gz.md5
 +
*northridge-validation-15.3.0.tar.gz
 +
*northridge-validation-15.3.0.tar.gz.md5
  
# Do md5 sum check like this:
+
# MD5 checksum is different on Mac than on Linux. Here's a way to do md5 sum check like this on a Mac:
bbp-dist-15.3.0.tar.gz
 
bbp-dist-15.3.0.tar.gz.md5
 
labasin-velocity-model-15.3.0.tar.gz
 
labasin-velocity-model-15.3.0.tar.gz.md5
 
northridge-validation-15.3.0.tar.gz
 
northridge-validation-15.3.0.tar.gz.md5
 
 
scecadms-MBP:bbp_2015 maechlin$ cat bbp-dist-15.3.0.tar.gz.md5
 
scecadms-MBP:bbp_2015 maechlin$ cat bbp-dist-15.3.0.tar.gz.md5
 
24d88c5a22543409e89a22d64b451f85  bbp-dist-15.3.0.tar.gz
 
24d88c5a22543409e89a22d64b451f85  bbp-dist-15.3.0.tar.gz
Line 84: Line 82:
 
scecadms-MBP:~ maechlin$
 
scecadms-MBP:~ maechlin$
  
 
+
# A BBP Issue is that XCODE does not installs a gcc fortran compiler. Details to install fortran
5. Issue is no fortran installed. Details to install fortran
 
 
https://wiki.helsinki.fi/display/HUGG/Installing+the+GNU+compilers+on+Mac+OS+X
 
https://wiki.helsinki.fi/display/HUGG/Installing+the+GNU+compilers+on+Mac+OS+X
  
 
Download the gcc compiler for Yosemite to the downloads direction. Then run as sudo to install gcc and gfortran.
 
Download the gcc compiler for Yosemite to the downloads direction. Then run as sudo to install gcc and gfortran.
  
gunzip gcc-4.9-bin.tar.gz
+
gunzip gcc-4.9-bin.tar.gz
 +
sudo tar xvf gcc-4.9-bin.tar -C /
  
sudo tar xvf gcc-4.9-bin.tar -C /
+
This installs things in root, in /usr/local/…
  
This installs things in root, in /usr/local/
+
# Create the data structure defined in the installation guide.
 +
 
 +
/Users/Maechlin/Documents/dev/bbp_2015/15.3.0
 +
../bbp_gf
 +
../bbp_val
 +
../bbp_data
 +
 
 +
# Now, in the BBP src directory, the make file builds without error.
  
6. Download the three tar files and put them on a mac and create the data structure defined in the installation guide.
+
# At this stage, the compiled BBP code has been built. However, we have not confirmed that the python environment has been setup correctly.  
/Users/Maechlin/Documents/dev/bbp_2015/15.3.0
 
../bbp_gf
 
../bbp_val
 
../bbp_data
 
  
7. Now, in the src directory, the make file builds without error.
+
We can test the installation by running the Unit Tests. The ./UnitTests.py fails, unable to find pyproj
  
8. Now the ./UnitTests.py fails, unable to find pyproj
+
# Install pyproj
  
 
https://github.com/jswhit/pyproj
 
https://github.com/jswhit/pyproj
Line 110: Line 111:
 
Go to pyproj, download, build and install
 
Go to pyproj, download, build and install
  
python setup.py build
+
python setup.py build  
python setup.py install (with sudo if necessary).
+
python setup.py install (with sudo if necessary).
 +
 
 
To test, run python -c "import pyproj; pyproj.test()"
 
To test, run python -c "import pyproj; pyproj.test()"
  
 +
#Now ./UnitTests.py gives deprecation warnings, and one of the UnitTests fails on a Mac. This reduces the available number of ground motion methods that can be run on the Mac. On Linux, there are five methods available (GP, SDSU, UCSB, EXSIM, CSM). On a Mac, there are four methods available (GP, UCSB, EXSIM, CSM).
  
9. Now ./UnitTests.py gives deprecation wanings, but all tests pass.
+
scecadms-MBP:tests maechlin$ ./UnitTests.py
 
+
/Users/maechlin/anaconda/lib/python2.7/site-packages/matplotlib/cbook.py:137: MatplotlibDeprecationWarning: The matplotlib.mpl module was deprecated in version 1.3. Use `import matplotlib as mpl` instead.
scecadms-MBP:tests maechlin$ ./UnitTests.py
+
  warnings.warn(message, mplDeprecation, stacklevel=1)
/Users/maechlin/anaconda/lib/python2.7/site-packages/matplotlib/cbook.py:137: MatplotlibDeprecationWarning: The matplotlib.mpl module was deprecated in version 1.3. Use `import matplotlib as mpl` instead.
+
test_runprog (test_bband_utils.Test_bband_utils) ... ok
  warnings.warn(message, mplDeprecation, stacklevel=1)
+
test_runprog2 (test_bband_utils.Test_bband_utils) ... ok
test_runprog (test_bband_utils.Test_bband_utils) ... ok
+
test_runprog3 (test_bband_utils.Test_bband_utils) ... ok
test_runprog2 (test_bband_utils.Test_bband_utils) ... ok
+
test_execute_platform_bbp (test_python_code.Test_PythonCode) ... /Users/maechlin/anaconda/lib/python2.7/site-packages/matplotlib/cbook.py:137:   MatplotlibDeprecationWarning: The matplotlib.mpl module was deprecated in version 1.3. Use `import matplotlib as mpl` instead.
test_runprog3 (test_bband_utils.Test_bband_utils) ... ok
+
  warnings.warn(message, mplDeprecation, stacklevel=1)
test_execute_platform_bbp (test_python_code.Test_PythonCode) ... /Users/maechlin/anaconda/lib/python2.7/site-packages/matplotlib/cbook.py:137: MatplotlibDeprecationWarning: The matplotlib.mpl module was deprecated in version 1.3. Use `import matplotlib as mpl` instead.
+
ok
  warnings.warn(message, mplDeprecation, stacklevel=1)
 
ok
 
  
 
test_bbtoolbox (test_bbtoolbox.Test_BBToolbox) ... /bin/sh: line 1:  6027 Abort trap: 6          /Users/maechlin/Documents/dev/bbp_2015/15.3.0/bbp/src/sdsu/bin/BBtoolbox.exe < /Users/maechlin/Documents/dev/bbp_2015/bbp_data/tmpdata/9642805/bbtoolbox_test_stat/parfilename_test_stat >> /Users/maechlin/Documents/dev/bbp_2015/bbp_data/logs/9642805/9642805.bbtoolbox_test_stat.log 2>&1
 
test_bbtoolbox (test_bbtoolbox.Test_BBToolbox) ... /bin/sh: line 1:  6027 Abort trap: 6          /Users/maechlin/Documents/dev/bbp_2015/15.3.0/bbp/src/sdsu/bin/BBtoolbox.exe < /Users/maechlin/Documents/dev/bbp_2015/bbp_data/tmpdata/9642805/bbtoolbox_test_stat/parfilename_test_stat >> /Users/maechlin/Documents/dev/bbp_2015/bbp_data/logs/9642805/9642805.bbtoolbox_test_stat.log 2>&1

Revision as of 04:31, 24 April 2015

Introduction

The Broadband Platform is compatible with Linux as well as OS X. However, due to some recent changes that Apple has made to their Xcode development tools, users on Mavericks (OS X 10.9) and Yosemite (OS X 10.10) will need to follow some additional steps to make the installation work.

Installation on Mac Yosemite

The following section describes one developers experiences installing Broadband Platform on their Mac running Yosemite OS.

There are several installation issues or limitations related to the BBP on a Mac. The primary target operating system for BBP is Linux. Mac's OS is somewhat different environment, so installation on a Mac is more complex.

Key Mac Specific Issues Include:

  • Mac must have a full Python installation that includes bumpy, scipy, matplotlib and other packages
  • Mac must have a gcc compiler environment, obtained through Max XCODE software
  • Mac must have a gcc fortran compiler installed, not available in XCODE. If you follow the instructions given in the first section, it will required administrator account privileges because these will be required to install the fortran compiler in the default location.
  • Mac must have specialized python language geographic project module pyproj installed
  • SDSU bbptoolbox is not validated for the Mac environment due to use of certain math libraries without Mac environment equivalents. As a result the SDSU does not pass all Unit tests when compiled on a Mac. This is a known, Mac-specific issue. The SDSU method passes all tests in the target Linux environment. We will provide a resolution to this know limitation of the Mac-version of the BBP, as soon as one is available.
  1. Install anaconda python:

http://docs.continuum.io/anaconda/install.html

  1. Evaluate Mac environment:

Bring up terminal Env Which python

scecadms-MBP:~ maechlin$ env TERM_PROGRAM=Apple_Terminal SHELL=/bin/bash TERM=xterm-256color TERM_PROGRAM_VERSION=343.7 TERM_SESSION_ID=177D5090-D37D-4EFD-998D-9290C7DD789B USER=maechlin PATH=/Users/maechlin/anaconda/bin:/opt/local/gmt/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin PWD=/Users/maechlin LANG=en_US.UTF-8 XPC_FLAGS=0x0 XPC_SERVICE_NAME=0 SHLVL=1 HOME=/Users/maechlin PYTHONPATH=/Users/maechlin/anaconda/lib

scecadms-MBP:~ maechlin$ which python /Users/maechlin/anaconda/bin/python

  1. Download the minimum set of required BBP files from the BBP web site:
  • bbp-dist-15.3.0.tar.gz
  • bbp-dist-15.3.0.tar.gz.md5
  • labasin-velocity-model-15.3.0.tar.gz
  • labasin-velocity-model-15.3.0.tar.gz.md5
  • northridge-validation-15.3.0.tar.gz
  • northridge-validation-15.3.0.tar.gz.md5
  1. MD5 checksum is different on Mac than on Linux. Here's a way to do md5 sum check like this on a Mac:

scecadms-MBP:bbp_2015 maechlin$ cat bbp-dist-15.3.0.tar.gz.md5 24d88c5a22543409e89a22d64b451f85 bbp-dist-15.3.0.tar.gz scecadms-MBP:bbp_2015 maechlin$ md5 bbp-dist-15.3.0.tar.gz MD5 (bbp-dist-15.3.0.tar.gz) = 24d88c5a22543409e89a22d64b451f85 scecadms-MBP:bbp_2015 maechlin$ cat labasin-velocity-model-15.3.0.tar.gz.md5 f24dc01a6b1bf533b83067fbaa75c9d3 labasin-velocity-model-15.3.0.tar.gz scecadms-MBP:bbp_2015 maechlin$ md5 labasin-velocity-model-15.3.0.tar.gz MD5 (labasin-velocity-model-15.3.0.tar.gz) = f24dc01a6b1bf533b83067fbaa75c9d3 scecadms-MBP:bbp_2015 maechlin$ cat northridge-validation-15.3.0.tar.gz.md5 d4f396be3b29082841ddd4622f39cabb northridge-validation-15.3.0.tar.gz scecadms-MBP:bbp_2015 maechlin$ md5 northridge-validation-15.3.0.tar.gz MD5 (northridge-validation-15.3.0.tar.gz) = d4f396be3b29082841ddd4622f39cab

  1. Check xcode on Mac. Yosemite. XCODE Version 6.3
  1. Check on Mac Python installation.Use anaconda because it includes many of the packages, such as numpy and matplotlib that are required by bbp.

Also, this version can be installed without root access, which I did in my Mac account User Maechlin

https://store.continuum.io/cshop/anaconda/

  1. At command line which gcc, gcc -v

scecadms-MBP:~ maechlin$ which gcc /usr/bin/gcc scecadms-MBP:~ maechlin$ gcc -v Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin14.3.0 Thread model: posix scecadms-MBP:~ maechlin$

  1. A BBP Issue is that XCODE does not installs a gcc fortran compiler. Details to install fortran

https://wiki.helsinki.fi/display/HUGG/Installing+the+GNU+compilers+on+Mac+OS+X

Download the gcc compiler for Yosemite to the downloads direction. Then run as sudo to install gcc and gfortran.

gunzip gcc-4.9-bin.tar.gz
sudo tar xvf gcc-4.9-bin.tar -C /

This installs things in root, in /usr/local/…

  1. Create the data structure defined in the installation guide.
/Users/Maechlin/Documents/dev/bbp_2015/15.3.0
../bbp_gf
../bbp_val
../bbp_data
  1. Now, in the BBP src directory, the make file builds without error.
  1. At this stage, the compiled BBP code has been built. However, we have not confirmed that the python environment has been setup correctly.

We can test the installation by running the Unit Tests. The ./UnitTests.py fails, unable to find pyproj

  1. Install pyproj

https://github.com/jswhit/pyproj

Go to pyproj, download, build and install

python setup.py build 
python setup.py install (with sudo if necessary).

To test, run python -c "import pyproj; pyproj.test()"

  1. Now ./UnitTests.py gives deprecation warnings, and one of the UnitTests fails on a Mac. This reduces the available number of ground motion methods that can be run on the Mac. On Linux, there are five methods available (GP, SDSU, UCSB, EXSIM, CSM). On a Mac, there are four methods available (GP, UCSB, EXSIM, CSM).
scecadms-MBP:tests maechlin$ ./UnitTests.py
/Users/maechlin/anaconda/lib/python2.7/site-packages/matplotlib/cbook.py:137: MatplotlibDeprecationWarning: The matplotlib.mpl module was  deprecated in version 1.3. Use `import matplotlib as mpl` instead.
  warnings.warn(message, mplDeprecation, stacklevel=1)
test_runprog (test_bband_utils.Test_bband_utils) ... ok
test_runprog2 (test_bband_utils.Test_bband_utils) ... ok
test_runprog3 (test_bband_utils.Test_bband_utils) ... ok
test_execute_platform_bbp (test_python_code.Test_PythonCode) ... /Users/maechlin/anaconda/lib/python2.7/site-packages/matplotlib/cbook.py:137:   MatplotlibDeprecationWarning: The matplotlib.mpl module was deprecated in version 1.3. Use `import matplotlib as mpl` instead.
  warnings.warn(message, mplDeprecation, stacklevel=1)
ok

test_bbtoolbox (test_bbtoolbox.Test_BBToolbox) ... /bin/sh: line 1: 6027 Abort trap: 6 /Users/maechlin/Documents/dev/bbp_2015/15.3.0/bbp/src/sdsu/bin/BBtoolbox.exe < /Users/maechlin/Documents/dev/bbp_2015/bbp_data/tmpdata/9642805/bbtoolbox_test_stat/parfilename_test_stat >> /Users/maechlin/Documents/dev/bbp_2015/bbp_data/logs/9642805/9642805.bbtoolbox_test_stat.log 2>&1 ERROR test_amp_fac (test_amp_fac.Test_Amp_Fac) ... ok

The BBPToolbox does not pass, but this is a known limitation of the BBP installation

OS X 10.9 Mavericks

Installing OS X on Mavericks is possible by following these steps:

1) Install Xcode from the Mac App Store.
2) Install the Xcode command line tools. To do this, in your Terminal window, please type in sudo xcode-select --install. A dialog box will pop-up asking if you want to install the command line tools. Please choose "OK" on this box.
3) Then install MacPorts from http://www.macports.org. MacPorts helps install the requirements to compile the Broadband Platform. The version of MacPorts we used was 2.3.3. Please note that to install MacPorts you must agree to the Xcode license terms. After running the MacPorts installer, please go to your Terminal and run the command sudo xcodebuild -license.
4) Install GCC 4.8 using the following command: sudo port install gcc48
​​​​5) Select the new compiler as the default compiler using the command: sudo port select gcc mp-gcc48
6) Install the PIP package manager for Python, using the command: sudo easy_install pip
7) Install PyProj, using the command: sudo pip install pyproj
8) Compile the Broadband Platform by going into the src directory and typing "make"

OS X 10.10 Yosemite

In order to install the Broadband Platform on Yosemite, you must follow these steps:

1) Install Xcode from the Mac App Store.
2) Install the Xcode command line tools. To do this, in your Terminal window, please type in sudo xcode-select --install. A dialog box will pop-up asking if you want to install the command line tools. Please choose "OK" on this box.
3) Then install MacPorts from http://www.macports.org. MacPorts helps install the requirements to compile the Broadband Platform. The version of MacPorts we used was 2.3.3. Please note that to install MacPorts you must agree to the Xcode license terms. After running the MacPorts installer, please go to your Terminal and run the command sudo xcodebuild -license.
4) Install GCC 4.9 using the following command: sudo port install gcc49
​​​​5) Select the new compiler as the default compiler using the command: sudo port select gcc mp-gcc49
6) Install the PIP package manager for Python, using the command: sudo easy_install pip
7) Install PyProj, using the command: sudo pip install pyproj
8) Compile the Broadband Platform by going into the src directory and typing "make"