Skip to content

Patchy 'front-end' package installation problems using -R- 2.15.1

2 messages · Clive Nicholas, Paul Johnson

#
Greetings, Clive:

Next time, just post about one problem.

I'm answering some specifics down in the middle of your message, but
here's the basic idea. Once you get a "grip" on a fundamental
misconception that is driving your message, the details I give will
seem superfluous to you. It seems to me you are missing the
fundamental big idea.

On Linux, the "install.packages" command inside R does not "load"
packages. Instead, it downloads them and COMPILES them. That requires
software for COMPILING programs.  If your system DOES NOT HAVE the
assumed packages, then the R package installs fail. Read each
individual error message. You need to install more Debian packages on
your system in order for those COMPILES to succeed.  Some uses of
install.packages inside R may succeed if they do not call for fortran
or C compilers, or linkage to other libraries.  But most won't.

That is COMPLETELY different from MS Windows, on which all packages
are "pre-compiled" for you and when you run "install.packages" inside
R, it just downloads and installs the pre-compiled files.

I think this is a character building Linux experience for you. You
learn how to install the requisite Debian software packages and learn
something about compiling software and reading error messages.  If you
were my student, I'd say "keep trying, it is the only way you will
become a well qualified Linux user." In errors below, you will see
your first step is to install fortran and C++ compilers.

Not everybody agrees with me on that. So they do that work for you and
package them as Debian packages.  Dirk Eddelbuettel has worked very
hard to automate R package builds that go into debian packages.  Some
are in the base of Ubuntu.  But there are 1000s more that are
automatically built.  In your output below, I see you get success from
apt-get with the package

r-cran-hmisc

Those are Debian packages that have essentially the same compiled
files in them that you would get if you could compile the packages for
ourself inside R in your system.

I'm unsure of how many Debian packages you will find for your Kubuntu
setup. The shared library versions must match, and if your system
differs from Debian, there will be trouble.  On my Debian system, It
appears I'm drawing R packages from 2 sources.  I have the "ordinary"
distribution channel, plus I have configured a repo file for CRAN
updates.  I think the CRAN updates are vital mainly for R-base itself.
 That's setup like so

$ cat /etc/apt/sources.list.d/cran.list
 deb http://cran.wustl.edu/bin/linux/debian squeeze-cran/

Go read this folder:

http://cran.wustl.edu/bin/linux/debian/squeeze-cran

You see the Debian packages that I get from the R CRAN mirrors.  I
note hmisc is not one of them.  But hmisc is listed among the 100s I
see when I run:

$ apt-cache search cran

So, well, my point is that "R packages" and "Debian packages" may
exist for the same thing, and you can install both, or one, or the
other, but please don't forget that they are not identical because you
have to compile the R packages but the Debian packages are
pre-compiled.  Good luck. see details below.

pj

On Mon, Jul 23, 2012 at 10:26 PM, CLIVE NICHOLAS
<clivenicholas at hotmail.com> wrote:
Read the errors please. The compile cannot find the lapack and blas
development packages.  And fortran (gfortran).  On my Debian system,
for those I have

gfortran
libatlas-dev
libatlas3gf-base
libblas-dev

Your Ubuntu may vary
Read y our error message. "gfortran not found".
Same
This is COMPLETELY IRRELEVANT.  Your OS is missing most of the
required development Debian packages.  Install gfortran and atlas and
blas support and try again. I'm sure you'll also need a C++ compiler
as well.

On the debian pages for R updates,

http://cran.r-project.org/bin/linux/debian

Create a debian apt repostiory file in your system, then run

 apt-get update
 apt-get install r-base r-base-dev