Created attachment 163100 [details] patch to update math/jags to 4.0.0 Update for math/jags from 3.0.4 to 4.0.0, because math/R's package 'rjags' [1] needs mcmc-jags version 4.x.x. R's package rjags seems to work only, if math/jags was build via gcc instead of clang. [1] http://ftp5.gwdg.de/pub/misc/cran/web/packages/rjags/index.html Probably this PR is not ready, some issues seems to be left: portlint -AC complains about WARN: Makefile: [58]: IGNORE messages should begin with a lowercase letter and end without a period. WARN: Makefile: [88]: possible direct use of command "install" found. use ${INSTALL_foobaa} instead. WARN: Makefile: "DIST_SUBDIR" has to appear earlier. I was not able to test via poudriere, because there are problems ATM with building poudriere jails itself(?) On my box (recent HEAD) rjags-4.4 works just fine with math/jags (4.0.0).
Test-builds on 11-amd64, 10.2a+i, 9.3a all fine.
Rainer: Does the new version pass the regression tests?
Sorry, I did not try any regression tests. This port update was originally prepared only for personal usage. I filed a bug report, because there was some need for the update by other R users.
How should the regression test work ? make test says: ===> Testing for mcmc-jags-4.0.0 but probably does not execute anything. make check says make: don't know how to make check. Stop which is probably a bug in the port.
If you look at the Makefile, you'll see that the tests are exposed through the usual target, but only if MAINTAINER_MODE is set. This was because the additional ports required to run the tests added substantially to the build time, and the tests were somewhat longer and more computationally intensive than usual, so it was not thought to be desirable to run them routinely when building and packaging the port. If the tests show no further regressions than in the previous version, then we can go ahead with the update.
I ran the test, results (work/classic-bugs/vol[12]/*/check.log can be found at http://people.freebsd.org/~pi/logs/jags-checks.tgz. The check results look OK, but I have not baseline to compare against.
I must start by saying, that I am by no means an expert in testing for JAGS-4.0.0. What I tried is the following: (1) The tests in classic-bugs/R can't be run on FreeBSD, because there is no port for openBugs [1] and therefore the R package 'coda' is not able to run the testfiles 'Rcheck.R', 'bench.R' and 'check.R' :( (2) The tests in classic-bugs/vol1 and classic-bugs/vol2 are used by the ports 'check' and 'test' targets and are also R files. Some of them like mice.R and lsat.R have relatively long run times, be prepared ;) # cd math/jags # env MAINTAINER_MODE=1 make clean && make check After passing all check in vol1, it stops in vol2 with: [..snip..] gmake[1]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2“ wird betreten gmake -f /usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/Makefile.sub -C asia check gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/asia“ wird betreten gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/asia“ wird verlassen gmake -f /usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/Makefile.sub -C biops check gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/biops“ wird betreten gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/biops“ wird verlassen gmake -f /usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/Makefile.sub -C eyes check gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/eyes“ wird betreten gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/eyes“ wird verlassen gmake -f /usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/Makefile.sub -C stagnant check gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/stagnant“ wird betreten gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/stagnant“ wird verlassen gmake -f /usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/Makefile.sub -C pigs check gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/pigs“ wird betreten gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/pigs“ wird verlassen gmake -f /usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/Makefile.sub -C alli check gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/alli“ wird betreten gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/alli“ wird verlassen gmake -f /usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/Makefile.sub -C beetles check gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/beetles“ wird betreten gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/beetles“ wird verlassen gmake -f /usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/Makefile.sub -C birats check gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/birats“ wird betreten gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/birats“ wird verlassen gmake -f /usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/Makefile.sub -C dugongs check gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/dugongs“ wird betreten gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/dugongs“ wird verlassen gmake -f /usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/Makefile.sub -C hearts check gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/hearts“ wird betreten gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/hearts“ wird verlassen gmake -f /usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/Makefile.sub -C jaw check gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/jaw“ wird betreten /usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/Makefile.sub:16: die Regel für Ziel „check.OK“ scheiterte gmake[2]: *** [check.OK] Fehler 1 gmake[2]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2/jaw“ wird verlassen Makefile:38: die Regel für Ziel „check_jaw“ scheiterte gmake[1]: *** [check_jaw] Fehler 2 gmake[1]: Verzeichnis „/usr/ports/math/jags_4.0.0/work/classic-bugs/vol2“ wird verlassen *** Error code 2 # cat classic-bugs/vol2/jaw/check.log Welcome to JAGS 4.0.0 on Tue Dec 15 13:43:48 2015 JAGS is free software and comes with ABSOLUTELY NO WARRANTY Loading module: basemod: ok Loading module: bugs: ok Reading data file jaw-data.R Compiling model graph Declaring variables Resolving undeclared variables Allocating nodes Graph information: Observed stochastic nodes: 20 Unobserved stochastic nodes: 2 Total graph size: 489 WARNING: Unused variable(s) in data table: M N PI R Reading parameter file jaw-inits.R WARNING: Unused variable(s) in initial value table: beta1 beta2 Initializing model Loading module: dic: ok Updating 1000 Updating 10000 RSS Sigma2[1,1] Sigma2[1,2] Sigma2[1,3] Sigma2[1,4] 2.396402e-02 -2.928866e-02 -1.663315e-02 2.515903e-04 1.523224e-02 Sigma2[2,1] Sigma2[2,2] Sigma2[2,3] Sigma2[2,4] Sigma2[3,1] -1.663315e-02 4.080697e-03 2.018653e-02 3.115605e-02 2.515903e-04 Sigma2[3,2] Sigma2[3,3] Sigma2[3,4] Sigma2[4,1] Sigma2[4,2] 2.018653e-02 3.145759e-02 3.779318e-02 1.523224e-02 3.115605e-02 Sigma2[4,3] Sigma2[4,4] beta0 deviance mu[1] 3.779318e-02 4.139589e-02 -5.504964e-02 -3.284618e+01 -5.504964e-02 mu[2] mu[3] mu[4] -5.504964e-02 -5.504964e-02 -5.504964e-02 # ll classic-bugs/vol2/jaw/ total 6468 -rw-r--r-- 1 root wheel - 3218458 2015-12-15 13:43:51 CODAchain1.txt -rw-r--r-- 1 root wheel - 3218916 2015-12-15 13:43:51 CODAchain2.txt -rw-r--r-- 1 root wheel - 534 2015-12-15 13:43:51 CODAindex.txt -r--r--r-- 2 root wheel - 361 2012-10-02 10:39:13 ReadMe -r--r--r-- 2 root wheel - 2209 2012-10-02 10:39:13 bench-test1.R -r--r--r-- 2 root wheel - 2280 2012-10-02 10:39:13 bench-test2.R -r--r--r-- 2 root wheel - 2534 2012-10-02 10:39:13 bench-test3.R -rw-r--r-- 1 root wheel - 1283 2015-12-15 13:43:53 check.log -r--r--r-- 2 root wheel - 1103 2012-10-02 10:39:13 jaw-constant.bug -r--r--r-- 2 root wheel - 669 2012-10-02 10:39:13 jaw-data.R -r--r--r-- 2 root wheel - 40 2012-10-02 10:39:13 jaw-inits.R -r--r--r-- 2 root wheel - 1148 2012-10-02 10:39:13 jaw-linear.bug -r--r--r-- 2 root wheel - 1449 2012-10-02 10:39:13 jaw-quadratic.bug -r--r--r-- 2 root wheel - 334 2012-10-02 10:39:13 test1.R -r--r--r-- 2 root wheel - 220 2012-10-02 10:39:13 test1.cmd -r--r--r-- 2 root wheel - 364 2012-10-02 10:39:13 test2.R -r--r--r-- 2 root wheel - 242 2012-10-02 10:39:13 test2.cmd -r--r--r-- 2 root wheel - 406 2012-10-02 10:39:13 test3.R -r--r--r-- 2 root wheel - 297 2012-10-02 10:39:13 test3.cmd For 'jaw' there are some 'bug' files after doing 'make check'. (3) Now I tried some of the scripts under classic-bugs/vol1 and classic-bugs/vol2 manually with math/R and the results also seem to be OK: # classic-bugs/vol1/blocker/ source("test1.R") Linked to JAGS 4.0.0 Loaded modules: basemod,bugs module glm loaded Compiling model graph Resolving undeclared variables Allocating nodes Graph information: Observed stochastic nodes: 44 Unobserved stochastic nodes: 47 Total graph size: 254 Initializing model |**************************************************| 100% |**************************************************| 100% d delta.new sigma -0.01699355 -0.01508857 0.03897818 OK -------------------------------------------------------------- # classic-bugs/vol1/mice/ > source("test1.R") Linked to JAGS 4.0.0 Loaded modules: basemod,bugs Compiling model graph Resolving undeclared variables Allocating nodes Graph information: Observed stochastic nodes: 145 Unobserved stochastic nodes: 20 Total graph size: 378 Initializing model |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% |**************************************************| 100% |**************************************************| 100% median[1] median[2] median[3] median[4] pos.control r test.sub 0.0075066561 0.0130759296 0.0093696563 -0.0075586499 0.0101213858 -0.0113515351 0.0004222209 veh.control -0.0006917838 OK -------------------------------------------------------------- # classic-bugs/vol2/jaw/ # source("test1.R") Linked to JAGS 4.0.0 Loaded modules: basemod,bugs Compiling model graph Declaring variables Resolving undeclared variables Allocating nodes Graph information: Observed stochastic nodes: 20 Unobserved stochastic nodes: 2 Total graph size: 488 Initializing model |**************************************************| 100% module dic loaded |**************************************************| 100% RSS Sigma2[1,1] Sigma2[1,2] Sigma2[1,3] Sigma2[1,4] Sigma2[2,1] Sigma2[2,2] 0.014023246 -0.007194289 -0.001338308 0.009010493 0.015168971 -0.001338308 0.008884476 Sigma2[2,3] Sigma2[2,4] Sigma2[3,1] Sigma2[3,2] Sigma2[3,3] Sigma2[3,4] Sigma2[4,1] 0.017006646 0.021976400 0.009010493 0.017006646 0.019372190 0.022021199 0.015168971 Sigma2[4,2] Sigma2[4,3] Sigma2[4,4] beta0 deviance mu[1] mu[2] 0.021976400 0.022021199 0.023506897 -0.020985343 -32.838524293 -0.020985343 -0.020985343 mu[3] mu[4] -0.020985343 -0.020985343 Fehler in check.fun() : FAIL Zusätzlich: Warnmeldungen: 1: In jags.model("jaw-constant.bug", data, inits, n.chains = 2) : Unused variable "PI" in data 2: In jags.model("jaw-constant.bug", data, inits, n.chains = 2) : Unused initial value for "beta1" in chain 1 3: In jags.model("jaw-constant.bug", data, inits, n.chains = 2) : Unused initial value for "beta2" in chain 1 4: In jags.model("jaw-constant.bug", data, inits, n.chains = 2) : Unused initial value for "beta1" in chain 2 5: In jags.model("jaw-constant.bug", data, inits, n.chains = 2) : Unused initial value for "beta2" in chain 2 -------------------------------------------------------------- # classic-bugs/vol2/jaw/ # source("test2.R") Compiling model graph Declaring variables Resolving undeclared variables Allocating nodes Graph information: Observed stochastic nodes: 20 Unobserved stochastic nodes: 3 Total graph size: 543 Initializing model |**************************************************| 100% |**************************************************| 100% RSS Sigma2[1,1] Sigma2[1,2] Sigma2[1,3] Sigma2[1,4] Sigma2[2,1] 0.025404970 0.005409286 0.003555912 -0.004170472 -0.005028963 0.003555912 Sigma2[2,2] Sigma2[2,3] Sigma2[2,4] Sigma2[3,1] Sigma2[3,2] Sigma2[3,3] 0.001376400 -0.006640189 -0.008772632 -0.004170472 -0.006640189 -0.012877220 Sigma2[3,4] Sigma2[4,1] Sigma2[4,2] Sigma2[4,3] Sigma2[4,4] beta0.uncentred -0.016309177 -0.005028963 -0.008772632 -0.016309177 -0.021047216 -0.004911199 beta1 deviance mu[1] mu[2] mu[3] mu[4] 0.004060900 -30.770880970 -0.004321468 -0.003599652 -0.002737589 -0.001843123 Fehler in check.fun() : FAIL Zusätzlich: Warnmeldungen: 1: In jags.model("jaw-linear.bug", data, inits, n.chains = 2) : Unused variable "PI" in data 2: In jags.model("jaw-linear.bug", data, inits, n.chains = 2) : Unused initial value for "beta2" in chain 1 3: In jags.model("jaw-linear.bug", data, inits, n.chains = 2) : Unused initial value for "beta2" in chain 2 -------------------------------------------------------------- # classic-bugs/vol2/jaw/ # source("test3.R") Compiling model graph Declaring variables Resolving undeclared variables Allocating nodes Graph information: Observed stochastic nodes: 20 Unobserved stochastic nodes: 4 Total graph size: 311 Initializing model |**************************************************| 100% |**************************************************| 100% RSS Sigma2[1,1] Sigma2[1,2] Sigma2[1,3] Sigma2[1,4] Sigma2[2,1] 4.142772e-03 -2.332986e-03 6.402825e-04 5.413322e-03 7.250016e-03 6.402825e-04 Sigma2[2,2] Sigma2[2,3] Sigma2[2,4] Sigma2[3,1] Sigma2[3,2] Sigma2[3,3] 2.080484e-03 8.383643e-03 1.122597e-02 5.413322e-03 8.383643e-03 1.456589e-02 Sigma2[3,4] Sigma2[4,1] Sigma2[4,2] Sigma2[4,3] Sigma2[4,4] beta0 1.626817e-02 7.250016e-03 1.122597e-02 1.626817e-02 1.837847e-02 -3.261998e-03 beta0.uncentred beta1 beta1.uncentred beta2 deviance mu[1] -1.969120e-03 1.044244e-02 1.249483e-03 -6.488707e-04 -2.904794e+01 -6.601942e-03 mu[2] mu[3] mu[4] -4.358541e-03 -2.215025e-03 -2.577816e-04 Fehler in check.fun() : FAIL These failures instead could be also a problem of FreeBSD or R on my side, because I am using FreeBSD HEAD (math libs ...) and/or R-devel. So it would be nice, if someone else could test 'make check' etc. on FreeBSD 10.2, 9.3 with R-3.2.2, thanks. Although there are problems left with 'jaw', I personally would suggest to trust and to accept the other results enough for most scenarios. [1] http://www.openbugs.net/w/FrontPage
I did not use a german LANG environment and for, all tests ran OK. bf, if it is OK with you, I would commit the update.
Thanks. There don't seem to be any further regressions, so please proceed with the update, Kurt.
A commit references this bug: Author: pi Date: Sun Jan 3 18:13:45 UTC 2016 New revision: 405180 URL: https://svnweb.freebsd.org/changeset/ports/405180 Log: math/jags: 3.4.0 -> 4.0.0 - New WWW - Changes: https://martynplummer.wordpress.com/2015/08/02/whats-new-in-jags-4-0-0-part-14-reproducibility-and-testing/ https://martynplummer.wordpress.com/2015/08/09/whats-new-in-jags-4-0-0-part-24-dealing-with-undefined-nodes/ https://martynplummer.wordpress.com/2015/08/16/whats-new-in-jags-4-0-0-part-34-r-style-features/#more-353 PR: 204525 Submitted by: Rainer Hurling <rhurlin@gwdg.de> Approved by: bf Changes: head/math/jags/Makefile head/math/jags/distinfo head/math/jags/pkg-plist
Committed, thanks!