Skip to content

Commit

Permalink
Install AMPL on linux buildslaves
Browse files Browse the repository at this point in the history
  • Loading branch information
fdabrandao committed Aug 31, 2016
1 parent 765548e commit d7c9de1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions support/bootstrap/bootstrap-linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@

check_call(['cp', '-r', '/support/bootstrap/cache', '/var/'])

# Install AMPL.
if x86_64:
install_ampl('amplide.linux64.tgz')
else:
install_ampl('amplide.linux32.tgz')

# Install build tools.
if not installed('cmake'):
# Install python-software-properties or software-properties-common for apt-add-repository.
Expand Down
13 changes: 13 additions & 0 deletions support/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,19 @@ def install_maven(**kwargs):
archive.extractall(install_dir)
add_to_path(os.path.join(install_dir, dir, 'bin', 'mvn'))

# Downloads and installs AMPL.
def install_ampl(filename, **kwargs):
if installed('ampl'):
return
dir = filename.replace('.tgz', '')
url = 'http://ampl.com/demo/' + filename
install_dir = kwargs.get('install_dir', opt_dir)
with Downloader(kwargs.get('download_dir', '.')).download(url) as f:
with closing(tarfile.open(f, 'r:gz')) as archive:
archive.extractall(install_dir)
add_to_path(os.path.join(install_dir, dir, 'ampl'))
add_to_path(os.path.join(install_dir, dir, 'ampl.lic'))

# Install f90cache.
def install_f90cache():
if not installed('f90cache'):
Expand Down

0 comments on commit d7c9de1

Please sign in to comment.