summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorasmaahassan90 <31959389+asmaahassan90@users.noreply.github.com>2019-09-04 17:13:58 +0200
committerAdam J. Stewart <ajstewart426@gmail.com>2019-09-04 10:13:58 -0500
commit00b02fd2346d07903cef1c5f8b2ed24f8736d9d1 (patch)
tree51668258043a13cc0b9fc62861d92f9f5c44b8ba
parentfc9e17289aad538d18154a9e3ee176d5bae3eedd (diff)
downloadspack-00b02fd2346d07903cef1c5f8b2ed24f8736d9d1.tar.gz
spack-00b02fd2346d07903cef1c5f8b2ed24f8736d9d1.tar.bz2
spack-00b02fd2346d07903cef1c5f8b2ed24f8736d9d1.tar.xz
spack-00b02fd2346d07903cef1c5f8b2ed24f8736d9d1.zip
Add gams recipe (#12700)
* Add gams recipe * Break down lines to pass lint
-rw-r--r--var/spack/repos/builtin/packages/gams/package.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/gams/package.py b/var/spack/repos/builtin/packages/gams/package.py
new file mode 100644
index 0000000000..41cfed22e3
--- /dev/null
+++ b/var/spack/repos/builtin/packages/gams/package.py
@@ -0,0 +1,37 @@
+# Copyright 2013-2019 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)
+
+from spack import *
+import os
+
+
+class Gams(Package):
+ """The General Algebraic Modeling System is a high-level modeling system
+ for mathematical optimization. GAMS is designed for modeling and solving
+ linear, nonlinear, and mixed-integer optimization problems."""
+
+ homepage = "https://www.gams.com/"
+ version('27.2', '4f3f3484a4389661e0522a4cfe0289fd', expand=False)
+
+ def url_for_version(self, version):
+ return "file://{0}/linux_x64_64_sfx.exe".format(os.getcwd())
+
+ def setup_environment(self, spack_env, run_env):
+ run_env.prepend_path("PATH", join_path(self.prefix,
+ 'gams{0}_linux_x64_64_sfx'
+ .format(self.version)))
+
+ def install(self, spec, prefix):
+ os.chmod(join_path(self.stage.source_path,
+ "linux_x64_64_sfx.exe"), 0o755)
+ os.system("./linux_x64_64_sfx.exe")
+ install_tree(join_path(self.stage.source_path,
+ 'gams{0}_linux_x64_64_sfx'
+ .format(self.version)),
+ join_path(self.prefix, 'gams{0}_linux_x64_64_sfx'
+ .format(self.version)))
+ install('{0}/gamslice.txt'.format(os.getcwd()),
+ join_path(self.prefix, 'gams{0}_linux_x64_64_sfx'
+ .format(self.version), 'gamslice.txt'))