Installation notes

The easiest way to install the package is with

install.packages("diversitree")

which will get the most recent version from CRAN. However, this is sometimes out of date, as I don't put every version up there. In that case, you will probably have to install from source.

QuaSSE installation issues

QuaSSE requires that the fftw (Fastest Fourier Transforms in the West) libraries are installed. If you want to use QuaSSE, before installing diversitree, download and install fftw. If you install fftw in a different location than a "standard" location (i.e., somewhere that your C compiler will find headers and libraries automatically) you have to tell the compilers where it is:

R CMD INSTALL diversitree --configure-args='--with-fftw=/path/to/fftw'

where the path will be the path so that the files

/path/to/fftw/include/fftw3.h
/path/to/fftw/lib/lib/fftw3.so

exist. When installing, look for a line that says

Using fftw for QuaSSE FFT calculations

in the output. If you see

configure: WARNING: No fftw found - QuaSSE/fftC will not be available

then diversitree could not find the fftw libraries.

On Windows, set the environment variable LIB_FFTW to point to the directory that contains include/fftw.h, and install the package. Far less checking is done when installing on windows, due to limitations with the build system there. As I don't have a windows system at present, I cannot test this, and am only assured that it works. Alternatively, email me if the CRAN version is out of date, and I can arrange to have a binary package built for you.

mac os x 10.5 (leopard) and R 2.10.1

R 2.10.1 and Mac OS X 10.5 (leopard)'s default Xcode appear not to play well together and the installation will not work, failing with an error like

gcc-4.2 -arch i386 -std=gnu99 -I/Library/Frameworks/R.framework...
make: gcc-4.2: Command not found
make: *** [bisse-eqs.o] Error 127
ERROR: compilation failed for package ‘diversitree’

This type of error will occur for all R packages. To get around this, either install Xcode 3.1.4 (available with some hunting from http://connect.apple.com, which includes a more recent Xcode. This is a big download and you need to create a apple developer account.

Alternatively, you can work around the issue by changing the default compilers. Create a directory ~/.R and download this file. Don't forget to delete this file when you upgrade either R or OSX!

From within R

dir.create("~/.R", FALSE)
download.file("http://www.zoology.ubc.ca/prog/diversitree/Makevars",
              "~/.R/Makevars")