ADMB Installation Visual C++
Shows the procedure to install, build and run ADMB with Visual C++.
If you have problems with installation, please write to users@admb-project.org with information about your operating system, Microsoft .NET framework version, Microsoft SDK version, Microsoft Visual Studio version, the version of ADMB you're trying to install, and what error messages or other problems you had.
Introduction
Microsoft Visual Studio 2010 express includes a free compiler (CL.exe). This compiler can be used to build ADMB programs. Below shows the procedure to install and configure ADMB with Visual Studio 2010 Express for both 32-bit and 64-bit versions. This method allows you to use admb from any DOS window or in a compile command inside an editor or Integrated Development Environment (IDE). Using a Visual Studio command prompt is unnecessary.
The free version of Visual Studio 2010 does not include the 64-bit compiler, but the SDK does. Following this method ensures both the 32-bit and 64-bit VC++ compilers are installed for free.
Procedure
- Download and install the following three software packages from Microsoft, and install them in the order listed. If Visual Studio is installed prior to installing the Windows SDK, the installation of the Windows SDK may fail with a code of 5100 in the logfile. If this happens, uninstall ALL Visual studio products and re-run the SDK installer. Popups should be enabled for these sites, or use Internet Explorer to download if you have trouble with other browsers:
- Microsoft .NET 4 Framework:
http://www.microsoft.com/download/en/details.aspx?id=17851
- Microsoft Windows SDK 7.1:
http://www.microsoft.com/download/en/details.aspx?id=8279
- Microsoft Visual Studio 2010 Express:
http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products
- Download the most recent executable installer from the downloads page (ADMB Downloads), admb-11.1-windows-vc10-64bit.exe and run it. Make sure to choose the install location as C:\ADMB or another location without spaces in the name.
- Add the following to the PATH in the order given. If you are using a 32-bit machine, enter only the first, third, fourth, and fifth path listed in that order. If you are using a 64-bit machine, enter all five paths in the order listed. If you are compiling for a 64-bit machine, the second path listed here must reflect which architecture you want to compile for, this example is for Intel 64-bit processors - for most people this should not be changed. Also, if you are on a 32-bit machine, remove the ' (x86)' from these paths.
- C:\Program Files\Microsoft SDKs\Windows\v7.1
- C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64
- C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
- C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
- C:\ADMB\bin
- Add the following environment variables:
- INCLUDE = C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include;C:\Program Files\Microsoft SDKs\Windows\v7.1\Include
For the LIB variable, choose either 32-bit or 64-bit.
32-bit LIB:
- LIB = C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib;C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib
64-bit LIB: - LIB = C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64;C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64
- Logout and login again to make the environment variables take effect.
- You may now open any command shell (DOS window) or call admb from within an editor window using whatever compile command you would like. Try this using the "Simple" example. Open a command window, by clicking Start->Run then typing cmd.exe and enter the following commands in the window:
> C:
> cd ADMB\examples\admb\simple
> admb simple
> simple
Notes
To edit the PATH in Microsoft Windows 7, click Start then right-click on "Computer" and click "Properties". Click "Advanced system settings" on the left, then a new window will appear. Click the "Advanced" tab on this window, then the "Environment Variables" button at the bottom. The PATH is located in the "System Variables" list. Step 3 above requires you to add these paths to the PATH. Highlight the PATH variable and click "Edit". Add the paths, with each separated by a single semicolon (;). No spaces are permitted in the PATH variable. It is important that you do not erase what is in the PATH variable but only add to it, if you do many of your installed programs will fail to run. If you have previous versions of Visual Studio or Microsoft Windows SDK with entries on the PATH before these new additions, ADMB may fail to run properly. You must remove those paths from the PATH variable.
Alternative C++ configurations
Configuring ADMB with alternative C++ versions, some are outdated but still provided in case they are useful to users.
Configuring MS Visual C++ 6.0 with ADMB (Marc Labelle)
Configuring MS Visual C++ 6.0 with ADMB (Melissa Haltuch)
Configuring MS Visual C++ 2010 (32 and 64 bit) with ADMB (Allan Hicks, Ian Taylor)
Problems
Please email users@admb-project.org for any problems with the procedure above.