8.1 Updating PEcAn Code and Bety Database
Release notes for all releases can be found here.
This page will only list any steps you have to do to upgrade an existing system. When updating PEcAn it is highly encouraged to update BETY. You can find instructions on how to do this, as well on how to update the database in the Updating BETYdb gitbook page.
8.1.1 Updating PEcAn
The latest version of PEcAn code can be obtained from the PEcAn repository on GitHub:
cd pecan # If you are not already in the PEcAn directory
git pull
The PEcAn build system is based on GNU Make.
The simplest way to install is to run make
from inside the PEcAn directory.
This will update the documentation for all packages and install them, as well as all required dependencies.
For more control, the following make
commands are available:
make document
– Usedevtools::document
to update the documentation for all package. Under the hood, this uses theroxygen2
documentation system.make install
– Install all packages and their dependnencies usingdevtools::install
. By default, this only installs packages that have had their code changed and any dependent packages.make check
– Perform a rigorous check of packages usingdevtools::check
make test
– Run all unit tests (based ontestthat
package) for all packages, usingdevtools::test
make clean
– Remove the make build cache, which is used to track which packages have changed. Cache files are stored in the.doc
,.install
,.check
, and.test
subdirectories in the PEcAn main directory. Runningmake clean
will force the next invocation ofmake
commands to operate on all PEcAn packages, regardless of changes.
The following are some additional make
tricks that may be useful:
Install, check, document, or test a specific package –
make .<cmd>/<pkg-dir>
; e.g.make .install/utils
ormake .check/modules/rtm
Force
make
to run, even if package has not changed –make -B <command>
Run
make
commands in parallel –make -j<ncores>
; e.g.make -j4 install
to install packages using four parallel processes. Note that packages containing compiled code (e.g. PEcAn.RTM, PEcAn.BASGRA) might fail whenj
is greater than 1, because of limitations in the way R callsmake
internally while compiling them. See GitHub issue 1976 for more details.
All instructions for the make
build system are contained in the Makefile
in the PEcAn root directory.
For full documentation on make
, see the man pages by running man make
from a terminal.