I found the instructions for installing AMPL Community Edition in a non-writeable directory to be somewhat incomplete and confusing. It took me a couple of tries to figure out exactly what had to be where when installing the license. Here’s how I finally got it to work. This way, multiple users on the same machine can share the AMPL software, and each can get their own license.
I installed AMPL on a Linux system in the /opt directory, which is not writeable by normal users. To install the license, I followed these steps:
- Unpack the AMPL tarball into /opt. (This step is done once as root. The remaining steps are done by each user.)
- Define environment variables to point to a writeable directory in my home directory (
export AMPL_LICFILE=${HOME}/.ampl/ampl.lic; export AMPLKEY_RUNTIME_DIR=${HOME}/.ampl
). Add those definitions to your .bash_profile. - Copy the provided license file into the specified location (
cp /opt/ampl.linux-intel64/ampl.lic ${HOME}/.ampl/
). - Run AMPL from the license directory (
cd ${HOME}/.ampl; /opt/ampl.linux-intel64/ampl
) - Run the shell command as described in the installation instructions.
Hope somebody finds that useful.