LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-29-2017, 03:23 AM   #1
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Rep: Reputation: 55
cannot compile R with readline on a linux cluster


Hello,
I am trying to install R-3.4.1 on a linux cluster. I get the following error message:
Code:
checking readline/history.h usability... yes
checking readline/history.h presence... yes
checking for readline/history.h... yes
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking for rl_callback_read_char in -lreadline... no
checking for main in -lncurses... no
checking for main in -ltermcap... no
checking for main in -ltermlib... no
checking for rl_callback_read_char in -lreadline... no
configure: error: --with-readline=yes (default) and headers/libs are not available
As you can see, the R configure script finds the header files, but something happens with the rl_callback_read_char. Here is more info on this from the config.log:
Code:
configure:22995: checking for rl_callback_read_char in -lreadline
configure:23020: mpicc -g -o conftest -O2 -fPIC -I/home/giessen/ivanov/build/packages/usr/include -I/home/giessen/ivanov/build/packages/usr/include/readline -I/home/giessen/ivanov/build/packages/usr/include -I/home/giessen/ivanov/build/packages/usr/include/readline -L/home/giessen/ivanov/build/packages/usr/lib64 -L/home/giessen/ivanov/build/packages/lib64 conftest.c -lreadline   >&5
/home/giessen/ivanov/build/packages/usr/lib64/libreadline.so: undefined reference to `PC'
/home/giessen/ivanov/build/packages/usr/lib64/libreadline.so: undefined reference to `tgetflag'
/home/giessen/ivanov/build/packages/usr/lib64/libreadline.so: undefined reference to `tgetent'
/home/giessen/ivanov/build/packages/usr/lib64/libreadline.so: undefined reference to `UP'
/home/giessen/ivanov/build/packages/usr/lib64/libreadline.so: undefined reference to `tputs'
/home/giessen/ivanov/build/packages/usr/lib64/libreadline.so: undefined reference to `tgoto'
/home/giessen/ivanov/build/packages/usr/lib64/libreadline.so: undefined reference to `tgetnum'
/home/giessen/ivanov/build/packages/usr/lib64/libreadline.so: undefined reference to `BC'
/home/giessen/ivanov/build/packages/usr/lib64/libreadline.so: undefined reference to `tgetstr'
collect2: error: ld returned 1 exit status
I have the readline-6.3 library installed. Any suggestions will be appreciated.

Best regards,
Martin
 
Old 08-29-2017, 05:58 AM   #2
ppr:kut
Slackware Contributor
 
Registered: Aug 2006
Location: Netherlands
Distribution: Slackware
Posts: 631

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
You need to link with a terminal library, either -ltinfo or -lncurses
 
Old 08-29-2017, 06:25 AM   #3
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
That doesn't sound right. Surely libreadline should already be linked against those, or resolved dynamically at runtime by ld.so?

Code:
test@ws1:/tmp$ cat readline.c 
#include <stdio.h>
#include <readline/readline.h>
#include <readline/history.h>

int main(int argc, char *argv[])
{
  char *p;
  p = readline("hello:");

  return 0;
}
test@ws1:/tmp$ cc readline.c -lreadline && ./a.out
hello:fjfjfjf
test@ws1:/tmp$
but then, readline is crappy enough to require you to include stdio.h rather than including its dependency within its own readline.h, so who knows what other shittiness lurks within.
 
Old 08-29-2017, 06:38 AM   #4
ppr:kut
Slackware Contributor
 
Registered: Aug 2006
Location: Netherlands
Distribution: Slackware
Posts: 631

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
That depends on your system. On slackware that wasn't the case for a very long time. I *think* this was recently changed in -current, but not 100% sure. On 14.2 and older you definitely need to link manually.

However, checking the configure output, R already tries to do that automatically and just doesn't find a suitable option. Seems ncurses isn't installed.
 
2 members found this post helpful.
Old 08-29-2017, 07:31 AM   #5
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Original Poster
Rep: Reputation: 55
Thank you all very much,
especially to ppr:kut. Installing ncurses solved the problem.

Best regards,
Martin
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Patch for readline.SlackBuild to include rlfe (ReadLine Fron-End) tfonz Slackware 0 10-22-2016 11:45 AM
Slack64; trying to compile libparted = "error: GNU Readline could not be found" GrapefruiTgirl Linux - Software 9 01-26-2010 12:30 PM
Where is readline on Linux? endfx Linux - Software 4 02-06-2008 01:43 PM
readline compile feetyouwell Programming 1 10-06-2004 06:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration