VAST icon indicating copy to clipboard operation
VAST copied to clipboard

Compiler errors with rtweedie

Open Cole-Monnahan-NOAA opened this issue 4 years ago • 6 comments

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?

Cole-Monnahan-NOAA avatar Feb 09 '21 22:02 Cole-Monnahan-NOAA

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 [email protected] 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<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?

— 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 .

James-Thorson avatar Feb 09 '21 22:02 James-Thorson

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.

Cole-Monnahan-NOAA avatar Feb 09 '21 23:02 Cole-Monnahan-NOAA

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 [email protected] 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 .

James-Thorson avatar Feb 09 '21 23:02 James-Thorson

I'm using 1.7.19

Cole-Monnahan-NOAA avatar Feb 09 '21 23:02 Cole-Monnahan-NOAA

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?

James-Thorson-NOAA avatar Feb 09 '21 23:02 James-Thorson-NOAA

Yeah that sounds reasonable.

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

Cole-Monnahan-NOAA avatar Feb 09 '21 23:02 Cole-Monnahan-NOAA