Search code examples
c++rpackagerstudiofeather

R: Compilation error "ISO C++ forbids in-class initialization of non-const static member" when installing feather package


I'm using R version 3.1.2 and want to install the "feather" package in RStudio:

install.packages("feather", type="source")

Using a source version because there doesn't seem to be a binary version.
It does extract the file and checks for MD5 sums correctly, but throws errors for several sub-steps:

error: ISO C++ forbids in-class initialization of non-const static member 'xy'

Here's an extract of what exactly RStudio tells me:

from c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/algorithm:63,
from ./feather/buffer.h:18,
from ./feather/metadata.h:23,
from ./feather/reader.h:21,
from feather/feather-c.cc:21:
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:196:57: error: ISO C++ forbids in-class initialization of non-const static member 'is_specialized'
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:201:48: error: ISO C++ forbids in-class initialization of non-const static member 'digits'
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:204:50: error: ISO C++ forbids in-class initialization of non-const static member 'digits10'
...(for many other parts)...
(also for some:)
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:1587:58: note: 'bool std::numeric_limits::has_quiet_NaN' is not const
(and:)
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:1607:51: error: the value of 'std::numeric_limits::has_infinity' is not usable in a constant expression
(then some:)
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/bits/random.tcc:345:7: error: '_M_x' was not declared in this scope
(and finally:)
confused by earlier errors, bailing out
make: *** [feather/feather-c.o] Error 1
Warnung: Ausführung von Kommando 'make -f "Makevars" -f "C:/PROGRA~1/R/R-31~1.2/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-31~1.2/share/make/winshlib.mk" CXX='$(CXX1X) $(CXX1XSTD)' CXXFLAGS='$(CXX1XFLAGS)' CXXPICFLAGS='$(CXX1XPICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX1XLDFLAGS)' SHLIB_LD='$(SHLIB_CXX1XLD)' SHLIB="feather.dll" OBJECTS="RcppExports.o feather-read.o feather-types.o feather-write.o"' ergab Status 2
ERROR: compilation failed for package 'feather'
* removing 'C:/Users/.../R/win-library/3.1/feather'
* restoring previous 'C:/Users/.../R/win-library/3.1/feather'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-31~1.2/bin/x64/R" CMD INSTALL -l "C:\Users...\R\win-library\3.1" C:\Users...\AppData\LocalTemp\RtmpKsxa73/downloaded_packages/feather_0.3.2.tar.gz' had status 1
Warning in install.packages :
installation of package ‘feather’ had non-zero exit status

I wanted to install the feather-package via CRAN. It doesn't work in RStudio, nor does it in the R console. Running this on Windows 8.1.

Anybody have an idea why this won't install?

To me the problem lies somewhere with the package?
Or could it be a problem with authorization (I do not have administrative rights with my user, but I can install anything in C:\Users\my_user)


Solution

  • This specific language feature was first supported in GCC 4.7. You have GCC 4.6.3.

    You will need to acquire a newer GCC or Clang installation. If I read the error message correctly, you got your GCC from RTools 3.1. Looking at the project page for Rtools, Rtools 3.3 and up default to GCC 4.9 and up, which should support the code used by your feather extension.