[LU-5418] compile fix for code using readline Created: 25/Jul/14  Updated: 30/Dec/14  Resolved: 26/Aug/14

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.6.0
Fix Version/s: Lustre 2.7.0

Type: Bug Priority: Minor
Reporter: Frank Zago (Inactive) Assignee: Cliff White (Inactive)
Resolution: Fixed Votes: 0
Labels: patch

Issue Links:
Duplicate
duplicates LU-5445 fail to build util/parser.c Closed
duplicates LU-5448 Compilation without libreadline broke... Closed
Related
Severity: 3
Rank (Obsolete): 15069

 Description   

Newer versions of readline have removed (or hidden) CPPFunction, leading to the following compilation issue:

util/parser.c: In function 'init_input':
util/parser.c:308:45: error: 'CPPFunction' undeclared (first use in this function)
         rl_attempted_completion_function = (CPPFunction *)command_completion; 

The affects Ubuntu 14.04.



 Comments   
Comment by Frank Zago (Inactive) [ 25/Jul/14 ]

http://review.whamcloud.com/11231

Comment by Peter Jones [ 28/Jul/14 ]

Landed for 2.7

Comment by Bob Glossman (Inactive) [ 28/Jul/14 ]

The fix recently landed to master, http://review.whamcloud.com/#/c/11231, breaks the build in some newer kernels. In particular there are now some new functions declared unconditionally:

static void noop_int_fn(int unused) { }
static void noop_void_fn(void) { }

These functions are only used in code that is #ifdef HAVE_LIBREADLINE. When building where HAVE_LIBREADLINE is #undef'ed, for example on fc20, this causes build errors and build failure even in client only builds.

Comment by Frank Zago (Inactive) [ 28/Jul/14 ]

Sorry about that I'll send a fix shortly.

Comment by Bob Glossman (Inactive) [ 28/Jul/14 ]

The build failure due to lack of libreadline.so may be caused by rpm changes. In earlier el6 and el7 there wasn't any readline-devel rpm, the required lib was in the readline rpm. If the additional readline-devel rpm is installed on fc20 then libreadline.so is present, HAVE_LIBREADLINE is #define'd, and the build is OK. That said the new libcfs code does fail to build when HAVE_LIBREADLINE is #undef'ed.

Comment by Frank Zago (Inactive) [ 28/Jul/14 ]

http://review.whamcloud.com/11252

Comment by Patrick Farrell (Inactive) [ 04/Aug/14 ]

Putting the actual error messages from the build in here so others can find this more easily (as I failed to):

cc1: warnings being treated as errors
util/parser.c:286: error: 'noop_int_fn' defined but not used
util/parser.c:287: error: 'noop_void_fn' defined but not used
make[5]: *** [libcfsutil_a-parser.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [all-recursive] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.nePJql (%build)

Comment by Bob Glossman (Inactive) [ 04/Aug/14 ]

to correct my earlier comment the readline-devel rpm does exist in el6 & el7 too. just never saw a problem there as all our builder nodes have both readline and readline-devel rpms installed. until the mod lands a simple workaround is to just install the readline-devel rpm. as far as I know that works everywhere.

Comment by Peter Jones [ 26/Aug/14 ]

It looks like the follow on patch has landed to master now

Comment by Gerrit Updater [ 21/Nov/14 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/12447/
Subject: LU-5418 echo: replace lov_stripe_md with lov_oinfo
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: eecdcf3004952f5d3a7126e0d6790c0be82f0a56

Comment by Blake Caldwell [ 30/Dec/14 ]

Could this be merged into b2_6 as well? Ran into this issue building on an Ubuntu 14.04 system with libreadline-dev-6.3-4.

Generated at Sat Feb 10 01:51:19 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.