Building on Mac Yosemite

From GridPACK
Revision as of 22:09, 9 February 2017 by Wperkins (talk | contribs) (Created page with "This system is a relatively new Mac Pro with Mac OS X 10.10 (Yosemite). The previous instructions for Mac OS X are really not helpful anymore due to c...")

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

This system is a relatively new Mac Pro with Mac OS X 10.10 (Yosemite). The previous instructions for Mac OS X are really not helpful anymore due to changes in


Compiler Set

Mac system do not have a compiler out of the box. To get the stock Apple compiler set (LLVM), XTools must be installed. Here is a good guide.

Care must be taken to use a consistent compiler set when building GridPACK. GridPACK is a C++ code. Mac OS X provides two standard C++ libraries on modern systems: libc++ (the one Apple wants to support), and libstdc++ (that will be phased out). The stock LLVM C++ compiler will use libc++. GNU compilers, if installed, will use libstdc++. If C++ objects from GNU compilers are mixed with the system compiler, they will not link together, because of conflicting and/or missing symbols from the standard library.

In addition, there were some other problems uncovered while getting this to work:

  • Boost.MPI compiled with the stock LLVM compiler seemed to have trouble with serialization needed in the GridPACK code. This may or may not be a real issue. After the trouble was encountered, the CLang compilers were chosen and used there after. (NOTE: Boost does not report Boost.MPI unit test results for LLVM or CLang compilers on any platform).
  • Global Arrays 5.5 does not appear to work with LLVM or CLang, but the SVN trunk version does. Neither version worked as shared libraries, so GA must be built static.

After a couple of aborted starts with the LLVM compiler, CLang 3.8 (installed with MacPorts) was chosen, and, after some effort, it built GridPACK. GNU C++ should be avoid.

MacPorts

The CLang compiler set and some of the prerequisite software was installed on this system using MacPorts. Several necessary packages were installed by

   sudo port install boost boost @1.59.0_2+clang38+no_single-no_static+openmpi+python27

This will install the CLang compiler set and OpenMPI. It's a good idea to install

To install the CLang compiler The following ports were installed:

 cmake @2.8.10.2_0 (active)
 openmpi @1.7.1_0+gcc47 (active)
 boost @1.53.0_1+no_single+no_static+openmpi+python27 (active)
 doxygen @1.8.3.1_0 (active)
 graphviz @2.30.1_0+pangocairo+x11 (active)

Note that the openmpi Boost variant was installed. This is important. Doxygen and Graphviz are optional.

It's possible to use the MPI implementation that is standard in MacOS, but that was not done on this particular system.

Building PETSc

PETSc version 3.4.0 was configured and built as follows:


Building and Testing GridPACK

CMake projects are designed to be built outside of the source code location. If the entire GridPACK {{{trunk}}} repository is checked out, the top of the the CMake project is {{{.../src}}}. Make a subdirectory there called {{{build}}} or something. Configure and build GridPACK in that directory.