Skip to content

bzip2 configure error

3 messages · Duncan Murdoch, Simon Urbanek

#
I'm trying to build R-devel in Catalina for the first time in a few 
weeks, and configure is dying with this error:

  checking whether bzip2 support suffices... configure: error: bzip2 
library and headers are required

I tried a Homebrew install of bzip2, and it didn't help.

When I look in config.log, I see this:


configure:45424: checking if bzip2 version >= 1.0.6
configure:45452: gcc -o conftest  -g -O2 -I/usr/local/opt/libffi/include 
  -L/usr/local/opt/libffi/lib conftest.c -lbz2 -lz -licucore -ldl -lm 
-liconv >&5
conftest.c:250:11: warning: initializing 'char *' with an expression of 
type 'const char *' discards qualifiers 
[-Wincompatible-pointer-types-discards-qualifiers]
     char *ver = BZ2_bzlibVersion();
           ^     ~~~~~~~~~~~~~~~~~~
conftest.c:251:5: error: implicitly declaring library function 'exit' 
with type 'void (int) __attribute__((noreturn))' 
[-Werror,-Wimplicit-function-declaration]
     exit(strcmp(ver, "1.0.6") < 0);
     ^
conftest.c:251:5: note: include the header <stdlib.h> or explicitly 
provide a declaration for 'exit'
conftest.c:251:10: error: implicitly declaring library function 'strcmp' 
with type 'int (const char *, const char *)' 
[-Werror,-Wimplicit-function-declaration]
     exit(strcmp(ver, "1.0.6") < 0);
          ^
conftest.c:251:10: note: include the header <string.h> or explicitly 
provide a declaration for 'strcmp'
1 warning and 2 errors generated.


Suggestions for fixing this?

Duncan Murdoch
1 day later
#
I seem to have got past this error by reinstalling Xcode.  I'm not sure 
what went wrong with the old install; I'm pretty sure I did an R-devel 
build since installing Catalina.

Duncan Murdoch
On 28/08/2020 10:41 a.m., Duncan Murdoch wrote:
#
Duncan,

We have a bunch of bugs in configure (on all platforms) when used with -Werror which is default for some Apple compiler builds recently, the one below is just one for them (failing to include stdlib.h and string.h in the test). It may be worth filing a bug report, this should be a reasonably straight-forward task for someone to supply a patch to go through with -Werror and fix them.

Cheers,
Simon