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.
For instance, assuming that you want to install AMPL on a Linux system in the /opt
directory, which is not writeable by normal users. To install AMPL and dynamic licenses, you need to do the following:
Unpack the AMPL tarball into /opt
as root user. The executables should then be at
/opt/ampl.linux-intel64/
.
For each user that wants to use this AMPL installation with his own license:
Define environment variables to point to a writeable directory in the user home directory:
export AMPL_LICFILE=$HOME/.ampl/ampl.lic
export AMPLKEY_RUNTIME_DIR=$HOME/.ampl
export PATH=/opt/ampl.linux-intel64/:$PATH
and add those definitions to the .bash_profile
or .bashrc
of each user.
Start a new terminal in order to load the new environment variable definitions.
Run the amplkey activate --uuid <license-uuid>
command in the terminal.