
How to install ADMB for mac osx Snow Leopard

0.) Download the  zip file (currently named admb-9.1-macos-xcode3.1-32bit.zip)

1.) copy the zip file to your home directory.  
This is the directory you should be in when you
open a terminal.

2.) Unzip the file. This will create a directory currently named 
admb-9.1-macos-xcode3.1-32bit
`
3.) Make sure you have read write permission in this directory by typing
the command
    
            chmod -R u+rw admb-9.1-macos-xcode3.1-32bit

4.) Make symbolic link to admb so that you can refer to this directory
by admb 

         ln -s admb-9.1-macos-xcode3.1-32bit admb

5.) Check that this is done right by typing

          ls admb

You should see the contents of admb-9.1-macos-xcode3.1-32bit
something like

   LICENSE   README

  etc.

6.)  Type the command pwd
and you will see your home directory. For example say it is /Users/admbuser

6.) Open or create a file named .profile and put the following lines
into it.

    export ADMB_HOME=/Users/admbuser/admb
    export PATH=${ADMB_HOME}/bin:${PATH}
     
Save the file and exit your editor.

7.)  Type the command   ls .p*
and you should see .profile
If you see .profile.txt rename it with

     mv .profile.txt .profile

8.) Type the command cd admb/bin

9.) Edit the file adcomp with a text editor. 
find the lines near the bottom containing

  g++ -c $g

and change them to

  g++ -m32 -c $g

You are adding -m32 to tell the compiler to generate 32 bit
code which is compatible with these libraries.
Save the file.

10.) Edit the file adlink and change the lines near the bottom containing

  g++ $s

to

  g++ -m32 $s

You are adding -m32 to the line to instruct the compiler to
create 43 bit code compatible with these libraries.
Save the file and close the terminal and open a new terminal.

11.) Now type the command  

                          set | less

You should see a list starting with

   ADMB_HOME=/Users/admbuser/admb

Type a q to get out of less

12.) Type   $PATH  
and you should see 

        /Users/admbuser/admb/bin:/usr/bin

13.) Now you are ready to test ADMB.

Type   cd admb/examples/admb/simple

  now type   

               tpl2cpp simple
               adcomp  simple
               adlink  simple

This should create the simple example binary. To run it type

              ./simple

14.) If that runs OK we want to try the radom effects module.
Type  cd  ../../admb-re/orange

               tpl2rem orange
               adcomp -r orange
               adlink -r orange

The differences in the commands are to deal with random effects.
To run the model type

                 ./orange


