[ADMB Users] Environment Variables Issue?

266 views
Skip to first unread message

Ted_T...@fws.gov

unread,
Jun 28, 2010, 10:18:50 AM6/28/10
to us...@admb-project.org

After getting a new computer for work, I installed the admb-ide-440-2.exe
installer and things seemed fine, but when I tried to run an instance of a
project that had been compiled and run before (just copied the .tpl and
.dat file to a new folder), I get the following error at the run:

'wfm02_2009' is not recognized as an internal or external command,
operable program or batch file.

I read through the articles in the list serve that I could find concerning
this, but nothing jumped out at me..
I have walked through the checking of the environment variables with a
buddy at a different place to make sure that I have the equivalent that he
does, but feel that I must be missing something.

In User Variables, I have
ADMB_HOME c:\ADMB\gcc440
HOME c:\~
INCLUDE c:\admb\gcc440
LIB c:\admb\gcc440
PATH c:\admb\gcc440\bin; c:\gnu\gcc\bin; c:\gnu\gdb\bin;
c:\gnu\emacs\bin

I thought I remembered having to tinker with something in the System
Variables part of the Env Variables last time I did an install, but cannot
remember what it was and we could not find anything corresponding to admb
in System variables on my colleagues computer.

I have tried the install twice (removing all signs of ADMB in between) but
to no avail. I am not sure if there is something on the federal IT system
that is blocking it from creating the .exe file, but the furthest it gets
is creating a .cpp and .htp files. When I try and run an old project with
a already created .exe file, it works just fine.

Can anyone help me out or let me know what kind of questions I should be
asking my IT folks?
Thanks a bunch..
Ted

Ted Treska
U.S. Fish & Wildlife Service
Green Bay Fish and Wildlife Conservation Office
2661 Scott Tower Drive
New Franken, WI 54229-9565
920-866-1764
920-866-1710 fax

_______________________________________________
Users mailing list
Us...@admb-project.org
http://lists.admb-project.org/mailman/listinfo/users

Ian Taylor

unread,
Jun 28, 2010, 6:38:43 PM6/28/10
to Ted_T...@fws.gov, us...@admb-project.org
Hi Ted,
I've used the ADMB-IDE, but had not yet used the default installation on a federal computer. I had to run the ADMB-IDE installer as an administrator and the only issues I faced came when I then tried to run the IDE as a non-administrative user.

When I ran the ADMB-IDE using an administrative account, opening the simple.tpl example and clicking the "Run" icon in the IDE indeed resulted in the error, "'simple' is not recognized as an internal or external command,operable program or batch file.", but that was only if I didn't build first. When I clicked the "Build" icon, it worked fine, ending with a message like, "Compilation finished at Mon Jun 28 14:42:22" after which I could successfully "Run" without error.

However, in an effort to follow my normal pattern of working as a non-administrative user, I faced problems. As Arni has noted in the past, the User Variables don't get changed for non-administrative users. Thus, opening the IDE without manually adding all the User Variables that you note below, it simply opens as a normal Emacs installation without any of the ADMB-related features. After manually adding the User Variables, the IDE loaded properly, but unfortunately when I tried to Build a model, I got an error
tpl2cpp.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
I don't know if these problems are somehow related to the configuration of federal computers, or just any setup with a non-administrative user. Either way, it would be good to get things working, but I'm afraid we'll need Arni's advice on what to try next.
-Ian

Arni Magnusson

unread,
Jun 28, 2010, 6:45:37 PM6/28/10
to Ted_T...@fws.gov, us...@admb-project.org
> In User Variables, I have
>
> ADMB_HOME c:\ADMB\gcc440
> HOME c:\~
> INCLUDE c:\admb\gcc440
> LIB c:\admb\gcc440
> PATH c:\admb\gcc440\bin; c:\gnu\gcc\bin; c:\gnu\gdb\bin;
> c:\gnu\emacs\bin

The INCLUDE and LIB variables are unnecessary and should not be defined.
Probably not the root of the problem, but I recommend leaving them
undefined.

AD Model Builder with GCC requires only two env variables, ADMB_HOME and
PATH, and ADMB-IDE needs a third variable HOME. The ADMB-IDE installer
tries to set these three variables, and the values you list above look
correct.

If you can translate simple.tpl to simple.cpp and simple.htp, then at
least tpl2cpp is working. It sounds like you are unable to build
simple.exe out of simple.cpp and simple.htp. The first test, then, is to
check whether GCC is able to build hello.exe out of hello.cpp.

Create c:/hello/hello.cpp from
http://helloworldsite.he.funpic.de/hello.htm#C++-ISO, open a Dos shell,
navigate to c:/hello, and run Test #1:

g++ -s -static -Wall hello.cpp -o hello

If your setup passes this first test and creates a healthy hello.exe, then
GCC is working. The next test is to copy simple.tpl and simple.dat to
directory c:/simple, open a Dos shell, navigate to c:/simple, and run Test
#2:

admb simple

If your setup passes this second test and creates a healthy simple.exe,
then ADMB is working and the problem is either ADMB-IDE or a
misunderstanding of how it works. Before we go there, it would be great if
you can run these two tests to narrow the search.

Arni

P.S. Many beginning users can benefit from this discussion. You made a
good effort reading through old messages on the mailing list, but luckily
Ian Taylor has taken the initiative and is preparing an ADMB FAQ, where
previous help-related discussions will be archived in an organized way
that's easy to browse. An alpha version is already on the web in a secret
location.

Ian Taylor

unread,
Jun 30, 2010, 5:47:21 PM6/30/10
to Arni Magnusson, Ted_T...@fws.gov, us...@admb-project.org
Thanks to Ted and Arni, I think the problems with installing the
ADMB-IDE that were the subject of emails on Monday have now all been
solved.

One problem was the finicky nature of the Environmental Variables (no
spaces allowed), and the other was that in the process of changing
settings on my computer, I somehow must have corrupted the simple.tpl
file or something else in that directory that I was using to test the
compiling. I finally thought to try compiling a different file which
worked fine, and after wiping out and replacing the directory with the
simple.tpl file that caused tpl2cpp to crash, that test is working again
too.

In case anyone else wants to try the setup, and for completeness in the
email archives, here are the steps that seem to get the current version
of the ADMB-IDE working for non-administrative user accounts.

1. Have an administrator run the ADMB-IDE installer to create the full
default installation.
2. As the non-admin user, create the following User Variables (via right
click on My Computer > Properties > Advanced > Environmental Variables >
New), making sure the paths all match existing directories and that you
have no spaces:


ADMB_HOME c:\ADMB\gcc440
HOME c:\~

PATH
c:\admb\gcc440\bin;c:\gnu\gcc440\bin;c:\gnu\gdb\bin;c:\gnu\emacs\bin

One issues worth noting is that the files created by the installer
c:/~/.emacs or c:/~/.recentf may need to have their security settings
changed if the non-admin user wants to modify the setup or get a list of
recently used files within the ADMB-IDE. Second, for users of R, the
creation of a HOME variable has implications for where R looks for
things. It seems you can override this by creating an additional
variable called R_USER pointing to where you want R to look for packages.

-Ian

Reply all
Reply to author
Forward
0 new messages