Clone this wiki locally
PEER depends on a small number of freely downloadable pieces of software.
For R package
For Python package
For full source package installation
Installing of PEER for usage with R from a source package
For R users this is likely to be the preferred option. We have prepared a public source release of PEER for R. Compilation is natively handled by R and should work without problems for most users. PEER will soon also be available via CRAN.
To install the PEER R package using one of the above binary packages, simply download the source package for the correct platform, for instance R_peer_source_1.3.tgz, then run
R CMD INSTALL R_peer_source_1.3.tgz.
In some cases it may be helpful to include the switch "--no-multiarch" (see Troubleshooting section below).
Building PEER from scratch
PEER is built using the CMake build system. A full build of PEER provides access to the python binding, standalone tool and R interface. To build and install PEER from source, first pull it from our git source code repository:
git clone email@example.com:PMBio/peer.git
Alternatively, there are versioned source packages of PEER available for download:
Then create a target directory for the build:
Then go to the build directory and call CMake
Finally, compile and install PEER
Building the R package from the cloned repository
Although we do not recommend this, PEER can also be built form the cloned full repository.
You need to pass an additional argument to CMake:
-DBUILD_R_PACKAGE=1. The full sequence of build commands needed is then as follows:
cmake -DBUILD_R_PACKAGE=1 ./..
NOTE! You need SWIG 2.0 or later to build the R package. Building will fail with earlier SWIG versions. At the time of writing SWIG 1.x is still the one made available by default on many Linux distributions, so be sure to check the version.
Building peer on OS X
By default, peer is not built as an universal binary on OS X. This can be easily changed by adding the following configuration parameter to CMake:
-DBUILD_UNIVERSAL=1. This will cause peer to be built as an Intel 32/64 bit binary. For more control over the included architectures, edit the file CMakeLists.txt in the root directory of the project.
Troubleshooting and further details
- Installing peer binaries. If
makeis called with the
installflag, the standard behaviour is to install a peer binary and the peer C++ library to the system-wide targets. Use
cmake ./.. -DCMAKE_INSTALL_PREFIX=~/my_software/peeror equivalent to specify your own build target.
- Python module. The python module is not affected by
CMAKE_INSTALL_PREFIX. Instead, cmake tries to build the python module and installs it using the python version which is in the path when using the command
python. You can specify your own python binary by editing
CMakeLists.txt. The python interface requires a recent numpy version.
- R module. If you receive the error
build/R/peerR_wrap.cxx: In function ‘RCallbackFunctionData* R_SWIG_pushCallbackFunctionData(SEXPREC*, SEXPREC*)’:
build/R/peerR_wrap.cxx:759: error: ‘calloc’ was not declared in this scope
build/R/peerR_wrap.cxx: In function ‘void R_SWIG_popCallbackFunctionData(int)’:
build/R/peerR_wrap.cxx:800: error: ‘free’ was not declared in this scope
check that you have an up-to-date version of Swig (at least 2.0 is required).
- Prebuilt R package. If your receive the error
Eigen/src/Core/arch/AltiVec/Complex.h: In function ‘Packet Eigen::ei_pset1(const typename Eigen::ei_unpacket_traits<T>::type&) [with Packet = Eigen::Packet2cf]’:
Eigen/src/Core/arch/AltiVec/Complex.h:71: error: no matching function for call to ‘ei_pload(const float*)’
make: *** [array_helper.o] Error 1
ERROR: compilation failed for package ‘peer’
R CMD INSTALL command with "--no-multiarch" flag.