configure error installing R-3.3.2 on Ubuntu: checking whether bzip2 support suffices… configure: error: bzip2 library and headers are required

泄露秘密 提交于 2019-11-29 06:25:33

问题


Trying to install R-3.3.2 but when I use $./configure, I keep getting the error:

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


回答1:


It worked for me after:

sudo apt-get install libbz2-dev



回答2:


I have successfully compiled R from source, the following steps need special attention:

  1. install dependent libraries: zlib-1.2.8, bzip2-1.0.6, xz-5.2.2, pcre-8.39, curl-7.52.1. Specifically, to compile bzip2, The Makefile should be modified: original: CC=gcc after modification: CC=gcc -fPIC

  2. pass the library and header file to the configure with proper variables:

    export CPATH=/opt/zlib-1.2.8/include/:/opt/bzip2-1.0.6/include/:/opt/xz-5.2.2/include/:/opt/pcre-8.39/include/

    export LD_LIBRARY_PATH=/opt/zlib-1.2.8/lib/:/opt/bzip2-1.0.6/lib/:/opt/xz-5.2.2/lib/:/opt/pcre-8.39/lib/

    ./configure --prefix=/opt/R/R_soft/ --enable-R-shlib --with-libpth-prefix=/opt/ CPPFLAGS="-I/opt/bzip2-1.0.6/include/ -I/opt/zlib-1.2.8/include/ -I/opt/xz-5.2.2/include/ -I/opt/pcre-8.39/include/ -I/opt/curl-7.52.1/include/" LDFLAGS="-L/opt/xz-5.2.2/lib/ -L/opt/zlib-1.2.8/lib/ -L/opt/bzip2-1.0.6/lib/ -L/opt/pcre-8.39/lib/ -L/opt/curl-7.52.1/lib/"

It seems CPATH and CPPFLAGS is redundant here, I found the CPPFLAGS AND LDFLAGS not worked.




回答3:


First off, are you aware that you can get prebuilt binaries of current R ?

Second, your comment on the bzip2 binary has no bearing on the need for the library R needs to compile and link against.

Third, you can search: apt-cache search bzip2 | grep library would have gotten you there.

Fourth, for all existing packages you can actually install their known build dependencies. But see point one, you probably do not want to build from source.

Fifth, and closing: sudo apt-get install libbz2-dev answers your (narrow) question but you will likely have further issues. There is an entire manual devoted to installing and administering R which has all the answers for you.



来源:https://stackoverflow.com/questions/40639138/configure-error-installing-r-3-3-2-on-ubuntu-checking-whether-bzip2-support-suf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!