Comments (8)
@taylori, are you willing to poke around to see how to disable these messages during compilation?
from vast.
Warnings remain after updating to VAST_v4_4_0 and R 3.4.1 (other settings versions remain as noted in original post).
A bit of research leads me to see for 4 possible options for dealing with the warnings during the compiling step. So far, I've only figured out how to implement the first option.
- Ignore the warnings (likely best if I'm the only one seeing them)
- Add a
flags
or...
input toBuild_TMB_Fn
that would be passed to theflags
input in TMB'scompile
function that might allow the user to suppresses warnings based on commands here: https://gcc.gnu.org/onlinedocs/gcc-3.4.4/gcc/Warning-Options.html - Change my
Makevars
file (or some Windows equivalent), based on this comment by @kaskr: kaskr/adcomp#169 (comment). But I'm not sure where this file would be located (in directory for R?, TMB?, VAST?) - Change the syntax of the VAST code being compiled so that these warnings aren't created. They all are related to the following categories [-Wparentheses], [-Wunused-variable], [-Wmaybe-uninitialized].
from vast.
from vast.
@taylori
I see these warnings too. Better to fix the code - it's easy:
- Update - use next suggestion instead ! All occurences like this
if( Options_vec(7)==0 & Options_vec(0)==0 ){
should be changed to
if( (Options_vec(7)==0) & (Options_vec(0)==0) ){
- Search replace
&
(bitwise operator) by&&
(logical operator). Likewise change|
to||
. - The
unused variable ‘n_k’ [-Wunused-variable]
is solved by removingDATA_INTEGER(n_k);
as it is not needed. - Same with
Most of these temporaries aren't needed. Change to
VAST_v4_0_0.cpp:321:9: warning: unused variable ‘j’ [-Wunused-variable] int i,j,v,t,s,c,y,z;
int i,t,c;
from vast.
Thanks @kaskr for your quick response. It certainly sounds more satisfying to fix the underlying cause of the warnings.
@James-Thorson, if you choose to go forward with the suggestion from @kaskr to fix the code (option 4 in my list), let me know if you want help. I'm can make a first attempt and create a pull request for these changes, but you would want to make sure to review the changes and do some testing to make sure nothing broke in the process.
Also, I'm not sure what your workflow is for the VAST .cpp files. Would you change just the most recent, some range of files, or create a new file in the series? This shouldn't change any functionality, so probably just changing the most recent would be adequate.
from vast.
from vast.
All but 1 of the warnings go away after addition of changes suggested by @kaskr in commit 4334903.
The remaining warning is
VAST_v4_1_0.cpp: In function 'tmbutils::matrix<Type> gmrf_by_category_nll(int, int, int, int, Type, tmbutils::array<Type>, tmbutils::array<Type>, tmbutils::vector<Type>, density::GMRF_t<scalartype>, Type&) [with Type = double]':
VAST_v4_1_0.cpp:126:71: warning: 'logtau' may be used uninitialized in this function [-Wmaybe-uninitialized]
gmrf_sc = (gmrf_input_sf.matrix() * L_cf.transpose()) / exp(logtau);
^
It's easier to ignore 1 warning than 83, so I have no problem with it remaining, but it's also likely an easy fix for someone with more C++ experience.
Code seems to work fine though I didn't do a before/after comparison. Initial rows of index produced by single species example are as follows:
> pander::pandoc.table( Index$Table[,c("Year","Fleet","Estimate_metric_tons","SD_log","SD_mt")] )
--------------------------------------------------------
Year Fleet Estimate_metric_tons SD_log SD_mt
------ ------- ---------------------- --------- --------
1982 1 2850224 0.08607 191971
1983 1 6748152 0.08629 447873
Will now create a pull request.
from vast.
This is now fixed in the development branch using VAST_v4_1_0 and higher version numbers.
from vast.
Related Issues (20)
- Example Code Model Structure Errors
- Effect.fit_model new error on latest version of VAST HOT 19
- (www.github.com/james-thorson/VAST/examples)is not working HOT 2
- linear-predictor-specific covariance matrices HOT 7
- Tweedie causes the R bomb
- How to simplify this model
- SE of EOF factor loadings HOT 3
- Index units changed HOT 2
- Plot_maps function error HOT 3
- project_model function HOT 1
- Spatially varying Day of the year as catchability covariate HOT 1
- Poisson-link model application HOT 5
- New version of R may be causing issues with making extrapolation grid HOT 10
- Creating extrapolation grid: shifted south HOT 4
- Pink salmon time structure HOT 3
- Effect.fit_model or pdp do not work very well for binomial model
- Model crashes when e_i not equal to c_iz HOT 1
- INLA issue HOT 8
- Error running seasonal model example HOT 2
- Sampling-related and knots-related density covariates
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vast.