How to install AMPL¶
After downloading your AMPL & Solvers bundle from the AMPL Portal, please follow the instructions below that correspond to your operating system:
Windows¶
To install:
Download and extract your bundle. This will be your AMPL folder. Rename it if you like and move it to any convenient location on your computer.
Warning
Please make sure you place
ampl.mswin64
in a folder where you have write permissions without Administrator access. For read-only locations please see the note at the end.To run via the IDE:
In your AMPL folder, enter the
amplide
folder and then double-clickamplide.exe
to start the IDE.To run via the commnad line:
Inside your AMPL folder, double-click the
sw.exe
icon and typeampl
at the prompt in the window that appears. Then you will see anampl:
prompt and can proceed to type AMPL commands.Activate your license if you received a license UUID (e.g., AMPL CE licenses):
Run this command in AMPL to activate your license:
ampl: shell "amplkey activate --uuid <license-uuid>"; # replace <license-uuid> by the license UUID
Note: you need to restart AMPL in order to start using the new license.
Note
If you install AMPL somewhere in your home directory, you do not need to worry about the following.
If you use cloud licenses (e.g., AMPL Community Edition licenses), the AMPL folder cannot be read-only (e.g., "C:\Program Files\ampl.mswin64"
). If really you want to have AMPL installed on a read-only folder, you need to set the environment
variables AMPL_LICFILE
to a location where you store ampl.lic
and where you have permissions to write, and set AMPLKEY_RUNTIME_DIR
to a temporary folder.
Linux¶
To install:
Download and extract your bundle above. This will be your AMPL directory. Rename it if you like, and move it anywhere on your computer that you want.
Warning
Please make sure you place AMPL in a directory where you have write permissions such as your home directory. Otherwise, please see the note at the end.
To run via IDE:
Inside your AMPL folder, enter the directory named
amplide
and run theamplide
executable.To run via the command line:
In a command window, use cd to go to your AMPL directory, then type
./ampl
at the system prompt. Then you will see anampl:
prompt and can proceed to type AMPL commands.Activate your license if you received a license UUID (e.g., AMPL CE licenses):
Run this command in AMPL to activate your license:
ampl: shell "amplkey activate --uuid <license-uuid>"; # replace <license-uuid> by the license UUID
Note: you need to restart AMPL in order to start using the new license.
Note
If you install AMPL somewhere in your home directory, you do not need to worry about the following.
If you use cloud licenses (e.g., AMPL Community Edition licenses), the AMPL directory cannot be read-only. If really you want to have AMPL installed on a read-only directory, you need to set the environment
variables AMPL_LICFILE
to a location where you store ampl.lic
and where you have permissions to write, and set AMPLKEY_RUNTIME_DIR
to a temporary directory.
macOS¶
To install:
Download and extract your bundle. This will be your AMPL folder. Rename it if you like and move it to any convenient location on your computer.
Next, you will need to tell macOS that your AMPL software is safe to run. Double-click your AMPL folder to open it and then follow these steps:
Control-click the
ampl.command
file and select ‘Open’ in the context menu.If a warning message (“macOS cannot verify the developer…”) pops up, click ‘Open’.
A Terminal window will appear. After a few seconds, you will see
ampl:
in the last line in the window. You can now close the window. (If a warning message saying “Do you want to terminate running processes in this window?” pops up, click ‘Terminate’.)
Warning
If this step is skipped, you will get errors such as: “Amplide” is damaged and can’t be opened. You need to run
ampl.command
to tell macOS that your AMPL software is safe to run.
To run via IDE:
In your AMPL folder, enter the
amplide
folder and then double-click theAmplide
application (with a black cat’s-head icon) to start the IDE. (The first time you open the AMPL IDE, you might see a few “Amplide would like to access files” boxes at startup; click OK in each box to dismiss it.)To run via the command line:
In your AMPL folder, double-click
ampl
. You should see anampl:
prompt appear and can now proceed to enter AMPL commands.Activate your license if you received a license UUID (e.g., AMPL CE licenses):
Run this command in AMPL to activate your license:
ampl: shell "amplkey activate --uuid <license-uuid>"; # replace <license-uuid> by the license UUID
Note: you need to restart AMPL in order to start using the new license.
Note
If you install AMPL somewhere in your home directory, you do not need to worry about the following.
If you use cloud licenses (e.g., AMPL Community Edition licenses), the AMPL directory cannot be read-only. If really you want to have AMPL installed on a read-only directory, you need to set the environment
variables AMPL_LICFILE
to a location where you store ampl.lic
and where you have permissions to write, and set AMPLKEY_RUNTIME_DIR
to a temporary directory.