Hello guys

Arni, you were correct. The R search path contained 'C:/MinGW/bin;' which
contains a g++ compiler. I removed it and now it works fine!
Thank you for the help.


Just for completeness sake: (the R code and output is included below)

#========================================================


> require(R2admb)
> setup_admb()
[1] "c:\\ADMB\\admb101-gcc452-win64"
> fn="Function1"
> compile_admb(fn, verbose=T)
compiling with args: ' ' ...
compile output:
*** tpl2cpp Function1 xxglobal.tmp xxhtop.tmp header.tmp xxalloc.tmp
xxtopm.tmp 1 file(s) copied. *** adcomp Function1 g++ -c -O3
-Wno-deprecated -D__GNUDOS__ -Dlinux -DOPT_LIB -DUSE_LAPLACE -fpermissive
-I. -I"c:\ADMB\admb101-gcc452-win64\include" -o Function1.obj Function1.cpp
*** adlink Function1 g++ -s -static -L"c:\ADMB\admb101-gcc452-win64\lib"
Function1.obj -ldf1b2o -ladmod -ladt -lado -ldf1b2o -ladmod -ladt -lado -o
Function1 Done
compile log:

> run_admb(fn)

> results <- read_admb(fn)

> results
Model file: Function1
Negative log-likelihood: 0
Coefficients:
x
5

> clean_admb(fn)
#=========================================================


I am not sure why 'C:/MinGW/bin;' is in the R search path since it it
not in any of the environment variables?

regards








On 21 October 2013 15:56, Ben Bolker <bbolker@gmail.com> wrote:

> On 13-10-21 09:53 AM, Arni Magnusson wrote:
> > I've seen similar linking errors when there's more than one compiler in
> > the PATH, causing a version conflict. In this case, the solution is to
> > remove all but one compiler from the PATH.
> >
> > Arni
> >
>
>  So in this respect, to see what's going on in the within-R2admb/R
> context, you should run
>
> Sys.getenv("PATH")
>
> and compare it with whatever the equivalent command for examining the
> PATH environment variable is in Windows (I don't know, my Windows skills
> are really rusty)
>
> >
> >
> >> On 13-10-21 05:48 AM, Ben Stevenson wrote:
> >>
> >>> Hi Allan,
> >>>
> >>> Given that ADMB seems to be working fine on its own, you're probably
> >>> better off asking this question to an R2admb package maintainer as
> >>> only a few people here use R2admb.
> >>>
> >>> R2admb uses the system() R function to in order to compile the .tpl
> >>> file. My guess is that it is not finding the admb command, and this
> >>> will be something to do with environment variables. What happens when
> >>> you run system("admb") in R? Do you get an error saying about the
> >>> admb command not being found? This would confirm my suspicion.
> >>>
> >>> If this is the case, find where the admb binary is on your system.
> >>> From the output of setup_admb, my guess is that it's in
> >>> c:\\ADMB\\admb101-gcc452-win64\\bin. If you call Sys.getenv("PATH"),
> >>> does this directory appear?
> >>>
> >>> Cheers,
> >>>
> >>> Ben
> >>
> >>
> >>
> >> On Mon, 21 Oct 2013, Ben Bolker wrote:
> >>
> >> I am the R2admb package maintainer -- I saw this message go by on the
> >> R mailing list as well.
> >>
> >> The only clue I have here is that something is going wrong with the
> >> linking -- that's what's indicated by the last line you included in
> >> your R-help message,
> >>
> >> 'collect2: ld returned 1 exit status'
> >>
> >> Can you provide more of the 'verbose' output?  I wonder if there is an
> >> environment variable related to linking that's set in your external
> >> environment but not within R.  (Do you have spaces in any of your path
> >> names ... ?)
> >>
> >> You can respond to the list or e-mail me off-list (my e-mail is
> >> available via maintainer("R2admb") ...
> >>
> > _______________________________________________
> > Users mailing list
> > Users@admb-project.org
> > http://lists.admb-project.org/mailman/listinfo/users
>
> _______________________________________________
> Users mailing list
> Users@admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users
>

	[[alternative HTML version deleted]]

