Difference between revisions of "Building on MacOSX"

From GridPACK
Jump to: navigation, search
(Created page with "= Building GridPACK on Mac OS X 10.8 (Snow Leopard) = This particular system is an older !MacBook Pro. Some of the [wiki:Building/Prerequisites prerequisite software] was ...")
 
Line 1: Line 1:
 
= Building GridPACK on Mac OS X 10.8 (Snow Leopard) =
 
= Building GridPACK on Mac OS X 10.8 (Snow Leopard) =
  
This particular system is an older !MacBook Pro.  Some of the [wiki:Building/Prerequisites  prerequisite software] was installed on this system using [http://www.macports.org/ MacPorts], which is reasonably convenient. The following ports were installed:
+
This particular system is an older MacBook Pro.  Some of the [[Software Required to Build GridPACK|prerequisite software]] was installed on this system using [http://www.macports.org/ MacPorts], which is reasonably convenient. The following ports were installed:
{{{
+
 
 
   cmake @2.8.10.2_0 (active)
 
   cmake @2.8.10.2_0 (active)
 
   openmpi @1.7.1_0+gcc47 (active)
 
   openmpi @1.7.1_0+gcc47 (active)
Line 8: Line 8:
 
   doxygen @1.8.3.1_0 (active)
 
   doxygen @1.8.3.1_0 (active)
 
   graphviz @2.30.1_0+pangocairo+x11 (active)
 
   graphviz @2.30.1_0+pangocairo+x11 (active)
}}}
+
 
Note that the {{{openmpi}}} [http://www.boost.org/ Boost] variant was installed.  This is important.  Doxygen and Graphviz are optional.   
+
Note that the <code>openmpi</code> [http://www.boost.org/ 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.   
 
It's possible to use the MPI implementation that is standard in MacOS, but that was not done on this particular system.   
Line 16: Line 16:
  
 
[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:
{{{
+
 
setenv PETSC_DIR /Users/d3g096/ProjectStuff/petsc-3.4.0
+
  setenv PETSC_DIR /Users/d3g096/ProjectStuff/petsc-3.4.0
unsetenv PETSC_ARCH  
+
  unsetenv PETSC_ARCH  
python ./config/configure.py \
+
  python ./config/configure.py \
    --with-mpi=1 \
+
      --with-mpi=1 \
    --with-cc=openmpicc \
+
      --with-cc=openmpicc \
    --with-fc=openmpif90 \
+
      --with-fc=openmpif90 \
    --with-cxx=openmpicxx \
+
      --with-cxx=openmpicxx \
    --with-c++-support=1 \
+
      --with-c++-support=1 \
    --with-c-support=0 \
+
      --with-c-support=0 \
    --with-fortran=0 \
+
      --with-fortran=0 \
    --with-scalar-type=complex \
+
      --with-scalar-type=complex \
    --download-f2cblaslapack=1 \
+
      --download-f2cblaslapack=1 \
    --with-clanguage=c++ \
+
      --with-clanguage=c++ \
    --with-shared-libraries=0 \
+
      --with-shared-libraries=0 \
    --with-dynamic-loading=0 \
+
      --with-dynamic-loading=0 \
    --with-x=0 \
+
      --with-x=0 \
    --with-mpirun=openmpirun \
+
      --with-mpirun=openmpirun \
    --with-mpiexec=openmpiexec \
+
      --with-mpiexec=openmpiexec \
    --with-debugging=0
+
      --with-debugging=0
make all
+
  make all
make test
+
  make test
}}}
+
 
Note that the OpenMPI compilers were used, consistent with the [http://www.boost.org/ Boost] installation.  The configuration decided that {{{PETSC_ARCH}}} should be {{{arch-darwin-cxx-opt}}}.
+
Note that the OpenMPI compilers were used, consistent with the [http://www.boost.org/ Boost] installation.  The configuration decided that <code>PETSC_ARCH</code> should be <code>arch-darwin-cxx-opt</code>.
  
 
== Building ParMETIS ==
 
== Building ParMETIS ==
Line 45: Line 45:
  
 
In order to get ParMETIS 4.0 to compile with older GNU compilers, a warning option needs to be removed from on of the build system files.  In the top ParMETIS source directory, execute the following command:
 
In order to get ParMETIS 4.0 to compile with older GNU compilers, a warning option needs to be removed from on of the build system files.  In the top ParMETIS source directory, execute the following command:
{{{
+
 
sed -i.org -e 's/-Wno-unused-but-set-variable//g' metis/GKlib/GKlibSystem.cmake
+
  sed -i.org -e 's/-Wno-unused-but-set-variable//g' metis/GKlib/GKlibSystem.cmake
}}}
+
 
 
Starting in the ParMETIS source directory, build and install METIS first:
 
Starting in the ParMETIS source directory, build and install METIS first:
{{{
+
 
set prefix=/Users/d3g096/ProjectStuff/GridPack/software
+
  set prefix=/Users/d3g096/ProjectStuff/GridPack/software
cd metis
+
  cd metis
make config prefix="$prefix"
+
  make config prefix="$prefix"
make
+
  make
make install
+
  make install
}}}
+
 
 
then build and install ParMETIS:
 
then build and install ParMETIS:
{{{
+
 
cd ..
+
  cd ..
make config cc=openmpicc cxx=openmpicxx prefix="$prefix"
+
  make config cc=openmpicc cxx=openmpicxx prefix="$prefix"
make  
+
  make  
make install
+
  make install
}}}
+
 
 
Do some tests to make sure it works:
 
Do some tests to make sure it works:
{{{
+
 
cd Graphs
+
  cd Graphs
openmpirun -np 2 $prefix/bin/ptest rotor.graph rotor.graph.xyz
+
  openmpirun -np 2 $prefix/bin/ptest rotor.graph rotor.graph.xyz
openmpirun -np 2 $prefix/bin/ptest rotor.graph
+
  openmpirun -np 2 $prefix/bin/ptest rotor.graph
openmpirun -np 2 $prefix/bin/ptest bricks.hex3d
+
  openmpirun -np 2 $prefix/bin/ptest bricks.hex3d
}}}
+
 
 
The last one seemed to hang.
 
The last one seemed to hang.
 
  
 
== Building and Testing GridPACK ==
 
== Building and Testing GridPACK ==
Line 78: Line 77:
  
 
GridPACK was configured and built as follows:  
 
GridPACK was configured and built as follows:  
{{{
+
 
cd /path/to/gridpack/trunk/src
+
  cd /path/to/gridpack/trunk/src
mkdir build
+
  mkdir build
cd build
+
  cd build
cmake -Wno-dev \
+
  cmake -Wno-dev \
    -D Boost_DIR:STRING='/opt/local' \
+
      -D Boost_DIR:STRING='/opt/local' \
    -D PETSC_DIR:STRING='/Users/d3g096/ProjectStuff/petsc-3.4.0' \
+
      -D PETSC_DIR:STRING='/Users/d3g096/ProjectStuff/petsc-3.4.0' \
    -D PETSC_ARCH:STRING='arch-darwin-cxx-opt' \
+
      -D PETSC_ARCH:STRING='arch-darwin-cxx-opt' \
    -D MPI_CXX_COMPILER:STRING='openmpicxx' \
+
      -D MPI_CXX_COMPILER:STRING='openmpicxx' \
    -D MPI_C_COMPILER:STRING='openmpicc' \
+
      -D MPI_C_COMPILER:STRING='openmpicc' \
    -D MPIEXEC:STRING='openmpiexec' \
+
      -D MPIEXEC:STRING='openmpiexec' \
    -D CMAKE_BUILD_TYPE:STRING="Debug" \
+
      -D CMAKE_BUILD_TYPE:STRING="Debug" \
    -D CMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
+
      -D CMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
    ..
+
      ..
make
+
  make
make test
+
  make test
}}}
 

Revision as of 18:06, 31 October 2013

Building GridPACK on Mac OS X 10.8 (Snow Leopard)

This particular system is an older MacBook Pro. Some of the prerequisite software was installed on this system using MacPorts, which is reasonably convenient. 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:

 setenv PETSC_DIR /Users/d3g096/ProjectStuff/petsc-3.4.0
 unsetenv PETSC_ARCH 
 python ./config/configure.py \
     --with-mpi=1 \
     --with-cc=openmpicc \
     --with-fc=openmpif90 \
     --with-cxx=openmpicxx \
     --with-c++-support=1 \
     --with-c-support=0 \
     --with-fortran=0 \
     --with-scalar-type=complex \
     --download-f2cblaslapack=1 \
     --with-clanguage=c++ \
     --with-shared-libraries=0 \
     --with-dynamic-loading=0 \
     --with-x=0 \
     --with-mpirun=openmpirun \
     --with-mpiexec=openmpiexec \
     --with-debugging=0
 make all
 make test

Note that the OpenMPI compilers were used, consistent with the Boost installation. The configuration decided that PETSC_ARCH should be arch-darwin-cxx-opt.

Building ParMETIS

In order to get ParMETIS 4.0 to compile with older GNU compilers, a warning option needs to be removed from on of the build system files. In the top ParMETIS source directory, execute the following command:

 sed -i.org -e 's/-Wno-unused-but-set-variable//g' metis/GKlib/GKlibSystem.cmake

Starting in the ParMETIS source directory, build and install METIS first:

 set prefix=/Users/d3g096/ProjectStuff/GridPack/software
 cd metis
 make config prefix="$prefix"
 make
 make install

then build and install ParMETIS:

 cd ..
 make config cc=openmpicc cxx=openmpicxx prefix="$prefix"
 make 
 make install

Do some tests to make sure it works:

 cd Graphs
 openmpirun -np 2 $prefix/bin/ptest rotor.graph rotor.graph.xyz
 openmpirun -np 2 $prefix/bin/ptest rotor.graph
 openmpirun -np 2 $prefix/bin/ptest bricks.hex3d

The last one seemed to hang.

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.

GridPACK was configured and built as follows:

 cd /path/to/gridpack/trunk/src
 mkdir build
 cd build
 cmake -Wno-dev \
     -D Boost_DIR:STRING='/opt/local' \
     -D PETSC_DIR:STRING='/Users/d3g096/ProjectStuff/petsc-3.4.0' \
     -D PETSC_ARCH:STRING='arch-darwin-cxx-opt' \
     -D MPI_CXX_COMPILER:STRING='openmpicxx' \
     -D MPI_C_COMPILER:STRING='openmpicc' \
     -D MPIEXEC:STRING='openmpiexec' \
     -D CMAKE_BUILD_TYPE:STRING="Debug" \
     -D CMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
     ..
 make
 make test