James-Thorson-NOAA / FishLife

Estimate fish traits for all marine fish species globally
https://james-thorson-noaa.github.io/FishLife/
GNU General Public License v3.0
45 stars 12 forks source link

TMB script issues #6

Closed astaaudzi closed 6 years ago

astaaudzi commented 6 years ago

Hi,

I am trying to run Update_prediction() function, but have issues with the TMB script ("Error in compile(paste0(Version, ".cpp")) : Compilation failed"). The instructions on installation and usage of TMB are not really clear. Do I need to compile TMB myself?

Version: TMB version number TmbDir: Directory containing pre-compiled TMB script RunDir: Directory to use when compiling and running TMB script (different to avoid problems with read-write restrictions)

Also it is not very clear what to do with other arguments, e.g. ParentChild_gz: vector providing index of parent-taxon for every child-taxa Cov_gjj: Array of estimated covariance for each taxonomic group g and trait j Mean_gj: Matrix of Empirical Bayes predictions of traits for each taxonomic group obsCov_jj: a matrix of the observation covariance for new data

The example in the vignette does not use any of those. Should the user supply these arrays and vectors??

thanks Asta

James-Thorson commented 6 years ago

What is the specific error message in terminal when the error occurs? Have you confirmed that TMB is working correctly, e.g., using instructions here: https://github.com/nwfsc-assess/geostatistical_delta-GLMM/wiki/Steps-to-install-TMB?

args(FishLife::Update_prediction) indicates the default values used for those inputs, which are drawn from the fit to the full data set.

astaaudzi commented 6 years ago

Ok, I tried to follow instructions on the link you gave. After installing everything (which seems to work ok) I run the test script.

But after the command compile( paste0(Version,".cpp") ) I get this error message

Error in compile(paste0(Version, ".cpp")) : Compilation failed In addition: Warning message: running command 'make -f "C:/PROGRA~1/R/R-33~1.3/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-33~1.3/share/make/winshlib.mk" -f "C:\Users\astaa\AppData\Local\Temp\Rtmpuijwsx\file578636e5da" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="linear_mixed_model.dll" WIN=64 TCLBIN=64 OBJECTS="linear_mixed_model.o"' had status 127

James-Thorson commented 6 years ago

As stated in that link, status 127 indicates that there is an installation problem with TMB. In the majority of cases, this caused on a windows machine by not properly installing Rtools. I can't offer much more help than that.

What city do you work in? Is there anyone nearby who has TMB experience who can help you get it installed? Or could you use another OS which typically bundles the CPP compiler with the base R install?

astaaudzi commented 6 years ago

OK, I will try to sort this out locally. I live in Tasmania, so probably too far to visit atm :) thanks