Personal tools
You are here: Home Community Unofficial Tutorials and Examples Using ADMB on linux

Using ADMB on linux

by Ian Taylor last modified Apr 21, 2009 06:59 AM

tips for people converting to linux from Windows

Installation

Note, this is just a supplement to the instructions on the ADMB Installation Linux page.

To have the $ADMB_HOME and $PATH environmental variables set for all future sessions, edit the ~/.bashrc file (or ~/.bash_login, or other file that will be loaded when you open a terminal or connect to your computer) and add the following lines. You may replace ~/admb with /usr/local/admb or any other location where you choose to unzip the ADMB files.

#!/bin/bash
export ADMB_HOME=~/admb
PATH=$PATH:$ADMB_HOME/bin
export PATH
For additional perspectives on installation, see this page.

Compiling

In linux, compiling may be done in two steps, using "tpl2cpp" to convert the TPL file to a C++ file, and "mygcco" or "mygccs" to compile the C++ file (in either optimized or safe mode). Or in one step with the "makeadm" or "makeadms" scripts.

Unlike Windows, the executable file created by this process has no extension, and to run it, you need to add "./" in front of the filename. Thus, a typical sequence might be,

makeadm MYMODEL
./MYMODEL

Input files

If you're using input files for your model that were created in Windows, you may have problems related to differences in the newline characters. To get around this you can either replace all blank lines with a hash mark (#), or use the command,
dos2unix MYFILE.dat

to convert the newline characters.The converted files should work on both linux and Windows.

Document Actions