Ticket 5263

Summary: PKG_CHECK_EXITS /PKG_CHECK_MODULE for lua library is used in non standard way
Product: Slurm Reporter: Marcin Stolarek <stolarek.marcin>
Component: ContributionsAssignee: Tim Wickberg <tim>
Status: RESOLVED FIXED QA Contact:
Severity: 4 - Minor Issue    
Priority: ---    
Version: 18.08.x   
Hardware: Linux   
OS: Linux   
Site: -Other- Alineos Sites: ---
Atos/Eviden Sites: --- Confidential Site: ---
Coreweave sites: --- Cray Sites: ---
DS9 clusters: --- HPCnow Sites: ---
HPE Sites: --- IBM Sites: ---
NOAA SIte: --- OCF Sites: ---
Recursion Pharma Sites: --- SFW Sites: ---
SNIC sites: --- Linux Distro: ---
Machine Name: CLE Version:
Version Fixed: 17.11.8 18.08.0-pre2 Target Release: ---
DevPrio: --- Emory-Cloud Sites: ---
Attachments: Patch changing the way availability of liblua in version >= 5.1
Possible fix for Centos6

Description Marcin Stolarek 2018-06-05 12:37:55 MDT
Created attachment 7002 [details]
Patch changing the way availability of liblua in version >= 5.1

Trying to compile slurm on Centos 6 with liblua-devel installed  (version 5.1) I've found that configure is unable to find the library. In fact .rpm package contains .pc file, but the way X_AC_LUA is implemented looks for lua-5.1 lua5.1 packages not lua in version greater or equal 5.1. 

Please check attached patch
Comment 1 Marcin Stolarek 2018-06-05 12:46:16 MDT
I've just checked the file history on github... it's probably not that easy
Comment 2 Marcin Stolarek 2018-06-05 13:06:02 MDT
but... the  change I did fixed this on centos 6 and I don't see how it can break other os...
Comment 3 Tim Wickberg 2018-06-07 17:03:18 MDT
Created attachment 7047 [details]
Possible fix for Centos6

Thank you for the submission, but what you propose will definitely break this on other distributions. As you noticed, it's taken quite a bit of back-and-forth to settle on that.

Does this attached alternative, inspired by your version, work for you on Centos6?
Comment 4 Marcin Stolarek 2018-06-08 11:59:57 MDT
I can confirm, your approach is much better and works on CentOS6

config.log:
No package 'lua-5.1' found
configure:24393: $? = 1
configure:24406: checking for lua
configure:24413: $PKG_CONFIG --exists --print-errors "${x_ac_lua_pkg_name}"
configure:24416: $? = 0
configure:24430: $PKG_CONFIG --exists --print-errors "${x_ac_lua_pkg_name}"
configure:24433: $? = 0
configure:24471: result: yes
configure:24482: checking for whether we can link to liblua
configure:24499: gcc -o conftest -g -O2 -pthread -ggdb3 -Wall -g -O1 -fno-strict-aliasing      conftest.c   -llua -lm -ldl   >&5
configure:24499: $? = 0
configure:24507: result: yes lua >= 5.1
Comment 5 Tim Wickberg 2018-06-11 16:52:01 MDT
Thanks for testing, this is in 17.11.8 and on:

commit 1ebf9350fae9e2d5b1f4d99fe14ce24f2291c9d7
Author: Tim Wickberg <tim@schedmd.com>
Date:   Mon Jun 11 16:49:30 2018 -0600

    Improve Lua package detection for older RHEL distros.
    
    RHEL 6 (and related) use lua as the package name, test
    if that package exists with a version >= 5.1 if the other
    tests have already failed.
    
    Bug 5263.