That looks reasonable. When you do:<div><br></div><div>ls <span class="Apple-style-span" style="color: rgb(31, 73, 125); font-size: 15px; ">/home/lwen/development/StandAloneBRAINSSurfaceStats_build/R-build/library/</span></div>
<div><span class="Apple-style-span" style="color: rgb(31, 73, 125); font-size: 15px; "><br></span></div><div><span class="Apple-style-span" style="color: rgb(31, 73, 125); font-size: 15px; ">is the correct shared library displayed?</span></div>
<div><span class="Apple-style-span" style="color: rgb(31, 73, 125); font-size: 15px; "><br></span></div><div><span class="Apple-style-span" style="color: rgb(31, 73, 125); font-size: 15px; ">- Wes<br></span><br><div class="gmail_quote">
On Tue, Mar 1, 2011 at 12:17 PM, Li, Wen <span dir="ltr"><<a href="mailto:wen-li@uiowa.edu">wen-li@uiowa.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Wes,</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal">
<span style="font-size:11.0pt;color:#1F497D">It did not work for me.</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Just want to make sure I did the right thing.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Before running my program, I did</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">export "LD_LIBRARY_PATH=/home/lwen/development/StandAloneBRAINSSurfaceStats_build/R-buil</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">d/library/:$LD_LIBRARY_PATH"</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">echo $LD_LIBRARY_PATH</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">it shows: </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">/home/lwen/development/StandAloneBRAINSSurfaceStats_build/R-build/library/:/usr/</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">lib64/mpi/gcc/openmpi/lib64</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Then I ran my program. Still got the errors and cannot find the function.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Wen</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b><span style="font-size:10.0pt">From:</span></b><span style="font-size:10.0pt"> Wes Turner [mailto:<a href="mailto:wes.turner@kitware.com" target="_blank">wes.turner@kitware.com</a>] <br>
<b>Sent:</b> Tuesday, March 01, 2011 9:57 AM</span></p><div><div></div><div class="h5"><br><b>To:</b> Li, Wen<br><b>Cc:</b> <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br><b>Subject:</b> Re: [vtkusers] can not find some function of R when use R integrated in vtk</div>
</div><p></p></div><div><div></div><div class="h5"><p class="MsoNormal"> </p><p class="MsoNormal">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.</p>
<div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">- Wes</p><div><p class="MsoNormal">On Tue, Mar 1, 2011 at 10:29 AM, Li, Wen <<a href="mailto:wen-li@uiowa.edu" target="_blank">wen-li@uiowa.edu</a>> wrote:</p>
<div><div><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Wes,</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">I agree. We know that R_HOME is set to be correct so we can do lib path in the same way?</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Just my 2 cents</span><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">J</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">BTW: We tested our vtk program with R on a Linux machine.</span></p><p class="MsoNormal">
<span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Thanks,</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Wen</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt">From:</span></b><span style="font-size:10.0pt"> Wes Turner [mailto:<a href="mailto:wes.turner@kitware.com" target="_blank">wes.turner@kitware.com</a>] <br><b>Sent:</b> Tuesday, March 01, 2011 7:48 AM</span></p>
<div><div><p class="MsoNormal"><br><b>To:</b> Li, Wen<br><b>Cc:</b> <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br><b>Subject:</b> Re: [vtkusers] can not find some function of R when use R integrated in vtk</p>
</div></div></div><div><div><p class="MsoNormal"> </p><p class="MsoNormal">Wen Li,</p><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">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.</p>
</div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">- Wes</p><div><p class="MsoNormal">On Tue, Mar 1, 2011 at 8:39 AM, Li, Wen <<a href="mailto:wen-li@uiowa.edu" target="_blank">wen-li@uiowa.edu</a>> wrote:</p>
<div><div><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Wes,</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">R_HOME was set correctly.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">We found out the reason but we don’t have a very good solution so far.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">It is because we have multiple versions of R installed in the operating system.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">When we ran R by vtk, it had trouble finding the correct lib path.</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Now we are simply running it on a clean operating system and we don’t</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">see the errors and any problem using functions like read.csv().</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">It will be very nice if someone can give a better solution.</span></p><p class="MsoNormal">
<span style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Best,</span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Wen Li</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b><span style="font-size:10.0pt">From:</span></b><span style="font-size:10.0pt"> Wes Turner [mailto:<a href="mailto:wes.turner@kitware.com" target="_blank">wes.turner@kitware.com</a>] <br>
<b>Sent:</b> Monday, February 28, 2011 8:53 AM<br><b>To:</b> Li, Wen<br><b>Cc:</b> <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br><b>Subject:</b> Re: [vtkusers] can not find some function of R when use R integrated in vtk</span></p>
</div><div><div><p class="MsoNormal"> </p><p class="MsoNormal" style="margin-bottom:12.0pt">Do you have the R_HOME variable set to the results of executing "R RHOME"?</p><div><p class="MsoNormal">- Wes</p></div>
<div><p class="MsoNormal"> </p><div><p class="MsoNormal">On Fri, Feb 25, 2011 at 4:49 PM, Li, Wen <<a href="mailto:wen-li@uiowa.edu" target="_blank">wen-li@uiowa.edu</a>> wrote:</p><div><div><p class="MsoNormal">Hi, all</p>
<p class="MsoNormal"> </p><p class="MsoNormal">We have been trying to use R in vtk to do some statistic analysis for surfaces.</p><p class="MsoNormal"> </p><p class="MsoNormal">The program was running perfectly when we simply used functions like “mean” and “sum” in our R script.</p>
<p class="MsoNormal"> </p><p class="MsoNormal">But when we try to use other functions like “read.csv()”, it complains that this function can not be found.</p><p class="MsoNormal"> </p><p class="MsoNormal">And we see the errors like,</p>
<p class="MsoNormal"> </p><p class="MsoNormal">--------------------------------------------------------------------------------------------</p><p class="MsoNormal">Error in identical(env, as.environment(i)) :</p><p class="MsoNormal">
5 arguments passed to .Internal(identical) which requires 2</p><p class="MsoNormal">Error in file(paste(tempdir(), "/Routput.txt", sep = ""), open = "wt+") :</p><p class="MsoNormal"> 5 arguments passed to .Internal(file) which requires 4</p>
<p class="MsoNormal">Error in identical(arg, choices) :</p><p class="MsoNormal"> 5 arguments passed to .Internal(identical) which requires 2</p><p class="MsoNormal">-----------------------------------------------------------------------------------------------</p>
<p class="MsoNormal"> </p><p class="MsoNormal">Any help or suggestion to solve this problem will be appreciated.</p><p class="MsoNormal"> </p><p class="MsoNormal">Thank you in advance.</p><p class="MsoNormal"> </p><p class="MsoNormal">
Wen Li</p><p class="MsoNormal">The University of Iowa</p></div></div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>_______________________________________________<br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a></p></div><p class="MsoNormal"><br><br clear="all">
<br>
-- <br>Wesley D. Turner, Ph.D.<br>Kitware, Inc.<br>Technical Leader<br>28 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4920</p></div></div></div></div></div></div><p class="MsoNormal"><br><br clear="all">
<br>-- <br>Wesley D. Turner, Ph.D.<br>Kitware, Inc.<br>Technical Leader<br>28 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4920</p></div></div></div></div></div></div><p class="MsoNormal"><br><br clear="all">
<br>-- <br>Wesley D. Turner, Ph.D.<br>Kitware, Inc.<br>Technical Leader<br>28 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4920</p></div></div></div></div></div></div></blockquote></div><br><br clear="all">
<br>-- <br>Wesley D. Turner, Ph.D.<br>Kitware, Inc.<br>Technical Leader<br>28 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4920<br>
</div>