Difference between revisions of "Building on Mac Yosemite"
(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...") |
(s) |
||
Line 6: | Line 6: | ||
Mac system do not have a compiler out of the box. To get the stock Apple compiler set ([https://en.wikipedia.org/wiki/LLVM LLVM]), XTools must be installed. [https://guide.macports.org/#installing.xcode Here] is a good guide. | Mac system do not have a compiler out of the box. To get the stock Apple compiler set ([https://en.wikipedia.org/wiki/LLVM LLVM]), XTools must be installed. [https://guide.macports.org/#installing.xcode 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: <code>libc++</code> (the one Apple wants to support), and <code>libstdc++</code> (that will be phased out). The stock LLVM C++ compiler will use <code>libc++</code>. GNU compilers, if installed, will use <code>libstdc++</code>. 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. | + | 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: <code>libc++</code> (the one Apple wants to support), and <code>libstdc++</code> (that will be phased out). The stock LLVM C++ compiler will use <code>libc++</code>. GNU compilers, if installed, will use <code>libstdc++</code>. 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. This gets complicated. The best thing to do is just use the same compilers to build GridPACK and any prerequisites. |
− | In addition, there were some other problems | + | In addition, there were some other problems had 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). | * 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. | * 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. | ||
Line 17: | Line 17: | ||
The CLang compiler set and some of the [[Software Required to Build GridPACK|prerequisite software]] was installed on this system using [http://www.macports.org/ MacPorts]. Several necessary packages were installed by | The CLang compiler set and some of the [[Software Required to Build GridPACK|prerequisite software]] was installed on this system using [http://www.macports.org/ MacPorts]. Several necessary packages were installed by | ||
− | |||
sudo port install boost boost @1.59.0_2+clang38+no_single-no_static+openmpi+python27 | 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 | + | This will install the CLang compiler set and OpenMPI. It's a good idea to install the select packages for CLang and MPI and make sure the right versions are "selected": |
+ | sudo port install mpi_select clang_select | ||
+ | sudo port select --set mpi openmpi-clang38-fortran | ||
+ | sudo port select --set clang mp-clang-3.8 | ||
− | |||
The following ports were installed: | The following ports were installed: | ||
+ | |||
+ | cmake @3.7.2_0+docs+gui+python27+qt4 (active) | ||
+ | boost @1.59.0_2+clang38+no_single+openmpi+python27 (active) | ||
+ | parmetis @4.0.3_3+openmpi (active) | ||
+ | petsc @3.7.4_0+accelerate+hwloc+openmpi+parmetis+suitesparse (active) | ||
+ | superlu_dist @5.1.0_0+openmpi (active) | ||
cmake @2.8.10.2_0 (active) | cmake @2.8.10.2_0 (active) | ||
Line 39: | Line 46: | ||
[http://www.mcs.anl.gov/petsc/index.html PETSc] version 3.4.0 was configured and built as follows: | [http://www.mcs.anl.gov/petsc/index.html PETSc] version 3.4.0 was configured and built as follows: | ||
+ | == Building Global Arrays == | ||
== Building and Testing GridPACK == | == Building and Testing GridPACK == | ||
[http://www.cmake.org/ 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 [http://www.cmake.org/ CMake] project is {{{.../src}}}. Make a subdirectory there called {{{build}}} or something. Configure and build GridPACK in that directory. | [http://www.cmake.org/ 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 [http://www.cmake.org/ CMake] project is {{{.../src}}}. Make a subdirectory there called {{{build}}} or something. Configure and build GridPACK in that directory. |
Revision as of 22:45, 9 February 2017
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
Contents
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. This gets complicated. The best thing to do is just use the same compilers to build GridPACK and any prerequisites.
In addition, there were some other problems had 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 the select packages for CLang and MPI and make sure the right versions are "selected":
sudo port install mpi_select clang_select sudo port select --set mpi openmpi-clang38-fortran sudo port select --set clang mp-clang-3.8
The following ports were installed:
cmake @3.7.2_0+docs+gui+python27+qt4 (active) boost @1.59.0_2+clang38+no_single+openmpi+python27 (active) parmetis @4.0.3_3+openmpi (active) petsc @3.7.4_0+accelerate+hwloc+openmpi+parmetis+suitesparse (active) superlu_dist @5.1.0_0+openmpi (active)
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 Global Arrays
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.