gadget-framework / rgadget

Rgadget is a set of useful utilities for gadget
6 stars 12 forks source link

Problem with gadget.iterative in Mac #73

Closed be2lla closed 7 years ago

be2lla commented 7 years ago

Hi,

I am new to Gadget and RGadget and am working on it on a MAC (OS X El Capitan v. 10.11.6). I have managed to install gadget and run it from the terminal no problems. I have also installed RGadget - my sessionInfo is reported below.

I am getting errors when running gadget.iterative: gadget.iterative(rew.sI=TRUE, grouping=list( sind=c('acoustic.like','bias.a0.like')), params.file='params.base', wgts='WGTS')

The error I get is: Error in system(run.string, intern = TRUE, ignore.stderr = ignore.stderr) : error in running command Joining by: comp

and when running debug(gadget.iterative) it reports an error at: callGadget(s = 1, main = paste(wgts, "main.init", sep = "/"), o = paste(wgts, "lik.init", sep = "/"), i = params.file, gadget.exe = gadget.exe) Browse[2]> Error in system(run.string, intern = TRUE, ignore.stderr = ignore.stderr) : error in running command

Any help would be fantastic! Thank you, Betulla

sessionInfo() R version 3.3.1 (2016-06-21) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: OS X 10.11.6 (El Capitan)

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] grid parallel stats graphics grDevices utils datasets methods base

other attached packages: [1] gridExtra_2.2.1 Rgadget_0.5 purrr_0.2.2.2 stringr_1.0.0 lubridate_1.6.0 data.table_1.9.6 [7] dplyr_0.5.0 reshape2_1.4.1 plyr_1.8.4 ggplot2_2.1.0

loaded via a namespace (and not attached): [1] Rcpp_0.12.6 assertthat_0.1 chron_2.3-47 R6_2.1.2 gtable_0.2.0 DBI_0.4-1
[7] magrittr_1.5 scales_0.4.0 stringi_1.1.1 tools_3.3.1 munsell_0.4.3 colorspace_1.2-6 [13] tibble_1.1

bthe commented 7 years ago

Looks to me that either the gadget executable is not installed in the path or some likelihood component has returned a likelihood value of exactly zero (which is usually a sign of something wrong that should be looked at prior to running gadget.iterative). It if is the former there is a quick fix and proper fix. The quick fix to your problem is to set the path to gadget explicitly in R:

.Options$gadget.path <- '/absolute/path/to/gadget'

And you can test whether this works by:

callGadget(s=1,ignore.stderr=FALSE,log='test.log')

This should print what gadget is doing and a detailed debug log can be read from the test.log file.

The proper way to do this: when compiling gadget you do:

make 
sudo make install

which should install gadget to correct directory ( /usr/local/bin/on my mac). However R may in some cases read the environment parameters incorrectly, so you can set the PATH variable explicitly in the .Renviron file in you home directory (create it if needed).

be2lla commented 7 years ago

Thank you Bjarki,

for your prompt reply. I am still not managing, but will keep persevering and will get back to you should I fail.

Betulla

On 1 Aug 2017, at 18:37, Bjarki Þór Elvarsson notifications@github.com wrote:

Looks to me that either the gadget executable is not installed in the path or some likelihood component has returned a likelihood value of exactly zero (which is usually a sign of something wrong that should be looked at prior to running gadget.iterative). It if is the former there is a quick fix and proper fix. The quick fix to your problem is to set the path to gadget explicitly in R:

.Options$gadget.path <- '/absolute/path/to/gadget' And you can test whether this works by:

callGadget(s=1,ignore.stderr=FALSE,log='test.log') This should print what gadget is doing and a detailed debug log can be read from the test.log file.

The proper way to do this: when compiling gadget you do:

make sudo make install which should install gadget to correct directory ( /usr/local/bin/on my mac). However R may in some cases read the environment parameters incorrectly, so you can set the PATH variable explicitly in the .Renviron file in you home directory (create it if needed).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Hafro/rgadget/issues/73#issuecomment-319426028, or mute the thread https://github.com/notifications/unsubscribe-auth/AJmvht1eFBAf4TTPpoXGoSE1XjHo0q1rks5sT1QygaJpZM4Op3Z5.