Compile and install RSourceCode in Ubntu14.04LTS

Source: Internet
Author: User
If there is a picture of the truth, first look at the figure: After Ubuntu14.04LTS is released, the system is immediately reinstalled. As a pseudo-Statistics enthusiast, I have to install R software... press ctrl + alt + T to open the terminal and enter sudoapt-getinstallR-base-core .... then habitually... enter R... i'm surprised to hear that Rversion3.0.2 (2013-09-25) -- "FrisbeeSa

If there is a picture with the truth, first look at the picture:

After Ubuntu 14.04 LTS is released, the system is immediately reinstalled. As a pseudo-Statistics enthusiast, I have to install R software...
Press ctrl + alt + T to open the terminal and enter

Sudo apt-get install R-base-core

... And then habitually... Input

R

... I'm surprised To Go.

R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: i686-pc-linux-gnu (32-bit)

R's official website has been updated to 3.1.1, and it is still in 3.0.2. This obsessive-compulsive disorder cannot be tolerated, and many packages need the latest version.
So... open the latest image to download the source code ..
This is the source code of the R-3.1.1. Download and decompress... decompress the command Baidu or .... drag it
The following is the compilation and installation process.
Source code installation is generally composed of three steps: configuration (configure), compilation (make), installation (make install)
Configuration-related knowledge can see here http://www.linuxidc.com/Linux/2015-04/115791.htm

1. Configuration
Switch cd to the source code folder and enter

./Configure -- prefix =/home/pc/program/R-3.1.1 -- enable-R-shlib

Where/home/pc/program/R-3.1.1 is the path to install.
Some people on the Internet say they will prompt
"Configure: error: No F77 compiler found"

The reason is that gfortran is not installed and can be executed.
Sudo apt-get install gfortran

Install.
My prompt is:
Configure: error: -- with-x = yes (default) and X11 headers/libs are not available
Then try to execute
./Configure -- prefix =/home/pc/program/R-3.1.1 -- enable-R-shlib -- with-readline = no -- with-x = no
No error will be reported at this time, but if this is installed, the upper and lower keys may eventually be unrecognizable, and the following dependency packages can be installed if there is no problem with providing historical commands
Sudo apt-get install libreadline6-dev

Sudo apt-get install libxt-dev
Then, you can.
./Configure -- prefix =/home/pc/program/R-3.1.1 -- enable-R-shlib


But there will be a lot of warning... similar to the following:

Configure: WARNING: you cannot build DVI versions of the R manuals

Configure: WARNING: you cannot build DVI versions of all the help pages

Configure: WARNING: you cannot build info or HTML versions of the R manuals

Configure: WARNING: you cannot build PDF versions of the R manuals

Configure: WARNING: you cannot build PDF versions of all the help pages
This is very simple. There is no need to translate... The reason is very simple, that is, there is no compilation tool or software package for compiling dependencies.
But what packages are needed? This is very urgent ....
As a result, Google queries the documents on the CRAN official website and finds that such an existence exists at this location. In this article, we say: (limited space, only the most critical part is captured)

To make these (with 'fullrefman' rather than 'refman'), use
Make pdf to create PDF versionsmake info to create info files (not 'refman' nor 'fullrefman ').
You will not be able to build any of these unless you havemakeinfo version 4.7 or later installed, and for PDF you must have texi2dvi and texinfo. tex installed (which are partof the GNU texinfo distribution but are, especiallytexinfo. tex, often made part of the TeX package inre-distributions ).
The PDF versions can be viewed using any recent PDF viewer: they havehyperlinks that can be followed. the info files are suitable forreading online with Emacs or the standalone GNU infoprogram. the PDF versions will be created using the paper size selectedat configuration (default ISO a4): this can be overridden by settingR_PAPERSIZEon the make command line, or setting R_PAPERSIZE in theenvironment and using make-e. (If re-making the manuals fora different paper size, you shoshould first delete the filedoc/manual/version. texi. the usual value for North America wouldbe 'Letter '.)

Let's take a look at makeinfo, textinfo, and texinfo. tex,
Sudo apt-get install makeinfo .. the system prompts that no software package is found,
Sudo apt-get install texinfo

Enter the package name at the end of installation.
Makeinfo -- help

Only then can you find that the texinfo contains makeinfo. Now you may think this is okay. You can finally compile and generate documents. Maybe you can. Of course, you can do it before I reinstall the system ....
Execute again
./Configure -- prefix =/home/pc/program/R-3.1.1 -- enable-R-shlib
Tip:
Configure: WARNING: you cannot build PDF versions of the R manuals

Configure: WARNING: you cannot build PDF versions of vignettes and help pages
Without showing my mood, I pretended to be calm.
Again, let's look at the English description. It's true. To compile a pdf file, you need texi2dvi, but texi2dvi is in texinfo,
Then I ran it again and again.
Texi2dvi -- help
The prompt is as follows:
You don't have a working TeX binary installed, but the texi2dvi script

Can't proceed without it. If you want to use this script, you have

Install some kind of TeX, for example TeX Live Debian packages. You can do

That with this command:

Apt-get install texlive
... I am confused. The last time texlive was installed, it was impossible for me to compile Chinese characters. But I still need to install it. At least I can compile English ....
After texlive is installed, run the command again.
./Configure -- prefix =/home/pc/program/R-3.1.1 -- enable-R-shlib
The prompt is as follows:
Configure: WARNING: neither inconsolata. sty nor zi4.sty found: PDF vignettes and package manuals will not be rendered optimally
The latex package is latex inconsolata. sty and zi4.sty.
You can install one.
Search inconsolata in CTAN and findInconsolata package

------------------------------------------ Split line ------------------------------------------

Free onHttp://linux.linuxidc.com/

Both the user name and password areWww.linuxidc.com

The specific download directory is in/October 14.04/October 4/October 4/Ubntu LTS compilation and installation R Source Code/

Download Method see http://www.linuxidc.com/Linux/2013-07/87684.htm

------------------------------------------ Split line ------------------------------------------

The default installation location of texlive is/usr/share/texlive/texmf-dist/tex/latex.
To decompress the entire folder of the downloaded package to the above directory, you need the sudo permission to move it to this directory. If the command is not good, you can execute
Sudo nautilus
Open the compressed package in the pop-up File Manager and drag it to the above directory of the pop-up file manager.
Just refresh the page and try again.
Sudo mktexlsr
Or
Sudo texhash
Then execute
./Configure -- prefix =/home/pc/program/R-3.1.1 -- enable-R-shlib
Everything went well !!!! The final judgment is as follows:
R is now configured for i686-pc-linux-gnu

 

Source directory :.

Installation directory:/home/pc/program/R-3.1.1

 

C compiler: gcc-std = gnu99-g-O2

Fortran 77 compiler: gfortran-g-O2

 

C ++ compiler: g ++-g-O2

C ++ 11 compiler: g ++-std = c ++ 11-g-O2

Fortran 90/95 compiler: gfortran-g-O2

Obj-C compiler:

 

Interfaces supported:

External libraries:

Additional capabilities: PNG, JPEG, NLS

Options enabled: shared R library, shared BLAS, R profiling

Recommended packages: yes

2. Compile
Make
Wait... this is a little long...
3. Install
Make install

Note: most of the above commands need to be executed in the R source code folder directory. Of course, if the working directory is always in the source code directory, it is also possible.
The final result is success.

Ubuntu 14.10 http://www.linuxidc.com/Linux/2014-10/108402.htm U disk installation

Ubuntu 14.10 official release download http://www.linuxidc.com/Linux/2014-10/108363.htm

How to upgrade Ubuntu 14.04 LTS to Ubuntu 14.10 http://www.linuxidc.com/Linux/2014-10/108381.htm

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-04/115790.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.