Difference between revisions of "Building on MacOSX"
(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 ...") |
m (Perk moved page Building Example MacOSX to Building on MacOSX) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | This particular system is an older MacBook Pro with Mac OS X 10.6.8 (Snow Leopard). 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 6: | ||
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 | + | 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 14: | ||
[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-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 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 | + | 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 43: | ||
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 75: | ||
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 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 |
− | make test | + | make test |
− |
Latest revision as of 18:28, 31 October 2013
This particular system is an older MacBook Pro with Mac OS X 10.6.8 (Snow Leopard). 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