From 00b02fd2346d07903cef1c5f8b2ed24f8736d9d1 Mon Sep 17 00:00:00 2001 From: asmaahassan90 <31959389+asmaahassan90@users.noreply.github.com> Date: Wed, 4 Sep 2019 17:13:58 +0200 Subject: Add gams recipe (#12700) * Add gams recipe * Break down lines to pass lint --- var/spack/repos/builtin/packages/gams/package.py | 37 ++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 var/spack/repos/builtin/packages/gams/package.py 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')) -- cgit v1.2.3-70-g09d2