Revision 1511

trunk/tests/R/simple.r (revision 1511)
1
x <- rep(0,100)
2
x
3
f <- 0
4
dyn.load("simple.dll")
5
xx <- .C("simple", as.integer(length(x)), as.double(x), as.double(f), "")
6
dyn.unload("simple.dll")
trunk/tests/R/README.txt (revision 1511)
1
Todo
2
----
3

  
4
[ ] "admb -d" for nmake and cl
5
[ ] "admb -d -r" shared lib for re
6
[ ] need sed files for re
trunk/tests/R/example.cpp (revision 1511)
1
#include <iostream>
2

  
3
extern "C" {
4

  
5
void __stdcall __declspec(dllexport) example()
6
{
7
  std::cout << __func__ << ':' << __LINE__ << std::endl;
8
}
9

  
10
};
trunk/tests/R/Makefile (revision 1511)
1
all: simple.dll
2

  
3
run:
4
	Rscript simple.r
5

  
6
testdll.exe: main.obj simple.dll example.dll
7
	$(CXX) -o $@ main.obj simple.dll example.dll
8

  
9
simple.dll: simple.tpl
10
	..\..\admb -d simple.tpl
11

  
12
main.obj: main.cpp
13
	$(CXX) -c -o $@ $^
14

  
15
example.dll: example.obj
16
	$(CXX) -shared -o $@ $^
17

  
18
example.obj: example.cpp
19
	$(CXX) -c -o $@ $^
20

  
21
clean:
22
	del /Q admodel.cov
23
	del /Q admodel.dep
24
	del /Q admodel.hes
25
	del /Q eigv.rpt
26
	del /Q example.dll
27
	del /Q example.obj
28
	del /Q fmin.log
29
	del /Q main.obj
30
	del /Q simple.bar
31
	del /Q simple.cor
32
	del /Q simple.cpp
33
	del /Q simple.dat
34
	del /Q simple.def
35
	del /Q simple.dll
36
	del /Q simple.eva
37
	del /Q simple.htp
38
	del /Q simple.log
39
	del /Q simple.obj
40
	del /Q simple.par
41
	del /Q simple.std
42
	del /Q simple.tpl
43
	del /Q testdll.exe
44
	del /Q variance
trunk/tests/R/example.h (revision 1511)
1
extern "C" {
2
  void __stdcall __declspec(dllexport) simple(char** argv);
3
  void __stdcall __declspec(dllexport) example();
4
};
trunk/tests/R/main.cpp (revision 1511)
1
#include "example.h"
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff