James-Thorson-NOAA / VAST

Spatio-temporal analysis of univariate or multivariate data, e.g., standardizing data for multiple species or stages
http://www.FishStats.org
GNU General Public License v3.0
124 stars 53 forks source link

Compiler errors with rtweedie #276

Open Cole-Monnahan-NOAA opened 3 years ago

Cole-Monnahan-NOAA commented 3 years ago

I'm using the development versions of VAST and FishStatsUtils, and recently updated to R and Rtools 4, and updated TMB to 1.7.19.

When I do, I now get an error about the Tweedie:

> compile("C:/Users/cole.monnahan/RLibs/VAST/executables/VAST_v13_0_0.cpp", CP$
"C:/rtools40/mingw64/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.3/include" -DNDEBUG -I"C:/Users/COLE~1.MON/RLibs/TMB/include" -I"C:/Users/COLE~1.MON/RLibs/RCPPEI~1/include"  -DTMB_SAFEBOUNDS -DLIB_UNLOAD=R_unload_VAST_v13_0_0  -DTMB_LIB_INIT=R_init_VAST_v13_0_0   -Wno-ignored-attributes       -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c C:/Users/cole.monnahan/RLibs/VAST/executables/VAST_v13_0_0.cpp -o C:/Users/cole.monnahan/RLibs/VAST/executables/VAST_v13_0_0.o
C:/Users/cole.monnahan/RLibs/VAST/executables/VAST_v13_0_0.cpp:146:6: error: redefinition of 'template<class Type> Type rtweedie(Type, Type, Type)'
 Type rtweedie( Type mu, Type phi, Type power){
      ^~~~~~~~
In file included from C:/Users/COLE~1.MON/RLibs/TMB/include/TMB.hpp:105,
                 from C:/Users/cole.monnahan/RLibs/VAST/executables/VAST_v13_0_0.cpp:2:
C:/Users/COLE~1.MON/RLibs/TMB/include/distributions_R.hpp:822:6: note: 'template<class Type> Type rtweedie(Type, Type, Type)' previously declared here
 Type rtweedie(Type mu, Type phi, Type p) {
      ^~~~~~~~
make: *** [C:/PROGRA~1/R/R-40~1.3/etc/x64/Makeconf:229: C:/Users/cole.monnahan/RLibs/VAST/executables/VAST_v13_0_0.o] Error 1

I commented out the rtweedie function and it seems to compile fine now. I guess that TMB added this function and so now it's conflicting?

James-Thorson commented 3 years ago

You're right that it got added to TMB with the same name.

You think I should add the latest numeric release of TMB as dependency to force user updates, or rename my local version and wait a while for users to upgrade TMB on their own before forcing that?

On Tue, Feb 9, 2021, 2:49 PM Cole Monnahan notifications@github.com wrote:

I'm using the development versions of VAST and FishStatsUtils, and recently updated to R and Rtools 4, and updated TMB to 1.7.19.

When I do, I now get an error about the Tweedie:

compile("C:/Users/cole.monnahan/RLibs/VAST/executables/VAST_v13_0_0.cpp", CP$ "C:/rtools40/mingw64/bin/"g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.3/include" -DNDEBUG -I"C:/Users/COLE~1.MON/RLibs/TMB/include" -I"C:/Users/COLE~1.MON/RLibs/RCPPEI~1/include" -DTMB_SAFEBOUNDS -DLIB_UNLOAD=R_unload_VAST_v13_0_0 -DTMB_LIB_INIT=R_init_VAST_v13_0_0 -Wno-ignored-attributes -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c C:/Users/cole.monnahan/RLibs/VAST/executables/VAST_v13_0_0.cpp -o C:/Users/cole.monnahan/RLibs/VAST/executables/VAST_v13_0_0.o C:/Users/cole.monnahan/RLibs/VAST/executables/VAST_v13_0_0.cpp:146:6: error: redefinition of 'template Type rtweedie(Type, Type, Type)' Type rtweedie( Type mu, Type phi, Type power){ ^~~~ In file included from C:/Users/COLE~1.MON/RLibs/TMB/include/TMB.hpp:105, from C:/Users/cole.monnahan/RLibs/VAST/executables/VAST_v13_0_0.cpp:2: C:/Users/COLE~1.MON/RLibs/TMB/include/distributions_R.hpp:822:6: note: 'template Type rtweedie(Type, Type, Type)' previously declared here Type rtweedie(Type mu, Type phi, Type p) { ^~~~ make: *** [C:/PROGRA~1/R/R-40~1.3/etc/x64/Makeconf:229: C:/Users/cole.monnahan/RLibs/VAST/executables/VAST_v13_0_0.o] Error 1

I commented out the rtweedie function and it seems to compile fine now. I guess that TMB added this function and so now it's conflicting?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/James-Thorson-NOAA/VAST/issues/276, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB46UTKPXVGF5DJMAOY3XP3S6G3XHANCNFSM4XL3PINA .

Cole-Monnahan-NOAA commented 3 years ago

Probably update the dependency since really people should update I think. I'm working through the upgrade to 4.0 and got it down to a single warning from Matrix.

James-Thorson commented 3 years ago

So I can double-check, could you please confirm what version of TMB you're using? Seems easier than me trying to track down the first numeric release that includes the new function in TMB.

On Tue, Feb 9, 2021 at 3:07 PM Cole Monnahan notifications@github.com wrote:

Probably update the dependency since really people should update I think. I'm working through the upgrade to 4.0 and got it down to a single warning from Matrix.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/James-Thorson-NOAA/VAST/issues/276#issuecomment-776304731, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB46UTIDP72TQ27PGJ4SR2TS6G53PANCNFSM4XL3PINA .

Cole-Monnahan-NOAA commented 3 years ago

I'm using 1.7.19

James-Thorson-NOAA commented 3 years ago

OK, so the latest numeric release appears to be 1.7.18, and it doesn't seem to have the rtweedie. I don't want to force a dependency on a version that isn't released yet. what about sticking with that TMB for now, and I change the dependency when 1.7.19 is released?

Cole-Monnahan-NOAA commented 3 years ago

Yeah that sounds reasonable.

The temporary solution for anyone finding this is to just install TMB version 1.7.18.