Revision 1510

trunk/tests/dll/GNUmakefile (revision 1510)
48 48
	rm -vf simple.obj
49 49
	rm -vf simple.par
50 50
	rm -vf simple.std
51
	rm -vf simple.tpl
51
	rm -vf simple.dll
52 52
	rm -vf testso
53 53
	rm -vf testso.exe
54 54
	rm -vf variance
trunk/tests/dll/simple.tpl (revision 1510)
1
DATA_SECTION
2
  dll_int n
3

  
4
PARAMETER_SECTION
5
  dll_init_vector x(1,n)
6
  dll_number output
7
  objective_function_value f
8

  
9
PROCEDURE_SECTION
10
  f = square(x(1)-1.0);
11
  for (int i=1; i<n; i++)
12
  {
13
    f += square(x(i+1)-x(i));
14
  }
15
  output = f;
trunk/tests/dll/simple.r (revision 1510)
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/dll/Makefile (revision 1510)
1
all: testdll.exe
1
all: simple.dll
2 2

  
3 3
run:
4
	testdll.exe
4
	Rscript simple.r
5 5

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

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

  
12
simple.obj:
13
	copy ..\..\examples\admb\simple\simple.tpl
14
	copy ..\..\examples\admb\simple\simple.dat
15
	..\..\admb -c -d simple.tpl
16

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

  
trunk/scripts/admb/admb.bat (revision 1510)
361 361
    set tpl=%%~na
362 362
    @REM set CMD=adlink!d!!g!!r!!fast! !tpl!.obj !objs!
363 363
    if defined d (
364
      set CMD=!LD!!LDFLAGS! -o !tpl!.dll !objs! !libs!
364
      if "!CXX!"=="cl" (
365
        set CMD=!LD!!LDFLAGS! -o !tpl!.dll !objs! !libs!
366
      ) else (
367
        if defined objs (
368
          set CMD=!LD!!LDFLAGS! -o !tpl!.dll !tpl!.obj !objs! !libs!
369
        ) else (
370
          set CMD=!LD!!LDFLAGS! -o !tpl!.dll !tpl!.obj !libs!
371
        )
372
      )
365 373
    ) else (
366 374
      if "!CXX!"=="cl" (
367 375
        if defined objs (
trunk/src/GNUmakefile (revision 1510)
169 169
	copy ..\scripts\admb\adlink.bat ${DIST}\bin\adlink.cmd
170 170
	copy ..\scripts\admb\adcomp.bat ${DIST}\bin\adcomp.cmd
171 171
	if not exist $(DIST)\include\contrib md $(DIST)\include\contrib
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff