[ADMB Users] R2admb compile problem
CHRIS GRANDIN
cgrandin at shaw.ca
Mon Oct 28 08:34:54 PDT 2013
Hi Allan,
Check your working directory and see if Function1.cpp and Function1.obj exist. If they do and Function1.exe doesn't then the compile part worked and you have a linker problem (adlink.bat). The message you are getting is a typical linker error. Open a DOS window, and try running:
adlink Function1
and report what you get.
Cheers
Chris
----- Original Message -----
From: "Allan Clark" <allan.clark at uct.ac.za>
To: "users at admb-project.org" <users at admb-project.org>
Sent: Sunday, October 20, 2013 3:16:23 AM
Subject: [ADMB Users] R2admb compile problem
Good morning all
I am trying to use R2admb and have the following very simple example. The *.tpl is included below. I am a Windows 7 user, using R3.01.
//Function1.tpl
//*********************************
PARAMETER_SECTION
init_number x;
objective_function_value C;
PROCEDURE_SECTION
C= pow(x-5,2);
//*********************************
I am running the example using three different methods
1. from DOS
2. From Emacs
3. From within R
1. from DOS
admb Function1
Function1
This runs correctly and works
2. From Emacs
I "Translate", "Build" and "Run" the file and it works correctly
3. From R
#Using the following code
require(R2admb)
fn="Function1"
setup_admb() #outputs the following [1] "c:\\ADMB\\admb101-gcc452-win64"
compile_admb(fn, verbose=T)
#I set 'verbose =T' to see whats happening
#last error line = 'collect2: ld returned 1 exit status'
#cant run this part of the code
run_admb(fn)
#Error in run_admb(fn) :
#executable Function1.exe not found: did you forget to compile it?
Note that if I first compile the tpl file using DOS and then run the following from R, that everything works.
run_admb(fn) #to run the executable
results <- read_admb(fn)
results
clean_admb(fn)
DOES ANYONE KNOW WHY compile_admb(fn, verbose=T) DOES NOT WORK CORRECTLY?
//Function1.tpl
DATA_SECTION
PARAMETER_SECTION
init_number x;
objective_function_value C;
PRELIMINARY_CALCS_SECTION
PROCEDURE_SECTION
C= pow(x-5,2);
________________________________
UNIVERSITY OF CAPE TOWN
This e-mail is subject to the UCT ICT policies and e-mail disclaimer published on our website at http://www.uct.ac.za/about/policies/emaildisclaimer/ or obtainable from +27 21 650 9111. This e-mail is intended only for the person(s) to whom it is addressed. If the e-mail has reached you in error, please notify the author. If you are not the intended recipient of the e-mail you may not use, disclose, copy, redirect or print the content. If this e-mail is not related to the business of UCT it is sent by the sender in the sender's individual capacity.
_______________________________________________
Users mailing list
Users at admb-project.org
http://lists.admb-project.org/mailman/listinfo/users
More information about the Users
mailing list