I already read about this error and solutions in some forums, but i don't know what is happening.
I have this error compiling R (using GCC 12.2.0):
checking for readline/history.h... 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 -ltinfo... 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
I installed readline in my folder (I'm working on an HPC):
- Lib folder: /scratch/users/duca/local/readline/8.2/lib/
- Include folder: /scratch/users/duca/local/readline/8.2/include/
The libreadline.so, libreadline.so.8 and libreadline.so.8.2 have the "rl_callback_read_char" symbol.
$ nm /scratch/users/duca/local/readline/8.2/lib/libreadline.so | grep rl_callback_read_char
0000000000036e40 T rl_callback_read_char
0000000000036e40 t rl_callback_read_char.localalias
$ nm /scratch/users/duca/local/readline/8.2/lib/libreadline.so.8 | grep rl_callback_read_char
0000000000036e40 T rl_callback_read_char
0000000000036e40 t rl_callback_read_char.localalias
$ nm /scratch/users/duca/local/readline/8.2/lib/libreadline.so.8.2 | grep rl_callback_read_char
0000000000036e40 T rl_callback_read_char
0000000000036e40 t rl_callback_read_char.localalias
I exported the environment variables:
export LD_RUN_PATH=$LD_RUN_PATH:/scratch/users/duca/local/readline/8.2/lib
I used the LDFLAGS and CPPFLAGS in the configure (command line):
./configure LDFLAGS="-L/scratch/users/duca/local/readline/8.2/lib/" CPPFLAGS="-I/scratch/users/duca/local/readline/8.2/include/" --prefix=/scratch/users/duca/local/R/4.2.2
But, the error keeps popping up.
I know the "--with-readline=no" parameter could be a solution, but I don't want to take the easy way out (and more errors like this could happen again).
Can someone help me? What am I doing wrong?
Thanks.