Installing a license when AMPL is read-only

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:

  1. Unpack the AMPL tarball into /opt. (This step is done once as root. The remaining steps are done by each user.)
  2. 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.
  3. Copy the provided license file into the specified location (cp /opt/ampl.linux-intel64/ampl.lic ${HOME}/.ampl/).
  4. Run AMPL from the license directory (cd ${HOME}/.ampl; /opt/ampl.linux-intel64/ampl)
  5. Run the shell command as described in the installation instructions.

Hope somebody finds that useful.

1 Like

Hi @cumthsc,

Thank you for the feedback. We have just updated the instructions (How to install AMPL — AMPL Resources) for read-only instructions for the read-only installations based on what you mentioned. We added the following instructions:

  1. Unpack the AMPL tarball into /opt as root user. The executables should then be at
    /opt/ampl.linux-intel64/.
  2. For each user that wants to use this AMPL installation with his own license:
    1. 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.
    2. Start a new terminal in order to load the new environment variable definitions.
    3. Run the amplkey activate --uuid <license-uuid> command in the terminal.