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 pullThe 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::documentto update the documentation for all package. Under the hood, this uses theroxygen2documentation 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::checkmake test– Run all unit tests (based ontestthatpackage) for all packages, usingdevtools::testmake 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. Runningmake cleanwill force the next invocation ofmakecommands 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/utilsormake .check/modules/rtmForce
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 whenjis greater than 1, because of limitations in the way R callsmakeinternally 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.