summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Oxberry <goxberry@gmail.com>2018-02-13 23:40:47 -0800
committerMassimiliano Culpo <massimiliano.culpo@gmail.com>2018-02-14 08:40:47 +0100
commit8766daf9de5b9879fca32aedac849d446fe1000e (patch)
treeecfdeb8f080505897107da8e05b82a6053f286fe
parent5bb18c79bfdc08b805d597608658ad4dc5def765 (diff)
downloadspack-8766daf9de5b9879fca32aedac849d446fe1000e.tar.gz
spack-8766daf9de5b9879fca32aedac849d446fe1000e.tar.bz2
spack-8766daf9de5b9879fca32aedac849d446fe1000e.tar.xz
spack-8766daf9de5b9879fca32aedac849d446fe1000e.zip
ipopt: fix lmod global name 'prefix' undefined bug (#7224)
Running `spack module refresh -m lmod --delete-tree -y` throws the following warning: ```console ==> Warning: Could not write module file [/Users/oxberry1/spack/share/spack/lmod/darwin-sierra-x86_64/openblas/0.2.20-ibhtl5q/clang/5.0.1/ipopt/3.12.9.lua] ==> Warning: --> global name 'prefix' is not defined <-- ``` This warning arises because the variable expansions in `spack.modules.BaseFileWriter` occur at module/package scope. Even though `prefix` is an argument to `install` methods in e.g., `MakefilePackage`, so using this argument within package methods is legal, doing so defeats the introspection logic in `spack.modules.BaseFileWriter`. Replacing `prefix` with `self.prefix` resolves the problem, because the introspection logic in `spack.modules.BaseFileWriter` can use introspection to query IPOPT's prefix.
-rw-r--r--var/spack/repos/builtin/packages/ipopt/package.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/ipopt/package.py b/var/spack/repos/builtin/packages/ipopt/package.py
index 43879c2cad..da8f798908 100644
--- a/var/spack/repos/builtin/packages/ipopt/package.py
+++ b/var/spack/repos/builtin/packages/ipopt/package.py
@@ -78,7 +78,7 @@ class Ipopt(AutotoolsPackage):
lapack_lib = spec['lapack'].libs.ld_flags
args = [
- "--prefix=%s" % prefix,
+ "--prefix=%s" % self.prefix,
"--with-mumps-incdir=%s" % mumps_dir.include,
"--with-mumps-lib=%s" % mumps_libcmd,
"--enable-shared",