[vtkusers] can not find some function of R when use R integrated in vtk

Li, Wen wen-li at uiowa.edu
Tue Mar 1 12:17:35 EST 2011


Wes,

It did not work for me.

Just want to make sure I did the right thing.

Before running my program, I did
export "LD_LIBRARY_PATH=/home/lwen/development/StandAloneBRAINSSurfaceStats_build/R-buil
d/library/:$LD_LIBRARY_PATH"

echo $LD_LIBRARY_PATH
it shows:
/home/lwen/development/StandAloneBRAINSSurfaceStats_build/R-build/library/:/usr/
lib64/mpi/gcc/openmpi/lib64

Then I ran my program. Still got the errors and cannot find the function.

Wen

From: Wes Turner [mailto:wes.turner at kitware.com]
Sent: Tuesday, March 01, 2011 9:57 AM
To: Li, Wen
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] can not find some function of R when use R integrated in vtk

I believe that you can (I have multiple R installations on my windows box and it works).  Setting it up is slightly different than on Linux (I only have one R installed on Linux).  I believe the first library encountered in LD_LIBRARY_PATH is the one that gets used preferentially, so if you do something like export "LD_LIBRARY_PATH=preferred_R_installation:$LD_LIBRARY_PATH" it *should* work.

- Wes
On Tue, Mar 1, 2011 at 10:29 AM, Li, Wen <wen-li at uiowa.edu<mailto:wen-li at uiowa.edu>> wrote:
Wes,

I agree. We know that R_HOME is set to be correct so we can do lib path in the same way?

Just my 2 cents:)

BTW: We tested our vtk program with R on a Linux machine.

Thanks,
Wen


From: Wes Turner [mailto:wes.turner at kitware.com<mailto:wes.turner at kitware.com>]
Sent: Tuesday, March 01, 2011 7:48 AM

To: Li, Wen
Cc: vtkusers at vtk.org<mailto:vtkusers at vtk.org>
Subject: Re: [vtkusers] can not find some function of R when use R integrated in vtk

Wen Li,

Thanks for sending this back.  This is undoubtedly something that we will have to understand better as we move forward.  I would expect that it is mainly a matter of cleaning up the environment and setting paths/shared libraries correctly.  Is your machine a windows box, or Linux, or Mac, or ...?  The easiest trick we have found so far, is simply to include the correct R libraries in the directory with the executable.  That is the first place that should be searched.  I will post if we get a better solution.

- Wes
On Tue, Mar 1, 2011 at 8:39 AM, Li, Wen <wen-li at uiowa.edu<mailto:wen-li at uiowa.edu>> wrote:
Wes,

R_HOME was set correctly.

We found out the reason but we don't have a very good solution so far.

It is because we have multiple versions of R installed in the operating system.
When we ran R by vtk, it had trouble finding the correct lib path.

Now we are simply running it on a clean operating system and we don't
see the errors and any problem using functions like read.csv().

It will be very nice if someone can give a better solution.

Best,
Wen Li

From: Wes Turner [mailto:wes.turner at kitware.com<mailto:wes.turner at kitware.com>]
Sent: Monday, February 28, 2011 8:53 AM
To: Li, Wen
Cc: vtkusers at vtk.org<mailto:vtkusers at vtk.org>
Subject: Re: [vtkusers] can not find some function of R when use R integrated in vtk

Do you have the R_HOME variable set to the results of executing "R RHOME"?
- Wes

On Fri, Feb 25, 2011 at 4:49 PM, Li, Wen <wen-li at uiowa.edu<mailto:wen-li at uiowa.edu>> wrote:
Hi, all

We have been trying to use R in vtk to do some statistic analysis for surfaces.

The program was running perfectly when we simply used functions like "mean" and "sum" in our R script.

But when we try to use other functions like "read.csv()", it complains that this function can not be found.

And we see the errors like,

--------------------------------------------------------------------------------------------
Error in identical(env, as.environment(i)) :
  5 arguments passed to .Internal(identical) which requires 2
Error in file(paste(tempdir(), "/Routput.txt", sep = ""), open = "wt+") :
  5 arguments passed to .Internal(file) which requires 4
Error in identical(arg, choices) :
  5 arguments passed to .Internal(identical) which requires 2
-----------------------------------------------------------------------------------------------

Any help or suggestion to solve this problem will be appreciated.

Thank you in advance.

Wen Li
The University of Iowa

_______________________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers



--
Wesley D. Turner, Ph.D.
Kitware, Inc.
Technical Leader
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4920



--
Wesley D. Turner, Ph.D.
Kitware, Inc.
Technical Leader
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4920



--
Wesley D. Turner, Ph.D.
Kitware, Inc.
Technical Leader
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4920
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110301/09305442/attachment.htm>


More information about the vtkusers mailing list