1

CRAN is asking to handles some NOTEs. In particular, they are asking to avoid specifying the c++ standard in the Makevars file according to the "CRAN incoming feseability" . Hence, I should drop the CXX_STD= CXX11 in the Makevars.

A priori, it should not be a problem for the C++ backward compatibilty.

I made the opportune changes and checked the package on linux and as one might expect, the new version of the package passes the usual checks through R CMD check MyPackage.tar.gz. Relying on rhub functionalities, the new version of the package passes the checks also on macOs.

For what concerns windows, I get an error during the building of the shared object, in the last step of the compilation process. In particular, dropping CXX_STD= CXX11, using R 4.3.0 (R under development) and relying on rtools43, the last step of the compilation reads as follows:

gcc -shared -s -static-libgcc -o fdaPDE.dll tmp.def  ObjectFile1.o .... ObjectFileN.o -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib -LC:/PROGRA~1/R/R-devel/bin/x64 -lR
C:\rtools43\x86_64-w64-mingw32.static.posix\bin/ld.exe: ObjectFile1.o:ObjectFile.cpp:(.text+0x33f4): undefined reference to `operator new(unsigned long long)'
C:\rtools43\x86_64-w64-mingw32.static.posix\bin/ld.exe: ObjectFile1.o:ObjectFile1.cpp:(.text+0x340b): undefined reference to `std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
C:\rtools43\x86_64-w64-mingw32.static.posix\bin/ld.exe: ObjectFile1.o:ObjectFile1.cpp:(.text+0x3432): undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
C:\rtools43\x86_64-w64-mingw32.static.posix\bin/ld.exe: 
.....
and so on
.....

It seems that gcc does not link properly the standard library. Is Rtools broken? On the other hand, If I specify c++11 as c++ standard then the compilation process ends without any errors and in particular the last steps of the compilation process reads as follows:

g++ -shared -s -static-libgcc -o fdaPDE.dll tmp.def  ObjectFile1.o .... ObjectFileN.o -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib -LC:/PROGRA~1/R/R-devel/bin/x64 -lR
installing via 'install.libs.R' to ... 

Same results using R release and R oldrelease compiling the package with rtools42 and rtools40, respectively.

In my knownledge, there is not a trick to force the call of g++ during the linking phase due to the fact that adding CXX=g++ in the Makevars.win file would have no effect on the compilation.

I would be pleased to read any advice or suggestions on this problem, Thanks

0 Answers0