admb-project / admb

AD Model Builder
http://admb-project.org
Other
64 stars 19 forks source link

Let user point to binary directly from any directory #163

Closed Cole-Monnahan-NOAA closed 3 years ago

Cole-Monnahan-NOAA commented 3 years ago

When I build ADMB and want to test it I usually have a console open in a directory, say examples/admb/simple. It finds the executable properly:

C:\Users\cole.monnahan\admb\examples\admb\simple>..\..\..\admb.cmd
Builds AD Model Builder executable or library.

Release Version: 12.2
Location: C:\Users\cole.monnahan\admb\build\admb\bin\

But if I try to compile the model I get an error:

C:\Users\cole.monnahan\admb\examples\admb\simple>..\..\..\admb.cmd simple.tpl
'..\..\..\admb.cmd' is not recognized as an internal or external command,
operable program or batch file.

It would be really helpful to be able to toggle between the official version and modified version within a folder to test for effects. Is this something that could be updated?

johnoel commented 3 years ago

Hi @Cole-Monnahan-NOAA , There must be something in your path, but it works for me...

C:\admb-master\examples\admb\simple>..\..\..\admb.cmd simple

*** Parse: simple.tpl
xxglobal.tmp
xxhtop.tmp
header.tmp
xxalloc.tmp
xxtopm.tmp
        1 file(s) copied.
tpl2cpp   simple

*** Compile: simple.cpp
g++ -c -std=c++14 -O3 -fpermissive -D_FILE_OFFSET_BITS=64 -DUSE_ADMB_CONTRIBS -D_USE_MATH_DEFINES -I. -I"C:\admb-master\build\admb\include" -I"C:\admb-master\build\admb\include\contrib" -o simple.obj simple.cpp

*** Linking: simple.obj
g++ -static -o simple.exe simple.obj "C:\admb-master\build\admb\lib\libadmb-contrib-mingw64-g++8-debug.a"

Successfully built 'simple.exe'.
Cole-Monnahan-NOAA commented 3 years ago

Ok I tried an absolute path and that seems to work so I'm going to close this.

johnoel commented 3 years ago

Do you mean using admb.cmd from the system path?

C:\admb-master\examples\admb\simple>admb.cmd simple
Cole-Monnahan-NOAA commented 3 years ago

No, absolute path to the build like this:

C:\Users\cole.monnahan\admb\examples\admb\simple>C:\Users\cole.monnahan\admb\build\admb\admb.cmd simple

Or like this C:\Users\cole.monnahan\admb\examples\admb\simple>......\build\admb\admb.cmd simple

This also works to get the 12.2 release version C:\Users\cole.monnahan\admb\examples\admb\simple>C:\ADMB-12.2\admb.cmd simple

That let's me toggle between versions to check e.g., if things have changed. I do have a weird PATH setup which probably caused this issue originally.

In any case this works for me so I'm fine closing it. Thanks!