If you are compiling CentOS 6, you will notice that the R source will not compile without a updated version of zlib, pcre, bzip2. libcurl. There is a very good site on how to compile R on Red Hat Linux
Step 1: Compile R-3.4.3
Download R-3.4.2 from The R Project for Statistical Computing
$ tar -zxvf R-3.4.2.tar.gz
$ ./configure --prefix=/usr/local/RH6_apps/R-3.4.3
During configuring…. error surfaced.
checking for zlib.h... yes
checking if zlib version >= 1.2.5... no
checking whether zlib support suffices... configure: error: zlib library and headers are required
Step 2: Compile zlib 1.2.11
a. In your .bashrc
export CFLAGS="-I/usr/local/zlib-1.2.11/include"
export LDFLAGS="-L/usr/local/zlib-1.2.11/lib"
b. Compile zlib-1.2.11
$ wget http://zlib.net/zlib-1.2.11.tar.gz
$ tar -zxvf zlib-1.2.11
$ cd zlib-1.2.11
$ configure --prefix=/usr/local/zlib-1.2.11
Step 3: Compile bzip2
a. Download the bzip2
$wget https://fossies.org/linux/misc/bzip2-1.0.6.tar.gz
$make -f Makefile-libbz2_so
$ make clean
$ make -n install PREFIX=/usr/local/bzip2-1.0.6
$ make install PREFIX=/usr/local/bzip2-1.0.6
Step 4: Compile liblzma or xz
$ wget http://tukaani.org/xz/xz-5.2.3.tar.gz --no-check-certificate
$ tar xzvf xz-5.2.3.tar.gz
$ cd xz-5.2.3
$ ./configure --prefix=/usr/local/xz-5.2.3
$ make -j8
$ make install
Step 5: Compile pcre-8.40
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz
$ tar xzvf pcre-8.40.tar.gz
$ ./configure --prefix=/usr/local/pcre-8.40
$ make -j 8
$ make install
Step 6: Compile libcurl-7.47.1
$ wget https://curl.haxx.se/download/curl-7.47.1.tar.gz --no-check-certificate
$ tar xzvf curl-7.47.1.tar.gz
$ cd curl-7.47.1
$ ./configure --prefix=/usr/local/curl-7.47.1
$ make -j 8
$ make install
Step 7: Update CFLAGS and LDFLAGS
export CFLAGS="-I/usr/local/zlib-1.2.11/include -I/usr/local/bzip2-1.0.6/include -I/usr/local/xz-5.2.3/include -I/usr/local/pcre-8.40/include -I/usr/local/curl-7.47.1/include/curl"
export LDFLAGS="-L/usr/local/zlib-1.2.11/lib -L/usr/local/bzip2-1.0.6/lib -L/usr/local/xz-5.2.3/lib -L/usr/local/pcre-8.40/lib -L/usr/local/curl-7.47.1/lib"
Step 8: Compile R-3.4.3
$ ./configure --enable-utf8 --prefix=/usr/local/R-3.4.2
$ make -j 8
$ make install