41 Mac OSX

These are specific notes for installing PEcAn on Mac OSX and will be referenced from the main installing PEcAn page. You will at least need to install the build environment and Postgres sections. If you want to access the database/PEcAn using a web browser you will need to install Apache. To access the database using the BETY interface, you will need to have Ruby installed.

This document also contains information on how to install the Rstudio server edition as well as any other packages that can be helpful.

41.1 Install build environment

# install R
# download from http://cran.r-project.org/bin/macosx/

# install gfortran 
# download from http://cran.r-project.org/bin/macosx/tools/

# install OpenMPI
curl -o openmpi-1.6.3.tar.gz http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.3.tar.gz
tar zxf openmpi-1.6.3.tar.gz
cd openmpi-1.6.3
./configure --prefix=/usr/local
make all
sudo make install
cd ..

# install szip
curl -o szip-2.1-MacOSX-intel.tar.gz ftp://ftp.hdfgroup.org/lib-external/szip/2.1/bin/szip-2.1-MacOSX-intel.tar.gz
tar zxf szip-2.1-MacOSX-intel.tar.gz
sudo mv szip-2.1-MacOSX-intel /usr/local/szip

# install HDF5

curl -o hdf5-1.8.11.tar.gz http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.11.tar.gz
tar zxf hdf5-1.8.11.tar.gz
cd hdf5-1.8.11
sed -i -e 's/-O3/-O0/g' config/gnu-flags 
./configure --prefix=/usr/local/hdf5 --enable-fortran --enable-cxx --with-szlib=/usr/local/szip
make
# make check
sudo make install
# sudo make check-install
cd ..

41.2 Install Postgres

For those on a Mac I use the following app for postgresql which has postgis already installed (http://postgresapp.com/)

To get postgis run the following commands in psql:

## Enable PostGIS (includes raster)
CREATE EXTENSION postgis;
## Enable Topology
CREATE EXTENSION postgis_topology;
## fuzzy matching needed for Tiger
CREATE EXTENSION fuzzystrmatch;
## Enable US Tiger Geocoder
CREATE EXTENSION postgis_tiger_geocoder;

To check your postgis run the following command again in psql: SELECT PostGIS_full_version();

41.3 Additional installs

41.3.2 Install udunits

Installing udunits-2 on MacOSX is done from source.

curl -o udunits-2.1.24.tar.gz ftp://ftp.unidata.ucar.edu/pub/udunits/udunits-2.1.24.tar.gz
tar zxf udunits-2.1.24.tar.gz
cd udunits-2.1.24
./configure
make
sudo make install

41.4 Apache Configuration

Mac does not support pdo/postgresql by default. The easiest way to install is use: http://php-osx.liip.ch/

To enable pecan to run from your webserver.

cat > /etc/apache2/others/pecan.conf << EOF
Alias /pecan ${PWD}/pecan/web
<Directory ${PWD}/pecan/web>
  DirectoryIndex index.php
  Options +All
  Require all granted
</Directory>
EOF

41.5 Ruby

The default version of ruby should work. Or use JewelryBox.

41.6 Rstudio Server

For the mac you can download Rstudio Desktop.