Annotation of OpenXM/src/R/r-packages/note.txt, Revision 1.9
1.9 ! takayama 1: $OpenXM: OpenXM/src/R/r-packages/note.txt,v 1.8 2016/10/30 01:10:18 takayama Exp $
1.1 takayama 2:
3: See also OpenXM/src/hgm/note.txt
4:
5: * C source codes.
6: C sources and headers should be developed and edited in the directory
7: OpenXM/src/hgm in order to provide a standalone mode without R
8: in the OpenXM project.
9: They are copied by rsync to hgm/src from OpenXM/src/hgm/
10: See the Makefile.
11:
12: * How to develope and tests.
13: (1) Develope the system in OpenXM/src/hgm as a standalone system.
14: See OpenXM/src/hgm/so3 as an example.
15: (2) Add rsync-[projectname] to OpenXM/src/R/r-packages/Makefile
16: See the example of the project so3.
17: (3) Example in the case of hgm.
18: R CMD check hgm
19: It generates pdf documents and shared libraries.
20: hgm.Rcheck/hgm-Ex.Rout contains the result of the execution of examples
21: embedded in the documents in man.
22: hgm.Rcheck/hgm-manual.pdf is the PDF manual.
23:
24: See also http://fe.math.kobe-u.ac.jp/Movies/oxvh,
25: 2012-09-05-r-package[.mov]
26: 2013-02-06-Ropenxm[.mov]
27:
28: R CMD INSTALL hgm
29: R
30: library(hgm)
1.9 ! takayama 31: You can check hgm.ncso3 by hand.
1.1 takayama 32: R CMD REMOVE hgm
33: It is used to remove the test library.
34:
35: R --help
1.2 takayama 36: (4) Binary build on Windows.
37: R CMD INSTALL --build hgm
38: ( Check R CMD INSTALL --help for details. )
39: or
40: R CMD build --binary hgm (perhaps, obsolete style)
1.1 takayama 41:
1.9 ! takayama 42: (5) make copy-web-hgm
! 43: hgm_x.yz.tar.gz
! 44: [cran submit package] search ==> http://cran.r-project.org/submit.html
! 45:
1.1 takayama 46: * Notes.
47: library.dynam() shows a list of shared libraries loaded.
48: dyn.load("hgm.so") can be used to load shared library by hand.
49: getwd() gets the current working directory.
50:
1.3 takayama 51:
52: * Undocumented functions which are removed temporary fro NAMESPACE. 2015.03.24
53: export(hgm.so3nc)
54: export(hgm.normalizingConstantOfFisherDistributionOnSO3)
55: export(hgm.normalizingConstantOfOrthant)
56: export(hgm.normalizingConstantOfBinghamDistribution)
57: export(hgm.z.mleDemo)
58: export(hgm.ssFB)
59:
1.1 takayama 60:
1.4 takayama 61: * Check the memory leak by valgrind and by AddressSanitizer. 2015.04.01
62: ** Valgrind
63: apt-get install valgrind
64:
65: cat >>~/.valgrindrc
66: --leak-check=full
67: --track-origins=yes
68: ctrl-D
69:
1.7 takayama 70: make clean
1.4 takayama 71: R CMD check hgm --use-valgrind
72: more hgm.Rcheck/hgm-Ex.Rout
73: Example of an error (Note that there is no error message in *.log)
74: ==14813== Conditional jump or move depends on uninitialised value(s)
75: ==14813== at 0xCA20170: mh_t (jack-n.c:1361)
76: for (i=0; i<=M_m; i++) {
77: -- snip
78: serror = myabs((partial_sum[i]-partial_sum[i-1])/partial_sum[i-1]);
79: }
80: partial_sum[-1] is accessed!
81:
82: As to details, search "valgrind" in R-exts.pdf
83:
84: * R CMD check hgm --use-gct
1.5 takayama 85:
86: * Note on building R package: @s/2015/04/05-hgm-r-package-memo.txt
87:
1.6 takayama 88: ;;
89: 2016.02.15 testdata.
90: c<-hgm.p2wishart(m=4,n1=50,n2=100,beta=c(1,2,4,8),q0=0.5,q=30,autoplot=1);
91: output is wrong.
92: c<-hgm.p2wishart(m=4,n1=50,n2=100,beta=c(1,2,4,8),q0=0.5,q=30,err=c(1e-30,1e-10),mode=c(1,1,0))
93: output is correct.
94: c<-hgm.p2wishart(m=4,n1=50,n2=100,beta=c(1,2,4,8),q0=0.5,q=30,err=c(1e-30,1e-10),autoplot=1)
95: crashed, but by commented out todo in mh.c, it works. See @s/2016/02
96:
1.8 takayama 97: ;;
98: http://kbroman.org/pkg_primer/pages/cran.html
99:
100: R CMD check hgm --as-cran
101:
102:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>