Although this is an old question and it has some workarounds when you google it, I found a post about building R from source that makes this process easier.
First take a look at Building R from source
The commands you need to run in this post can be summarized as
yum install epel-release
yum install yum-utils # to make yum-builddep command available
yum-builddep R # this command will install all the dependencies for building R from source
# Then under your R source folder run (I'm using R version 3.2.3, so you will want to change the version number in these commands):
./configure --prefix=/opt/R/3.2.3 --enable-R-shlib --with-blas --with-lapack # you can substitute your own target directory for /opt/R/3.2.3
make
make install
This will install R on your CentOS machine successfully. However, instead of having yum-builddep to install the dependence libraries for you, you can manually install these libraries, therefore you can skip those you already have.
If you re-run yum-builddep R
, you will get all the dependencies installed, they are:
--> Already installed : zlib-devel-1.2.7-17.el7.x86_64
--> Already installed : xz-devel-5.2.2-1.el7.x86_64
--> Already installed : 1:valgrind-devel-3.11.0-24.el7.x86_64
--> Already installed : tre-devel-0.8.0-18.20140228gitc2f5d13.el7.x86_64
--> Already installed : 1:tk-devel-8.5.13-6.el7.x86_64
--> Already installed : texinfo-tex-5.1-4.el7.x86_64
--> Already installed : 2:texlive-collection-latexrecommended-svn25795.0-38.20130427_r30134.el7.noarch
--> Already installed : 1:tcl-devel-8.5.13-8.el7.x86_64
--> Already installed : readline-devel-6.2-9.el7.x86_64
--> Already installed : pcre-devel-8.32-15.el7_2.1.x86_64
--> Already installed : pango-devel-1.36.8-2.el7.x86_64
--> Already installed : openblas-devel-0.2.19-4.el7.x86_64
--> Already installed : ncurses-devel-5.9-13.20130511.el7.x86_64
--> Already installed : libtool-2.4.2-22.el7_3.x86_64
--> Already installed : libtiff-devel-4.0.3-27.el7_3.x86_64
--> Already installed : 2:libpng-devel-1.5.13-7.el7_2.x86_64
--> Already installed : libjpeg-turbo-devel-1.2.90-5.el7.x86_64
--> Already installed : libicu-devel-50.1.2-15.el7.x86_64
--> Already installed : libcurl-devel-7.29.0-35.el7.centos.x86_64
--> Already installed : libXt-devel-1.1.4-6.1.el7.x86_64
--> Already installed : libXmu-devel-1.1.2-2.el7.x86_64
--> Already installed : libX11-devel-1.6.3-3.el7.x86_64
--> Already installed : libSM-devel-1.2.2-2.el7.x86_64
--> Already installed : libICE-devel-1.0.9-2.el7.x86_64
--> Already installed : less-458-9.el7.x86_64
--> Already installed : 1:java-1.8.0-openjdk-headless-1.8.0.131-2.b11.el7_3.x86_64
--> Already installed : gcc-objc-4.8.5-11.el7.x86_64
--> Already installed : gcc-gfortran-4.8.5-11.el7.x86_64
--> Already installed : gcc-c++-4.8.5-11.el7.x86_64
--> Already installed : cairo-devel-1.14.2-1.el7.x86_64
--> Already installed : bzip2-devel-1.0.6-13.el7.x86_64
--> Already installed : automake-1.13.4-3.el7.noarch
--> Already installed : autoconf-2.69-11.el7.noarch
As a result you can choose to just install some of these libraries according to what your current libraries are especially if you already installed 'Development Tools' or some other packages.
In my case, I have Oracle JDK installed so I don't need open-jdk installed by yum-builddep, so I removed the open-jdk and the compilation passed without any errors when I set JAVA_HOME correctly.