<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Kilian, Miguel and slurm-users<br>
</p>
<pre><font size="+1">As LUA_GLOBALSINDEX has been removed in Lua 5.2 and it's used in slurm-spank-plugins (<a class="moz-txt-link-freetext" href="http://www.lua.org/manual/5.2/manual.html#8">http://www.lua.org/manual/5.2/manual.html#8</a>)
the build of </font><font size="+1">slurm-spank-plugins-lua is failing on redhat8 which uses lua5.3.</font>
<font size="+1"><font size="+1"><i>lua.c: error: ‘LUA_GLOBALSINDEX’ undeclared (first use in this</i><i>function)
</i>><i> lua_pushvalue (script->L, LUA_GLOBALSINDEX);
</i></font>I've made the following patch</font><font size="+1"> for slurm-spank-plugins-lua using this helpfull page: </font>
</pre>
<div class="moz-forward-container"><a class="moz-txt-link-freetext" href="https://stackoverflow.com/questions/28332452/porting-from-lua-5-1-to-5-2">https://stackoverflow.com/questions/28332452/porting-from-lua-5-1-to-5-2</a></div>
<div class="moz-forward-container"><br>
</div>
<div class="moz-forward-container">The patch are still not in
production but at least the lua plugins are now built and loaded
by slurm19 and lua5.3 (redhat8)<br>
</div>
<div class="moz-forward-container"><br>
</div>
<div class="moz-forward-container"> cat
slurm-spank-plugins-0.24-undefined-lua5.3-variable.patch<br>
--- slurm-spank-plugins-0.24.orig/lua/lua.c 2013-03-26
11:48:48.000000000 +0100<br>
+++ slurm-spank-plugins-0.24.work/lua/lua.c 2020-02-12
13:31:03.629012000 +0100<br>
@@ -1045,7 +1045,8 @@<br>
* table.<br>
*/<br>
lua_pushstring (script->L, "__index");<br>
- lua_pushvalue (script->L, LUA_GLOBALSINDEX);<br>
+// lua_pushvalue (script->L, LUA_GLOBALSINDEX);<br>
+ lua_pushglobaltable(script->L);<br>
lua_settable (script->L, -3);<br>
<br>
/* Now set metatable for the new globals table */<br>
@@ -1054,8 +1055,8 @@<br>
/* And finally replace the globals table with the (empty)
table<br>
* now at top of the stack<br>
*/<br>
- lua_replace (script->L, LUA_GLOBALSINDEX);<br>
-<br>
+// lua_replace (script->L, LUA_GLOBALSINDEX);<br>
+ lua_rawseti(script->L,LUA_REGISTRYINDEX,LUA_RIDX_GLOBALS);<br>
return script;<br>
}<br>
<br>
cat slurm-spank-plugins-0.24-fix-cpu-expand-test.patch<br>
diff -rau
slurm-spank-plugins-0.24.orig/lua/lua-schedutils/lua-schedutils.c
slurm-spank-plugins-0.24.work/lua/lua-schedutils/lua-schedutils.c<br>
---
slurm-spank-plugins-0.24.orig/lua/lua-schedutils/lua-schedutils.c
2013-03-26 10:48:48.000000000 +0000<br>
+++
slurm-spank-plugins-0.24.work/lua/lua-schedutils/lua-schedutils.c
2020-02-06 13:06:27.994728000 +0000<br>
@@ -575,7 +575,7 @@<br>
* Push CPU id, either to be used as argument to
function, or<br>
* as an element for the table:<br>
*/<br>
- lua_pushnumber (L, i);<br>
+ lua_pushinteger(L, i);<br>
<br>
/*<br>
* Call function if needed and leave the result on the
stack.<br>
<br>
</div>
<div class="moz-forward-container"><br>
</div>
<div class="moz-forward-container">Hope it helps a minimum.</div>
<div class="moz-forward-container"><br>
</div>
<div class="moz-forward-container">Regards <br>
</div>
<div class="moz-forward-container">Regine<br>
</div>
<div class="moz-forward-container"><br>
</div>
</body>
</html>