Annotation of OpenXM/src/R/r-packages/note.txt, Revision 1.8
1.8 ! takayama 1: $OpenXM: OpenXM/src/R/r-packages/note.txt,v 1.7 2016/10/28 02:27:39 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)
31: You can check hgm.so3nc by hand.
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:
42: * Notes.
43: library.dynam() shows a list of shared libraries loaded.
44: dyn.load("hgm.so") can be used to load shared library by hand.
45: getwd() gets the current working directory.
46:
1.3 takayama 47:
48: * Undocumented functions which are removed temporary fro NAMESPACE. 2015.03.24
49: export(hgm.so3nc)
50: export(hgm.normalizingConstantOfFisherDistributionOnSO3)
51: export(hgm.normalizingConstantOfOrthant)
52: export(hgm.normalizingConstantOfBinghamDistribution)
53: export(hgm.z.mleDemo)
54: export(hgm.ssFB)
55:
1.1 takayama 56:
1.4 takayama 57: * Check the memory leak by valgrind and by AddressSanitizer. 2015.04.01
58: ** Valgrind
59: apt-get install valgrind
60:
61: cat >>~/.valgrindrc
62: --leak-check=full
63: --track-origins=yes
64: ctrl-D
65:
1.7 takayama 66: make clean
1.4 takayama 67: R CMD check hgm --use-valgrind
68: more hgm.Rcheck/hgm-Ex.Rout
69: Example of an error (Note that there is no error message in *.log)
70: ==14813== Conditional jump or move depends on uninitialised value(s)
71: ==14813== at 0xCA20170: mh_t (jack-n.c:1361)
72: for (i=0; i<=M_m; i++) {
73: -- snip
74: serror = myabs((partial_sum[i]-partial_sum[i-1])/partial_sum[i-1]);
75: }
76: partial_sum[-1] is accessed!
77:
78: As to details, search "valgrind" in R-exts.pdf
79:
80: * R CMD check hgm --use-gct
1.5 takayama 81:
82: * Note on building R package: @s/2015/04/05-hgm-r-package-memo.txt
83:
1.6 takayama 84: ;;
85: 2016.02.15 testdata.
86: c<-hgm.p2wishart(m=4,n1=50,n2=100,beta=c(1,2,4,8),q0=0.5,q=30,autoplot=1);
87: output is wrong.
88: 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))
89: output is correct.
90: 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)
91: crashed, but by commented out todo in mh.c, it works. See @s/2016/02
92:
1.8 ! takayama 93: ;;
! 94: http://kbroman.org/pkg_primer/pages/cran.html
! 95:
! 96: R CMD check hgm --as-cran
! 97:
! 98:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>