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:
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 help– shows all available make options.
- make document– Use- devtools::documentto update the documentation for all package. Under the hood, this uses the- roxygen2documentation system.
- make install– Install all packages and their dependnencies using- devtools::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 using- devtools::check
- make test– Run all unit tests (based on- testthatpackage) for all packages, using- devtools::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- .testsubdirectories in the PEcAn main directory. Running- make cleanwill force the next invocation of- makecommands 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/utilsor- make .check/modules/rtm
- Force - maketo run, even if package has not changed –- make -B <command>
- Run - makecommands in parallel –- make -j<ncores>; e.g.- make -j4 installto install packages using four parallel processes. Note that packages containing compiled code (e.g. PEcAn.RTM, PEcAn.BASGRA) might fail when- jis greater than 1, because of limitations in the way R calls- makeinternally 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.