R-helpers, I'm using system() to run a shell script that uses a library written in C++ to analyze natural language (FreeLing: http://nlp.lsi.upc.edu/freeling). When I run the following code in RStudio (0.97.248) and R.app (1.62) on Max OSX (10.7.5):> cmd <- "analyze -f /usr/local/share/freeling/config/es.cfg --lang es --outf tagged </Users/earlbrown/temp_input.txt" > tagged.text <- do.call(system, args = list(command = cmd, intern = T))I sometimes receive a "Segmentation fault" error: /usr/local/bin/analyze: line 39: 2806 Segmentation fault: 11 $FREELING/bin/analyzer $param Warning message: running command 'analyze -f /usr/local/share/freeling/config/es.cfg --lang es --outf tagged </Users/earlbrown/temp_input.txt' had status 139 and sometimes I receive a "Trace/BPT trap: 5" error: dyld: lazy symbol binding failed: Symbol not found: __ZN6icu_496LocaleD1Ev Referenced from: /usr/local/lib/libfreeling-3.1-alfa1.dylib Expected in: flat namespace dyld: Symbol not found: __ZN6icu_496LocaleD1Ev Referenced from: /usr/local/lib/libfreeling-3.1-alfa1.dylib Expected in: flat namespace /usr/local/bin/analyze: line 39: 2864 Trace/BPT trap: 5 $FREELING/bin/analyzer $param Warning message: running command 'analyze -f /usr/local/share/freeling/config/es.cfg --lang es --outf tagged </Users/earlbrown/temp_input.txt' had status 133 However, when I open a Terminal window and start R there and then run the code I don't get either error message and I get the output I expect. So, the obvious work-around is to simply run my R scripts that use FreeLing (the C++ library) in an R session within Terminal. But, I'm curious to know why RStudio and R.app have problems with it, and if there is anything that I can do to be able to use RStudio and/or R.app when I want to call this C++ library. Here's my info:> sessionInfo()R version 3.0.2 (2013-09-25) Platform: x86_64-apple-darwin10.8.0 (64-bit) locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_3.0.2 Thanks in advance for your help and ideas. Earl Brown ----- Earl K. Brown, PhD Assistant Professor of Spanish (Linguistics) Advisor, TEFL MA Program Department of Modern Languages Kansas State University www-personal.ksu.edu/~ekbrown
Why isn't it as obvious to you as it is to me that this question belongs on the RStudio forum rather than here? --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Earl Brown <ekbrown at k-state.edu> wrote:>R-helpers, > >I'm using system() to run a shell script that uses a library written in >C++ to analyze natural language (FreeLing: >http://nlp.lsi.upc.edu/freeling). When I run the following code in >RStudio (0.97.248) and R.app (1.62) on Max OSX (10.7.5): > >> cmd <- "analyze -f /usr/local/share/freeling/config/es.cfg --lang es >--outf tagged </Users/earlbrown/temp_input.txt" >> tagged.text <- do.call(system, args = list(command = cmd, intern >T)) > >I sometimes receive a "Segmentation fault" error: > >/usr/local/bin/analyze: line 39: 2806 Segmentation fault: 11 >$FREELING/bin/analyzer $param >Warning message: >running command 'analyze -f /usr/local/share/freeling/config/es.cfg >--lang es --outf tagged </Users/earlbrown/temp_input.txt' had status >139 > >and sometimes I receive a "Trace/BPT trap: 5" error: > >dyld: lazy symbol binding failed: Symbol not found: >__ZN6icu_496LocaleD1Ev > Referenced from: /usr/local/lib/libfreeling-3.1-alfa1.dylib > Expected in: flat namespace > >dyld: Symbol not found: __ZN6icu_496LocaleD1Ev > Referenced from: /usr/local/lib/libfreeling-3.1-alfa1.dylib > Expected in: flat namespace > >/usr/local/bin/analyze: line 39: 2864 Trace/BPT trap: 5 >$FREELING/bin/analyzer $param >Warning message: >running command 'analyze -f /usr/local/share/freeling/config/es.cfg >--lang es --outf tagged </Users/earlbrown/temp_input.txt' had status >133 > >However, when I open a Terminal window and start R there and then run >the code I don't get either error message and I get the output I >expect. So, the obvious work-around is to simply run my R scripts that >use FreeLing (the C++ library) in an R session within Terminal. But, >I'm curious to know why RStudio and R.app have problems with it, and if >there is anything that I can do to be able to use RStudio and/or R.app >when I want to call this C++ library. > >Here's my info: >> sessionInfo() >R version 3.0.2 (2013-09-25) >Platform: x86_64-apple-darwin10.8.0 (64-bit) > >locale: >[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 > >attached base packages: >[1] stats graphics grDevices utils datasets methods base > > >loaded via a namespace (and not attached): >[1] tools_3.0.2 > >Thanks in advance for your help and ideas. Earl Brown > >----- >Earl K. Brown, PhD >Assistant Professor of Spanish (Linguistics) >Advisor, TEFL MA Program >Department of Modern Languages >Kansas State University >www-personal.ksu.edu/~ekbrown > >______________________________________________ >R-help at r-project.org mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.
On 13-11-20 10:45 PM, Earl Brown wrote:> R-helpers, > > I'm using system() to run a shell script that uses a library written in C++ to analyze natural language (FreeLing: http://nlp.lsi.upc.edu/freeling). When I run the following code in RStudio (0.97.248) and R.app (1.62) on Max OSX (10.7.5): > >> cmd <- "analyze -f /usr/local/share/freeling/config/es.cfg --lang es --outf tagged </Users/earlbrown/temp_input.txt" >> tagged.text <- do.call(system, args = list(command = cmd, intern = T)) > > I sometimes receive a "Segmentation fault" error: > > /usr/local/bin/analyze: line 39: 2806 Segmentation fault: 11 $FREELING/bin/analyzer $param > Warning message: > running command 'analyze -f /usr/local/share/freeling/config/es.cfg --lang es --outf tagged </Users/earlbrown/temp_input.txt' had status 139That's clearly a bug in the library or in the program that calls it (i.e. "analyze").> > and sometimes I receive a "Trace/BPT trap: 5" error: > > dyld: lazy symbol binding failed: Symbol not found: __ZN6icu_496LocaleD1Ev > Referenced from: /usr/local/lib/libfreeling-3.1-alfa1.dylib > Expected in: flat namespace > > dyld: Symbol not found: __ZN6icu_496LocaleD1Ev > Referenced from: /usr/local/lib/libfreeling-3.1-alfa1.dylib > Expected in: flat namespace > > /usr/local/bin/analyze: line 39: 2864 Trace/BPT trap: 5 $FREELING/bin/analyzer $param > Warning message: > running command 'analyze -f /usr/local/share/freeling/config/es.cfg --lang es --outf tagged </Users/earlbrown/temp_input.txt' had status 133 > > However, when I open a Terminal window and start R there and then run the code I don't get either error message and I get the output I expect. So, the obvious work-around is to simply run my R scripts that use FreeLing (the C++ library) in an R session within Terminal. But, I'm curious to know why RStudio and R.app have problems with it, and if there is anything that I can do to be able to use RStudio and/or R.app when I want to call this C++ library.Presumably R.app and RStudio run the program in a different environment than R does at the command line. One obvious guess is that the standard file handles (stdin, stdout, stderr) would be handled quite differently. Another is that the program may be loaded at a different address, or with a different amount of memory available to it. In any case, it's pretty clearly not a bug in R.app or RStudio. Duncan Murdoch> Here's my info: >> sessionInfo() > R version 3.0.2 (2013-09-25) > Platform: x86_64-apple-darwin10.8.0 (64-bit) > > locale: > [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > loaded via a namespace (and not attached): > [1] tools_3.0.2 > > Thanks in advance for your help and ideas. Earl Brown > > ----- > Earl K. Brown, PhD > Assistant Professor of Spanish (Linguistics) > Advisor, TEFL MA Program > Department of Modern Languages > Kansas State University > www-personal.ksu.edu/~ekbrown > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >