Menu

Install from source on ML 2010.1

Help
hmhxmu
2010-12-15
2013-01-15
  • hmhxmu

    hmhxmu - 2010-12-15

    I'm a user of Mandriva Linux 2010.1 on an x86_64 desktop.
    ML 10.1 RPM packages provide R 2.11.0 and rkward 0.5.3.

    Unfortunately some recent R packages I use need the upgrade to 2.12.0,
    (and also upgraded rkward since it needed to be reinstalled from source,
    AFAIK) so I needed to compile from source, but this being foreign to me,
    I prefer to keep the system packaged version and rkward as well,
    until the new install is successful.

    I have just installed R version 2.12.0 from source (to /usr/local/bin/R,
    with library location /home/mhudson/R-2.12.0/library/)
    and Rkward from source to version 0.5.4 following
    https://sourceforge.net/apps/mediawiki/rkward/index.php?title=Building_RKWard_From_Source
    and INSTALL guidance, configuring as:

    $ cmake .. -DCMAKE_INSTALL_PREFIX=`kde4-config -prefix` -DR_EXECUTABLE=/usr/local/bin/R -DR_LIBDIR=/home/mhudson/R/x86_64-unknown-linux-gnu-library/2.12

    followed by make and make install.
    Install seemed OK, but there are problems on running rkward (see below)
    related to linking R package libraries. Note also the "R- 2.11.0",
    which is the ML10.1 r-base.

    $ rkward -v
    Qt: 4.6.2
    KDE Development Platform: 4.4.3 (KDE 4.4.3)
    RKWard: 0.5.4


    Installation appears to be complete (unfortunately it is hard to tell in CMake).
    Consider running
        make plugintests
    for some automated functionality tests.
    In case of errors, consult the file 'INSTALL'.


    $ rkward -help
    Usage: rkward    

    Frontend to the R statistics language

    Generic options:
      -help                    Show help about options
      -help-qt                 Show Qt specific options
      -help-kde                Show KDE specific options
      -help-all                Show all options
      -author                  Show author information
      -v, -version             Show version information
      -license                 Show license information
      -                        End of options

    Options:
      -evaluate <Rcode>        After starting (and after loading the specified workspace, if applicable), evaluate the given R code.
      -debug-level <level>     Verbosity of debug messages (0-5)
      -debug-flags <flags>     Mask for components to debug (see debug.h)
      -debugger <command>      Debugger (enclose any debugger arguments in single quotes ('') together with the command)
      -disable-stack-check     Disable R C stack checking

    Arguments:
      File                      R workspace file to open
    $ rkward -v
    Qt: 4.6.2
    KDE Development Platform: 4.4.3 (KDE 4.4.3)
    RKWard: 0.5.4
    $ rkward &
    2817
    $ Error in dyn.load(file, DLLpath = DLLpath, …) :
      unable to load shared library '/usr/local/lib64/R/library/methods/libs/methods.so':
      /usr/local/lib64/R/library/methods/libs/methods.so: undefined symbol: R_tryEvalSilent
    In addition: Warning message:
    package 'methods' was built under R version 2.12.0

    R version 2.11.0 (2010-04-22)
    Copyright (C) 2010 The R Foundation for Statistical Computing
    ISBN 3-900051-07-0

    Any advice would be much appreciated.

    tia

    Malcolm

     
  • hmhxmu

    hmhxmu - 2010-12-15

    supplement: this is how R sees rkward

    $ /usr/local/bin/R

    R version 2.12.0 (2010-10-15)
    Copyright (C) 2010 The R Foundation for Statistical Computing
    ISBN 3-900051-07-0
    Platform: x86_64-unknown-linux-gnu (64-bit)

    R is free software and comes with ABSOLUTELY NO WARRANTY.
    You are welcome to redistribute it under certain conditions.
    Type 'license()' or 'licence()' for distribution details.

      Natural language support but running in an English locale

    R is a collaborative project with many contributors.
    Type 'contributors()' for more information and
    'citation()' on how to cite R or R packages in publications.

    Type 'demo()' for some demos, 'help()' for on-line help, or
    'help.start()' for an HTML browser interface to help.
    Type 'q()' to quit R.

    > library (rkward)

    Attaching package: 'rkward'

    The following object(s) are masked from 'package:graphics':

        plot.new

    The following object(s) are masked from 'package:grDevices':

        dev.off, dev.set, x11, X11

    The following object(s) are masked from 'package:utils':

        menu, select.list

    The following object(s) are masked from 'package:base':

        makeActiveBinding, q, quit, require, setwd, Sys.setlocale

    Malcolm

     
  • Thomas Friedrichsmeier

    Hi!

    Ok, so somehow the wrong version of R, or of RKWard is being used. Mixing several versions of R and RKWard on a single system is possible, but has a whole lot of pitfalls. My first guess is that you have made more that one attempt at compiling and installing RKWard 0.5.4, and now there are several versions of rkward on your system, some of which are broken…

    For diagnostics, try

    which rkward
    

    and

    find /usr -name "rkward"
    

    Also check whether the path returned by

    kde4-config --prefix
    

    looks sensible. (Or, easiest, perhaps, run "make install", again, and look closely, where files are being installed, to).

    The "rkward" command itself is just a small shell script. Please try opening that in a text editor. Around line 4, you will find

    export R_binary=...
    

    Obviously, this should point to the R executable that you specified on the cmake line. If it points to R 2.11.0, instead, it probably belongs to a different installation of RKWard.

    Does any of that provide a useful hint?

    Regards
    Thomas

     
  • hmhxmu

    hmhxmu - 2010-12-15

    Hi Thomas,

    thanks for your comments, indeed I tried a few cmake commands before
    compilation succeded. Here are the results of the prompts you suggested:

    $ which rkward
    /usr/bin/rkward
    $ ls -l /usr/bin/rkward
    -rwxr-xr-x 1 root root 1273 2010-12-15 14:23 /usr/bin/rkward*
    $ find /usr -name "rkward"
    /usr/bin/rkward
    /usr/share/apps/rkward
    /usr/share/doc/rkward
    /usr/share/doc/HTML/en/rkward
    find: `/usr/lost+found': Permission denied
    /usr/lib64/R/library/rkward
    /usr/lib64/R/library/rkward/R/rkward
    $ kde4-config -prefix
    /usr
    (I would have expected /usr/local, ML reserves /usr for its own packages,
    as I read http://wiki.mandriva.com/en/Docs/Basic_tasks/Installing_and_removing_software/Installing_from_source.
    So it appears the previous rkward apps will be overwritten
    ML has the rkward 0.5.3 libraries under /usr/lib64/R/library/rkward/).

    The make install is installing apps to /usr/share/apps/rkward/.

    $ cat /usr/bin/rkward
    #!/bin/sh
    # Shell wrapper for rkward executable.

    export R_binary="/usr/local/bin/R"

    (this looks correct, pointing to my R 2.12.0)

    Maybe the way forward is for me to urpme rkward to remove 0.5.3 as far as possible,
    then redo the cmake configuration with option
    -DCMAKE_INSTALL_PREFIX=/usr/local

    Any thoughts?
    I'll try this tomorrow night.(Aus), its getting late…

    best wishes, and thanks for a great environment.

    Malcolm

     
  • Thomas Friedrichsmeier

    Hi!

    Hm, if the R_binary-variable is set correctly in the starter script, then you should really see R 2.12.0 starting, not R 2.11.0. If you look to the end of this script, it basically just calls

    R CMD /usr/bin/rkward.bin
    

    Perhaps you can try running that on the console, directly, for testing purposes.

    I wonder, whether your installation of R might be a bit broken. Could you try running:

    [/usr/local/bin/]R CMD sh -c 'echo $R_VERSION'
    

    This should print 2.12.0. But I suspect it prints 2.11.0 instead, on your system?

    Maybe the way forward is for me to urpme rkward to remove 0.5.3 as far as possible, then redo the cmake configuration with option -DCMAKE_INSTALL_PREFIX=/usr/local

    Now that you have already overwritten your previous installation, I suggest to keep the /usr-prefix for the time being (at least until we have resolved the current problem). Having several KDE directories can bring new pitfalls, in some cases.

    Regards
    Thomas

     
  • hmhxmu

    hmhxmu - 2010-12-16

    Hi Thomas,

    [mhudson@penguin ~]$ R CMD /usr/bin/rkward.bin
    

    R version 2.11.0 (2010-04-22)
    Copyright (C) 2010 The R Foundation for Statistical Computing
    ISBN 3-900051-07-0

    R is free software and comes with ABSOLUTELY NO WARRANTY.
    You are welcome to redistribute it under certain conditions.
    Type 'license()' or 'licence()' for distribution details.

      Natural language support but running in an English locale

    R is a collaborative project with many contributors.
    Type 'contributors()' for more information and
    'citation()' on how to cite R or R packages in publications.

    Type 'demo()' for some demos, 'help()' for on-line help, or
    'help.start()' for an HTML browser interface to help.
    Type 'q()' to quit R.

    Simultaneously, the RKWard GUI opens with the comment:
    "There was a problem starting the R backend. The following error(s) occurred:
    - The 'rkward' R-library either could not be loaded at all, or not in the correct version. This may lead to all sorts of errors, from single missing features to complete failure to function. The most likely cause is that the last installation did not place all files in the correct place. However, in some cases, left-overs from a previous installation that was not cleanly removed may be the cause.
    You should quit RKWard, now, and fix your installation. For help with that, see http://p.sf.net/rkward/compiling.
    -An unspecified error occurred that is not yet handled by RKWard. Likely RKWard will not function properly. Please check your setup. "

    [mhudson@penguin ~]$ /usr/local/bin/R CMD sh -c 'echo $R_VERSION'
    

    2.12.0

    [mhudson@penguin ~]$ cat /usr/bin/rkward
    

    #!/bin/sh
    # Shell wrapper for rkward executable.

    export R_binary="/usr/local/bin/R"

    ## Start rkward. Running through R CMD to set all the relevant R enviroment variables
    exec $R_binary CMD $debugger $0.bin "$@"

    The problem appears to be with the R-library.
    R was configured with:

    ./configure  --prefix=/usr/lib64/R/R-2.12.0
    

    following R's  R-admin.html

    2.4 Installation
    To ensure that the installed tree is usable by the right group of users, set umask appropriately (perhaps to ‘022’) before unpacking the sources and throughout the build process.
    After

         ./configure
         make
         make check

    (or, when building outside the source, TOP_SRCDIR/configure, etc) have been completed successfully, you can install the complete R tree to your system by typing
         make install

    This will install to the following directories:
    prefix/bin or bindir
    the front-end shell script and other scripts and executables
    prefix/man/man1 or mandir/man1
    the man page
    prefix/LIBnn/R or libdir/R
    all the rest (libraries, on-line help system, …). Here LIBnn is usually ‘lib’, but may be ‘lib64’ on some 64-bit Linux systems. This is known as the R home directory.
    where prefix is determined during configuration (typically /usr/local) and can be set by running configure with the option -prefix, as in

         ./configure -prefix=/where/you/want/R/to/go

    However:

    [root@penguin mhudson]# ls -l /usr/lib64/R/R-2.12.0
    ls: cannot access /usr/lib64/R/R-2.12.0: No such file or directory
    

    Instead I see I created /usr/lib64/R-2.12.0 which remains empty.
    So here is the problem with the R install? what to do?

    hth
    Malcolm

     
  • Thomas Friedrichsmeier

    Hi!

    I believe the "-prefix" is meant to be something like "/usr" or "/usr/local". No idea, why it is not being accepted. You'd need to quizz the R people about that. However, your R appears to end up in /usr/local/, and why not just use that.

    Since

    /usr/local/bin/R CMD sh -c 'echo $R_VERSION'
    

    yields 2.12.0, my previous idea appears to have been wrong. Here's a new idea:

    1) Make sure to configure R with the "-enable-R-shlib" option. The shared library is needed by RKWard. My guess is that you did not use this option when compiling R, but an older version of the shared library is already present on your system, and RKWard picks up that, by accident.
    2) Since you made several attempts to compile RKWard, please remove the file "CMakeCache.txt" in the rkward build directory. It may contain obsolete cached values. Compile RKWard again, after that.

    Regards
    Thomas

     
  • hmhxmu

    hmhxmu - 2010-12-17

    Thomas,

    I tried 1) but it fails to compile:

    [mhudson@penguin R-2.12.0]$ ./configure --enable-R-shlib
    


    /usr/bin/ld: ../appl/libappl.a(ch2inv.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
    ../appl/libappl.a: could not read symbols: Bad value
    collect2: ld returned 1 exit status
    make: ***  Error 1
    make: Leaving directory `/home/mhudson/R-2.12.0/src/main'
    make: ***  Error 2
    make: Leaving directory `/home/mhudson/R-2.12.0/src/main'
    make: ***  Error 1
    make: Leaving directory `/home/mhudson/R-2.12.0/src'
    make: ***  Error 1
    Malcolm

     
  • Thomas Friedrichsmeier

    Hi!

    Ok, so the good news is that we have found the cause of the original problem: You don't have the (right version of the) R shared library. Ideally this would have been detected automatically, while configuring RKWard, but anyway, this is where the problem is at.

    The bad news is that I'm afraid I can't help you much further at this point. You could try adding

    --with-pic
    

    to you ./configure line, but I'm not sure whether this should help. It may be a good idea to take a look at the Mandriva src.rpm for R 2.11.0, and see which configure-flags are being used, there. While trying to find that, I came across this: http://pkgs.org/mandriva-cooker/mandriva-main-release-x86_64/R-base-2.12.0-3mdv2011.0.x86_64.rpm.html . I don't know much about Mandriva, but perhaps this means there is a ready-packaged R 2.12.0, which you could use, after all?

    Regards
    Thomas

     
  • hmhxmu

    hmhxmu - 2010-12-18

    Hi Thomas,

    The bad news is that I'm afraid I can't help you much further at this point.

    I really appreciate the time you have put in on this already, with some success.

    It may be a good idea to take a look at the Mandriva src.rpm for R 2.11.0, and see which configure-flags are being used, there.

    While I found the src.rpm package I don't know how to determine the config-flags of the source. Do I install the RPM, then untar the tgz component, and then search?  It may not be relevant anymore, anyway.

    I came across this: http://pkgs.org/mandriva-cooker/mandriva-main-release-x86_64/R-base-2.12.0-3mdv2011.0.x86_64.rpm.html

    I followed through on this, downloading
    http://mirrors.us.kernel.org/mandriva/Mandrakelinux/devel/2011.0/x86_64/media/main/release/R-base-2.12.0-3mdv2011.0.x86_64.rpm
    and

    http://mirrors.us.kernel.org/mandriva/Mandrakelinux/devel/2011.0/x86_64/media/main/release/lib64lzma5-5.0.0-2mdv2011.0.x86_64.rpm

    from the Mandriva Cooker site, and installing (successfully it appears).
    This writes the R libraries to the standard ML locations.
    Before this I had uninstalled, then re-installed rkward 0.5.3.
    Now:

    [root@penguin R-2.12.0]# R                                                                                                                 
    R version 2.12.0 (2010-10-15)
    Copyright (C) 2010 The R Foundation for Statistical Computing
    ISBN 3-900051-07-0
    Platform: x86_64-mandriva-linux-gnu (64-bit)
    R is free software and comes with ABSOLUTELY NO WARRANTY.
    You are welcome to redistribute it under certain conditions.
    Type 'license()' or 'licence()' for distribution details.
      Natural language support but running in an English locale
    R is a collaborative project with many contributors.
    Type 'contributors()' for more information and
    'citation()' on how to cite R or R packages in publications.
    Type 'demo()' for some demos, 'help()' for on-line help, or
    'help.start()' for an HTML browser interface to help.
    Type 'q()' to quit R.
    > q()
    Save workspace image? [y/n/c]: n
    [root@penguin R-2.12.0]# quit
    bash: quit: command not found
    [root@penguin R-2.12.0]# exit
    exit
    [mhudson@penguin R-2.12.0]$ rkward
    R version 2.12.0 (2010-10-15)
    Copyright (C) 2010 The R Foundation for Statistical Computing
    ISBN 3-900051-07-0
    Platform: x86_64-mandriva-linux-gnu (64-bit)
    R is free software and comes with ABSOLUTELY NO WARRANTY.
    You are welcome to redistribute it under certain conditions.
    Type 'license()' or 'licence()' for distribution details.
      Natural language support but running in an English locale
    R is a collaborative project with many contributors.
    Type 'contributors()' for more information and
    'citation()' on how to cite R or R packages in publications.
    Type 'demo()' for some demos, 'help()' for on-line help, or
    'help.start()' for an HTML browser interface to help.
    Type 'q()' to quit R.
    

    However R still has a problem:

    [mhudson@penguin R-2.12.0]$ R
    R version 2.12.0 (2010-10-15)
    Copyright (C) 2010 The R Foundation for Statistical Computing
    ISBN 3-900051-07-0
    Platform: x86_64-mandriva-linux-gnu (64-bit)
    R is free software and comes with ABSOLUTELY NO WARRANTY.
    You are welcome to redistribute it under certain conditions.
    Type 'license()' or 'licence()' for distribution details.
      Natural language support but running in an English locale
    R is a collaborative project with many contributors.
    Type 'contributors()' for more information and
    'citation()' on how to cite R or R packages in publications.
    Type 'demo()' for some demos, 'help()' for on-line help, or
    'help.start()' for an HTML browser interface to help.
    Type 'q()' to quit R.
    > setwd('/penguin/mhudson/CTC/Rachel/shrinkage')
    Error in setwd("/penguin/mhudson/CTC/Rachel/shrinkage") : 
      cannot change working directory
    

    and for rkward, while the GUI looks OK ,
    a persistent error attends each command:

    setwd('/penguin/mhudson/CTC/Rachel/shrinkage') # R 2.12.0
    Error in eval(expr, envir, enclos) : cannot change working directory
    ls()
     [1] "age"            "aggrisk"        "aggrisk.expd"   "aggrisk.glm"   
     [5] "aggrisk.obsd"   "apparent"       "appMH"          "blood.pressure"
     [9] "cell"           "cholesterol"    "counts"         "d.AD"          
    [13] "dd"             "dd1"            "expd"           "f"             
    [17] "glm.D93"        "j"              "k"              "l"             
    [21] "L"              "lp"             "MI5"            "MI5.glm"       
    [25] "n"              "obsd"           "outcome"        "p"             
    [29] "p2"             "p52"            "p52g"           "p53"           
    [33] "p54"            "pp"             "run5a2"         "run5p2"        
    [37] "rung"           "rung.bw"        "rung1"          "rung10"        
    [41] "rung105"        "rung11"         "rung12"         "rung13"        
    [45] "rung2"          "sex"            "treatment"      "xt"            
    [49] "y"             
    Error: unprotect(): only 1 protected items
    search()
     [1] ".GlobalEnv"        "package:rkward"    "package:stats"    
     [4] "package:graphics"  "package:grDevices" "package:utils"    
     [7] "package:datasets"  "package:methods"   "Autoloads"        
    [10] "package:base"     
    Error: unprotect(): only 1 protected items
    library(lattice)
    Error: unprotect(): only 1 protected items
    

    I'll examine this more tomorrow, if time permits.

    Kind regards,

    Malcolm

     
  • Thomas Friedrichsmeier

    > setwd('/penguin/mhudson/CTC/Rachel/shrinkage')
    Error in setwd("/penguin/mhudson/CTC/Rachel/shrinkage") :
      cannot change working directory

    Interesting. I suppose that directory does exist, and you have permission to enter it? Same problem for any directory (try setwd('/tmp'), for instance?

    Error: unprotect(): only 1 protected items

    Yes, that's the error that you get when using R 2.12.0 with rkward 0.5.3. So you still need to compile rkward 0.5.4, again. However, I am confident that this time it will work, correctly (don't forget to remove CMakeCache.txt in the rkward build directory).

    While I found the src.rpm package I don't know how to determine the config-flags of the source. Do I install the RPM, then untar the tgz component, and then search?  It may not be relevant anymore, anyway.

    I use Debian myself, so I don't know too much about handling RPMs. Perhaps this page http://bradthemad.org/tech/notes/patching_rpms.php is helpful. The instructions for configuring and compiling are in the .spec file that should be contained in the src.rpm.

    Regards
    Thomas

     
  • hmhxmu

    hmhxmu - 2010-12-20

    Hi Thomas

    Interesting. I suppose that directory does exist, and you have permission to enter it?

    Lol. My mistake.

    So you still need to compile rkward 0.5.4, again.

    After uninstalling rkward-0.5.3, removing the cached file and compiling 0.5.4

    [mhudson@penguin build]$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DR_EXECUTABLE=/usr/bin/R
    

    and make install it all just works.
    Everything seemed to work.

    Maybe the simpler option now is to install a new rkward rpm on Mandriva Cooker, see
    http://forum.mandriva.com/en/viewtopic.php?f=86&t=133617&p=839220#p839220
    See Ahmad's earlier response too as to a surer way to install using src rpms
    Its as simple as grabbing the corresponding src.rpm and

    rpmbuild --rebuild /path/to/*.src.rpm
    

    Just to advise that all ended well.

    Thanks again,

    Malcolm

     
  • chak8870

    chak8870 - 2011-04-20

    Hi,

    I seem to have the same problem. I am running ubuntu 10.04 and RKWard. It was working fine some couple of days ago.

    rkward --version
    Qt: 4.6.2
    KDE Development Platform: 4.4.5 (KDE 4.4.5)
    RKWard: 0.5.5.z+0.5.6+test2
    R on the command prompt
    R version 2.13.0 (2011-04-13)
    Copyright (C) 2011 The R Foundation for Statistical Computing
    ISBN 3-900051-07-0
    Platform: i486-pc-linux-gnu (32-bit)
    R is free software and comes with ABSOLUTELY NO WARRANTY.
    You are welcome to redistribute it under certain conditions.
    Type 'license()' or 'licence()' for distribution details.
      Natural language support but running in an English locale
    R is a collaborative project with many contributors.
    Type 'contributors()' for more information and
    'citation()' on how to cite R or R packages in publications.
    Type 'demo()' for some demos, 'help()' for on-line help, or
    'help.start()' for an HTML browser interface to help.
    Type 'q()' to quit R.
    > q()
    Save workspace image? [y/n/c]: n
    /code]
    Advance thanks for any help.
    
     
  • chak8870

    chak8870 - 2011-04-20

    Here is the screenshot.

    As an additional thought I would also like to say that I had Rcmdr installed at the same time. I am not sure whether it is a conflict between two softwares.
    Thanks.