Difference between revisions of "BBP on OS X Guide 16 5"
Line 4: | Line 4: | ||
The key Mac OS X-specific issues include: | The key Mac OS X-specific issues include: | ||
− | + | #Mac must have a gcc compiler environment, and the Mac command line tools, obtained through the Xcode software distribution available through the Mac App store. | |
+ | #Mac must have a gcc fortran compiler installed, which is not available in the Mac Xcode distribution. We recommend use of a gnu Mac binary distribution of gfortan. | ||
#Mac must have a full Python installation that includes NumPy, SciPy, matplotlib and other packages. We recommend use of a free commercial Python distribution called Anaconda, that includes all these required python libraries. | #Mac must have a full Python installation that includes NumPy, SciPy, matplotlib and other packages. We recommend use of a free commercial Python distribution called Anaconda, that includes all these required python libraries. | ||
− | + | #Mac must have specialized Python language geographic project module, called pyproj, installed. The required pyproj can be installed using anaconda package update tool. | |
− | + | #The current SDSU BBToolbox software is not compatible with the Mac environment. The code will crash and as a result the SDSU method will not be tested by the 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. | |
− | #Mac must have specialized Python language geographic project module pyproj installed | ||
− | # | ||
=== Installing the BBP Platform v16.5.0 on OS X 10.11.5 (El Capitan) == | === Installing the BBP Platform v16.5.0 on OS X 10.11.5 (El Capitan) == |
Revision as of 04:20, 25 May 2016
Contents
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 later version (Yosemite (OS X 10.10), El Capitan (OS X 10.11.0)) will need to follow some additional steps to make the installation work. There are several installation issues or limitations related to the BBP on a Mac.
The key Mac OS X-specific issues include:
- Mac must have a gcc compiler environment, and the Mac command line tools, obtained through the Xcode software distribution available through the Mac App store.
- Mac must have a gcc fortran compiler installed, which is not available in the Mac Xcode distribution. We recommend use of a gnu Mac binary distribution of gfortan.
- Mac must have a full Python installation that includes NumPy, SciPy, matplotlib and other packages. We recommend use of a free commercial Python distribution called Anaconda, that includes all these required python libraries.
- Mac must have specialized Python language geographic project module, called pyproj, installed. The required pyproj can be installed using anaconda package update tool.
- The current SDSU BBToolbox software is not compatible with the Mac environment. The code will crash and as a result the SDSU method will not be tested by the 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.
= Installing the BBP Platform v16.5.0 on OS X 10.11.5 (El Capitan)
This section describes the installation of the BBP 16.5.0 distribution on Mac OS X system. The following steps were tested on a Macbook Pro running Mac OS 10.11.5 (El Capitan).
The steps below will guide you through installation of the necessary C/Fortran GNU compilers in addition to the Python packages required by the Broadband Platform. At the end of this section, we provide information about running the Unit and Acceptance Tests available on the Broadband Platform, along with some Mac OS X-specific details.
The following steps will install the BBP v16.5.0 installation on a Mac running a new, default, installation of OS 10.11.5 (El Capitan). Some of these steps may not be required if you have already added compilers, or other libraries, to your Mac.
- Install Xcode from the Mac App Store.
- Install the Xcode command line tools.
- Install a gfortan compiler from the gnu site.
- Install a collection of python libraries using the Continuum anaconda distribution.
- Update a python library, called pyproj, using the condo install command.
- Install the Broadband Platform software and required libraries using the BBP easy install script.
- Update the .bash_profile in your user account
- Run the unit tests and acceptance tests to esure the platform is working properly on your Mac.
- Use the Broadband Platform for your research purposes.
Detailed instruction for Installatin BBP v16.50 on OS X 10.11.5 (El Capitan) Yosemite using Anaconda Python
In order to install the Broadband Platform on Yosemite, you must follow these steps:
- Install Xcode from the Mac App Store
- Install the Xcode command line tools. To do this, in your Terminal window, please type:
$ 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. - Accept Xcode license by typing:
$ sudo xcodebuild -license
Scroll to the end and then type 'agree'. - 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 make sure you select the package for OS X 10.10 Yosemite
- Install GCC 4.9 using the following command:
$ sudo port install gcc49 - Select the new compiler as the default compiler using the command:
$ sudo port select gcc mp-gcc49 - Install the PIP package manager for Python, using the command:
$ sudo easy_install pip - Install PyProj, using the command:
$ sudo pip install pyproj - Compile the Broadband Platform by going into the src directory and typing "make"
- Continue the Installation Instructions on Broadband User Guide v16.5.0
Running Unit Tests
In order to run the unit tests, users should go to the tests directory and type:
$ ./UnitTests.py
The tests should begin and will take between 30-60 minutes to run, depending on your computer speed. At the end of each test, a "ok" should be printed if the test was successful. At the end, the program will print the number of tests that passed and the number of tests that failed. If a test has failed, first check that you have built the executables.You can rerun just the specific test that failed (test_<module>.py). If the test is still failing, also verify that you have the ref_data directory, since it contains the input and reference files. If you're looking for more information about the failure, you can consult the Unit Tests log file in $BBP_DATA_DIR/logs/unit_tests.log . If you can't determine the reason for the failure, contact support.
Please note that one of the SDSU components, BBToolbox, does not pass its Unit Test when running on a Mac OS X system and will be skipped when tests are executed on a Mac. This is a known limitation of the current BBP release. This reduces the available number of ground motion methods that can be run on the Mac. On Linux, there are six methods available (GP, SDSU, UCSB, EXSIM, SONG, CSM). On a Mac, there are five methods available (GP, UCSB, EXSIM, SONG, CSM).
After running the unit tests, users can proceed to the acceptance tests below.
Running Acceptance Tests
To run the acceptance tests, users should:
$ ./AcceptTests.py
There will be one test for each method in the platform, for both the validation mode (historical events) and the scenario modes (hypotethical earthquakes). These tests will take somewhere between 2 and 3 hours to run, depending on how fast the computer is.
Since the acceptance tests can take a long time to run, you may wish to resume where you left off. This feature is supported automatically. If you do not wish to resume, delete the resume file in $BBP_DATA_DIR/logs/resume.txt. If there are any failure or errors while running the acceptance tests, consult the Troubleshooting section at the end of this user guide for known issues and their solutions.
When they're complete, the console will either print "OK" or how many tests failed. Acceptance test failures indicate that the modules are not integrated correctly. On Mac OS X, the SDSU codebase is not yet fully supported and will cause the 3 SDSU acceptance tests to fail. These tests will be automatically skipped by the Platform when Acceptance Tests are executed on a Mac OS X computer. For the other tests, if a certain acceptance test fails, you can get more information by consulting the acceptance test logs in $BBP_DATA_DIR/logs/acceptance_test_logs/<test that failed>.log. If you can't determine the reason for the failure, contact support.
Here's the expected output when running on a Mac OS X, showing the three SDSU tests failing (which is expected for this release):
-bash-4.1$ ./AcceptTests.py Number of tests to run: 11 test_user-CSM (__main__.BBP2G_Acceptance_Tests) ... ok test_user-EXSIM (__main__.BBP2G_Acceptance_Tests) ... ok test_user-GP (__main__.BBP2G_Acceptance_Tests) ... ok test_user-SONG (__main__.BBP2G_Acceptance_Tests) ... ok test_user-UCSB (__main__.BBP2G_Acceptance_Tests) ... ok test_valid-northridge-CSM (__main__.BBP2G_Acceptance_Tests) ... ok test_valid-northridge-EXSIM (__main__.BBP2G_Acceptance_Tests) ... ok test_valid-northridge-GP (__main__.BBP2G_Acceptance_Tests) ... ok test_valid-northridge-GP_seis (__main__.BBP2G_Acceptance_Tests) ... ok test_valid-northridge-SONG (__main__.BBP2G_Acceptance_Tests) ... ok test_valid-northridge-UCSB (__main__.BBP2G_Acceptance_Tests) ... ok
---------------------------------------------------------------------- Ran 11 tests in 3647.739s
Potential Additional Steps
One developer needed to run the following commands to make the Mac installation work. These are not needed on a clean installation but could be required to repair or upgrade an existing Mac OS X setup.
- export PYTHONPATH=/Library/Python/2.7/site-packages/:$PYTHONPATH
- sudo pip install scipy --upgrade
- sudo pip install numpy --upgrade
- sudo pip install matplotlib --upgrade