installing R (statistical computing language) (SOLVED)

Booting, installing, newbie
Post Reply
Message
Author
acaza
Posts: 22
Joined: Thu 12 Apr 2007, 00:40

installing R (statistical computing language) (SOLVED)

#1 Post by acaza »

i'm running 2.15CE and trying to install R using Puppy Software Installer. i installed all the dotpups associated with R, but R fails to run.

the error says that librealine.so.4 is the problem. and i think it should be. when i go to /usr/lib/readline.so.4 it is linked to libreadline.so.4.3 which does not exist. i have libreadline.so.5 and libreadline.so.5.1 instead.

i'm guessing this an easy fix. i either need to edit the simlink libreadline.so.4 to connect to one of the ones i have, or else i need to tweak R to go for looking for libreadline.so.5.1 in the first place.

but i have no idea how to do either. can anyone help?

thanks

arran
Last edited by acaza on Fri 04 May 2007, 16:28, edited 1 time in total.
User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#2 Post by MU »

acaza
Posts: 22
Joined: Thu 12 Apr 2007, 00:40

installing R

#3 Post by acaza »

MU, you solved the first problem. i installed the dotpup you pointed me at, and R now runs.

however, it doesn't run well. when i tried to use it to do some things i need, i got this error:

unable to load shared library '/usr/lib/R/library/tcltk/libs/tcltk.so': libtcl8.4.so: cannot open shared object file: No such file or directory

i presume i need to install this as well, but when i search for "libtc" in the software installer i get nothing. i tried installing tcl-8.4 with the installer, in the hope that this would solve it. what it did was change the error to this:

unable to load shared library '/usr/lib/R/library/tcltk/libs/tcltk.so': libtk8.4.so: cannot open shared object file: No such file or directory

i installed tcltk-8.3, but that didn't help (not surprising, given the error is about 8.4). so i installed "tcltk8.4 with version choose." i tried using the chooser to switch versions. i think 8.5 is standard. i changed to 8.4-TLS, but got the same error about libtk8.4. a search for "libtk" in the installer gets me nothing, so i'm once again stuck.

any help welcome. thanks
User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#4 Post by MU »

unable to load shared library '/usr/lib/R/library/tcltk/libs/tcltk.so': libtk8.4.so: cannot open shared object file: No such file or directory
The Tcl/Tk dotpups usually install to
/usr/lib/

If R was compiled with the option to use Tcl/Tk in a subfolder of R, then you had to create symbolic links or copy the files there.

Example:
you installed a Tcl/Tk 8.4 dotpup.
If it installed for example
/usr/lib/tcltk.so
Then you could create a symlink with this command:
ln -s /usr/lib/tcltk.so /usr/lib/R/library/tcltk/libs/tcltk.so
This just works, if the targetfolder '/usr/lib/R/library/tcltk/libs/' already exists.
If it does not exist yet, you must create it first.

Mark
acaza
Posts: 22
Joined: Thu 12 Apr 2007, 00:40

trouble running R

#5 Post by acaza »

thanks to MU/Mark's help, i've got R running, but to make it useful, i need to install additional R packages. i'm almost there on it, but i've hit a weird error. this is what i've done

(note: i'm a newbie's newbie, so i may be missing something obvious. also, this is using Puppy 2.14 multisession, which is my current OS.)

1. download all items in R2.4.0 file at http://dotpups.de/dotpups/

2. install them
click on downloaded dotpups
R.2.4.0 (just acknowledge the message about the link it creates)
lib2c
less (i agreed to overwrite /usr/bin/less)
menu > setup > puppy package manager > PETget package manager > 2nd button (about installing downloaded packge)
navigate to the "alien.packages" file i downloaded and select it

3. download: http://noforum.de/dotpups/libreadline-so-4.pup
click on it to install
(my attempted explanation: R created a link to the libreadline.so.4 library, but that didn't exist in my puppy. i guess it's a dependency that got missed?)

4. R was now running for me
menu > utility > Rxvt terminal emulator
type: R [just the letter, must be capitalized]

however, i needed R functions that weren't already installed. i get these with the command, inside R. "install.packages." this signals R to download and compile files. to do that, my puppy needed the development tools to be able to compile.

5. go to http://puppylinux.org/wikka/Compiling and get what you need
for me, this was devx for 2.14

if i'd been running from live-CD with a pup_sav file, i guess i would just load this sfs file like any other, but i'm trying to do this in multi-session DVD, so i had to load the sfs file on the fly. this involved
downloading the devx_214.sfs file
saving it on HARD DRIVE (i don't know enough to say why, but the commands below won't work if i save the dev_214.sfs file in ramdisk)
open a terminal in the directory where you saved the file (right click > window > terminal here)
type these commands into the terminal:
# mkdir mntpt
# losetup /dev/loop2 devx_004.sfs
# mount -t squashfs /dev/loop2 mntpt
# cp -a --remove-destination mntpt/* /

after this i tried to install packages in R, and received this error:

i586-mandrake-linux-gnu-gcc -I/usr/lib/R/include -I/usr/local/include -D__NO_MATH_INLINES -mieee-fp -fPIC -O2 -fomit-frame-pointer -pipe -march=i586 -mcpu=pentiumpro -c agexact.c -o agexact.o
make: i586-mandrake-linux-gnu-gcc: Command not found
make: *** [agexact.o] Error 127
ERROR: compilation failed for package 'survival'


i have no idea what that means, or what i should do next. any ideas?

thanks

arran
User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#6 Post by MU »

It seems you just ran "make", what seems to use the configuration of the guy who wrote the application.
To create a new configuration for Puppy, you might have to run:

./configure
make clean
make
make install

If you still get errors, please post them here, and also a link to the tools you want to compile.
Mark
acaza
Posts: 22
Joined: Thu 12 Apr 2007, 00:40

#7 Post by acaza »

Mark,

just let me be sure i've given you enough info, and that i understand your instructions.

as i said above, R runs, and i used a native R function, "update.packages." this function searches the CRAN database for updates to the packages, then automatically downloads and installs them, all within R. this requires use of the make command, i guess, since R initially gave an error about make failing. i didn't actually type any make commands myself; R did it..

does this change your repsonse? or should i understand your reply to describe something that i need to do before make can work on my system? if this is the case, does it matter which directory the terminal is in when i run the commands you gave?

thanks (sorry for my complete ignorance about compiling/making)

arrab
aspiring hacker trapped in the mind of a linux noob, using Puppy 2.14 multisesson DVD on Dell XPS M1210
User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#8 Post by MU »

I see, so the R scripts do not run configure themselves.

You could try to fool R in believing, that the mandrake-gcc is on your system.
ln -s /usr/bin/gcc /usr/bin/i586-mandrake-linux-gnu-gcc

This creates a symlink to puppys gcc.

This might work (if you use devx_214.sfs), but there is no guarantee, as there might miss more.

Mark
acaza
Posts: 22
Joined: Thu 12 Apr 2007, 00:40

#9 Post by acaza »

Mark,

Thanks for this. I'd be happy to give it a try, but I can't seem to download the R dotpup anymore. Since I use a multisession DVD and have no idea what I'm doing, I usually don't save failed sessions. So each time I try to install R, I start from scratch. But today, I can't download it. I get a "file integrity error" whenever I try to run the R-2.4.0.pup. And it's just that one. The other dotpups for R (lib, less2gc) have fine integrity.

I'll try again tomorrow to see if I can get a working download.
aspiring hacker trapped in the mind of a linux noob, using Puppy 2.14 multisesson DVD on Dell XPS M1210
acaza
Posts: 22
Joined: Thu 12 Apr 2007, 00:40

#10 Post by acaza »

Woo Hoo!!

That seems to have done the trick. At least I was able to successfully use the "update.packages" function.

I'll put all this together in HOW TO. (here: http://murga-linux.com/puppy/viewtopic.php?t=17826)

Thanks Mark.

(though i hit one other snag using R. i'll make the question abou that a new thread)
aspiring hacker trapped in the mind of a linux noob, using Puppy 2.14 multisesson DVD on Dell XPS M1210
Post Reply