-
Notifications
You must be signed in to change notification settings - Fork 80
Development
Developers without write access to the adcomp repository can contribute with code or documentation by forking the project and sending a pull request once the code has been changed.
For developers with write access to the adcomp repository:
- The master branch should be stable and never get into a broken state. Therefore: Never push changes directly to the master branch. Development must be performed on a separate branch (named by e.g. developers name or the topic of change) which is pushed to the adcomp repository.
- When code is ready, send request to review and merge into the master branch.
- The following tests must be performed before changes can be merged (to ensure nothing is broken on any platforms):
-
cd tmb_examples;make clean;make
must pass. - The file REPORT.md must be inspected for inaccuracies and performance regressions.
-
runExample(all=TRUE)
must pass. - Above should be tested with both gcc and clang on linux.
- Tests should also be run on Windows and OSX.
-
Conventions
- Text files should have Unix line endings. Check with
file
command from command line that output looks like e.g.sdv_multi.cpp: ASCII C program text
withoutCR+LF
. - Text files should not be executable.
Describe the branches you work on here...
Probably the easiest way to distribute TMB code is to use R's package functionality. You can get a test package working following these steps:
-
package.skeleton("mypkg")
-
Copy model.cpp to mypkg/src
-
Add
Depends: TMB
LinkingTo: TMB
to file mypkg/DESCRIPTION to ensure that TMB is loaded when mypkg is loaded, and that the TMB source code is found when compiling mypkg. -
Create a file mypkg/R/zzz.R with
.onLoad <- function(lib, pkg) {
cat("Loading compiled code...\n")
library.dynam("mypkg", pkg, lib)
}
to ensure that the compiled code is loaded when you load the package. -
Pass DLL="mypkg" to all 'MakeADFun' calls.