summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobgics <32717310+robgics@users.noreply.github.com>2021-07-14 15:55:28 -0400
committerGitHub <noreply@github.com>2021-07-14 19:55:28 +0000
commitb24ba28774e9e73e2da9265fc0aacacf42ec164e (patch)
tree371055c4e4e4930c996c87c464e972e2085a7bbb
parent369ccb953f602d0af6bfbd85d29e44e291650e80 (diff)
downloadspack-b24ba28774e9e73e2da9265fc0aacacf42ec164e.tar.gz
spack-b24ba28774e9e73e2da9265fc0aacacf42ec164e.tar.bz2
spack-b24ba28774e9e73e2da9265fc0aacacf42ec164e.tar.xz
spack-b24ba28774e9e73e2da9265fc0aacacf42ec164e.zip
Add ampl package (#24105)
-rw-r--r--var/spack/repos/builtin/packages/ampl/package.py58
1 files changed, 58 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/ampl/package.py b/var/spack/repos/builtin/packages/ampl/package.py
new file mode 100644
index 0000000000..6672dc04c1
--- /dev/null
+++ b/var/spack/repos/builtin/packages/ampl/package.py
@@ -0,0 +1,58 @@
+# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+import os
+
+from spack import *
+
+
+class Ampl(Package):
+ """AMPL integrates a modeling language for describing optimization data, variables,
+ objectives, and constraints; a command language for debugging models and analyzing
+ results; and a scripting language for manipulating data and implementing
+ optimization strategies."""
+
+ homepage = "https://ampl.com/"
+ manual_download = True
+
+ # Use the version as you would expect the user to know it, not necessarily the
+ # version as it appears in the file name. To get the checksum, use sha256sum.
+ version('20210226', sha256='d9ffaed591c0491e311a44c2b246d9d81785f6c0b2747a7e32a783e522e18450')
+ version('20190529', sha256='c35a87d85055ae5fe41b68d4b4458f1fdbf80643890501eeaad35b134cb11a2d')
+
+ # Licensing
+ license_required = True
+ license_comment = '#'
+ license_files = ['ampl.lic']
+ license_url = 'https://ampl.com/resources/floating-licenses/installation/'
+
+ resourceList = [
+ # [version, name, destination, placement, url ,sha256sum]
+ ('20210226', 'amplapi', '', 'amplapi', 'file://{0}/amplapi-linux64.2.0.0.zip'.format(os.getcwd()), 'a4abe111f142b862f11fcd8700f964b688d5d2291e9e055f6e7adbd92b0e243a'),
+ ('20210226', 'amplide', '', 'amplide', 'file://{0}/amplide-linux64.3.5.tgz'.format(os.getcwd()), 'c2163896df672b71901d2e46cd5cf1c1c4f0451e478ef32d0971705aaf86d6ac'),
+ ('20190529', 'amplapi', '', 'amplapi', 'file://{0}/amplapi-linux64.2.0.0.zip'.format(os.getcwd()), 'a4abe111f142b862f11fcd8700f964b688d5d2291e9e055f6e7adbd92b0e243a'),
+ ('20190529', 'amplide', '', 'amplide', 'file://{0}/amplide-linux64.3.5.tgz'.format(os.getcwd()), 'c2163896df672b71901d2e46cd5cf1c1c4f0451e478ef32d0971705aaf86d6ac'),
+ ]
+
+ for rsver, rsname, rsdest, rsplace, rsurl, rschecksum in resourceList:
+ resource(when='@{0}'.format(rsver),
+ name=rsname,
+ url=rsurl,
+ sha256=rschecksum,
+ destination=rsdest,
+ placement=rsplace
+ )
+
+ def url_for_version(self, version):
+ return "file://{0}/ampl.linux-intel64.{1}.tgz".format(os.getcwd(), version)
+
+ def setup_run_environment(self, env):
+ env.prepend_path("PATH", self.prefix)
+ env.prepend_path("PATH", join_path(self.prefix, 'amplide'))
+
+ def install(self, spec, prefix):
+ install_tree('.', prefix)
+ install_tree('amplapi', prefix)
+ install_tree('amplide', prefix)