Author Topic: R For Oz/gpe  (Read 7541 times)

Hakkikkt

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • http://
R For Oz/gpe
« on: November 08, 2006, 04:08:24 pm »
Hi,
after several tries and with help of lardman I finally managed to compile R.

R is a software package for statistical computing, more information you find here:
http://www.r-project.org

You can download a binary for testing on OZ/GPE 3.4.5.1 here:
http://people.web.psi.ch/kosakowski/R-zaurus/

The ipk contains the basic R binary, the documentation, the reccomended modules and the gstat module. After installation you will have 70MB less space on your Z. Therefore I recommend to install it on SD or CF. ipkg-link does not work for big packages like R (there is an assigned entry in the bugtracker on this topic already). An easy solution is to set an symbolic link from the installation directory to /usr/local like this:
ln -s /media/card/packages/usr/local /usr/local

Unfortunately opening a graphics window will NOT work with the tiny libx11 included in OZ. You may want to replace the small libx11 with the full version. This will need 10MB of additional space on your root system (or on SD / CF). You will find version of libx11 that works with R at the above mentioned place.

If you need additional R-modules, you will have to compile them on your Z (see Dcoumentation on the R-homepage) and therefore need the native-sdk and several additional packages (see http://people.web.psi.ch/kosakowski/R-zaurus/README).

I tested the binary on my C760 and on qemu (with poky/OE), I have no idea if it works on other models ;-)

Happy computing, Georg
« Last Edit: November 09, 2006, 04:36:43 am by Hakkikkt »

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
R For Oz/gpe
« Reply #1 on: November 09, 2006, 06:56:19 am »
Georg,

Do you have any details of the problems compiling against diet-x11? We'd like to get this fixed (patch R or update diet-x11) so that people don't need to install extra/replacement libs.


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

Hakkikkt

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • http://
R For Oz/gpe
« Reply #2 on: November 09, 2006, 09:10:40 am »
Quote
Georg,

Do you have any details of the problems compiling against diet-x11? We'd like to get this fixed (patch R or update diet-x11) so that people don't need to install extra/replacement libs.


Si
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]

Hoi,
I did not look to deep into the stuff. Compilation of the R x11-library works without problems, if you have libx11-dev installed. When you try to open a x11 window in R it fails without error-messages. It "only" gives a warning about unresolved dependency of "XGetIMValues".  I found something similar here:
[a href=\"https://www.oesf.org/forums/index.php?showtopic=19764&mode=linear]https://www.oesf.org/forums/index.php?showt...764&mode=linear[/url]
and concluded that the "IMV" related things are stripped from the libx11. I did not want to change the R-x11-library, so the easiest way was to work with the full libx11.

It should be possible to find out which additional things should be included to make R working with a stripped libx11. Unfortunately OE does not (yet) work very well on my Suse linux x86_64 box with gcc4, so I took the fast path ;-)

Georg

DrSteve

  • Newbie
  • *
  • Posts: 12
    • View Profile
R For Oz/gpe
« Reply #3 on: May 21, 2007, 02:14:19 pm »
OK, this installs and configures (takes eons) on poodle under current 3.5.4.2-rc0 OZ/GPE, and I set up the symlinks but can't call the executable.  I get

Code: [Select]
-sh:  R:  not found
Thoughts?

Hakkikkt

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • http://
R For Oz/gpe
« Reply #4 on: May 21, 2007, 03:12:45 pm »
Quote
OK, this installs and configures (takes eons) on poodle under current 3.5.4.2-rc0 OZ/GPE, and I set up the symlinks but can't call the executable.  I get

Code: [Select]
-sh:  R:  not found
Thoughts?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=161787\"][{POST_SNAPBACK}][/a][/div]

Hoi,
the executable or R resides in /usr/local/bin .
If this directory is not in your PATH you will not be able to execute R. BTW: R is the only program in this folder on my Z ;-)
So either change your PATH, or set a symbolic link from /usr/local/bin/R to /usr/bin/R.
I hope that helps, Georg

DrSteve

  • Newbie
  • *
  • Posts: 12
    • View Profile
R For Oz/gpe
« Reply #5 on: May 21, 2007, 03:58:58 pm »
Quote
Quote
OK, this installs and configures (takes eons) on poodle under current 3.5.4.2-rc0 OZ/GPE, and I set up the symlinks but can't call the executable.  I get

Code: [Select]
-sh:  R:  not found
Thoughts?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=161787\"][{POST_SNAPBACK}][/a][/div]

Hoi,
the executable or R resides in /usr/local/bin .
If this directory is not in your PATH you will not be able to execute R. BTW: R is the only program in this folder on my Z ;-)
So either change your PATH, or set a symbolic link from /usr/local/bin/R to /usr/bin/R.
I hope that helps, Georg
[div align=\"right\"][a href=\"index.php?act=findpost&pid=161789\"][{POST_SNAPBACK}][/a][/div]

I had to do a set of symlinks for both the .../bin and the .../lib (after which the program runs!), and followed up with your last suggestion for good measure.

Thank goodness for altboot, too, as I can run without ever launching the GUI; guess that saves me some RAM.

Now if I could just keep GPE from losing time!

xjqian

  • Sr. Member
  • ****
  • Posts: 497
    • View Profile
    • http://
R For Oz/gpe
« Reply #6 on: November 30, 2007, 02:58:53 am »
I tried to cross compile R-2.6.0 with OE for the past week but got stuck so far

I compiled the native R-2.6.0 version first.
set R=R-2.6.0 in EXTRA_OECONF to prevent do_configure quiting
use sed to set R_EXE to the native R binary in each makefile

I'm able to compile through until R packages in /src/library, where the following command is issued

$R_EXE --vanilla --slave -f /src/library/base/makebasedb.R

| Error in eval(expr, envir, enclos) :
|   may already be using lazy loading on base
| Calls: local -> eval.parent -> eval -> eval -> eval -> eval
| Execution halted

The error was caused by lazy loading mechanism of the R binary on the host. --vanilla should suppress loading any package upon startup, however, seems there is no way to get around lazy loading (which means assuming a package is loaded). Anybody has idea how to get around this obstacle?
My Blog | 6000L Tosa + sled | is: Angstrom | was: pdaXrom 1.1.0beta1 | was: stock 1.12 rom + no-ffpe fash kernel + X/Qt Debian |
CF GPS (FGPCFCD01) | USB "Prolific 2303" GPS (USB-UG-200) | Socket CF BT rev. H |  USB "Pegasus II" Ethernet (ADM8511) | PocketTop IR kbd | sip:527630@fwd.pulver.com
Todo: OESF wiki | stable VOIP app | usable GPS app |      Wishlist: VOIP + Bluetooth | GPS + Routing Calc