r-lib / isoband

isoband: An R package to generate contour lines and polygons.
https://isoband.r-lib.org
Other
130 stars 14 forks source link

Extra compiler option to build isoband #12

Closed ycl6 closed 4 years ago

ycl6 commented 4 years ago

Hi,

I encounter below error while tring to install isoband with install.package

g++  -I"/opt/gridware2/apps/gcc/R/3.6.1/lib64/R/include" -DNDEBUG  -I"/user/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -I"/user/R/x86_64-pc-linux-gnu-library/3.6/testthat/include" -I/usr/local/include  -fpic  -g -O2  -c RcppExports.cpp -o RcppExports.o
g++  -I"/opt/gridware2/apps/gcc/R/3.6.1/lib64/R/include" -DNDEBUG  -I"/user/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -I"/user/R/x86_64-pc-linux-gnu-library/3.6/testthat/include" -I/usr/local/include  -fpic  -g -O2  -c clip-lines.cpp -o clip-lines.o
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/unordered_map:35,
                 from polygon.h:5,
                 from clip-lines.h:7,
                 from clip-lines.cpp:9:
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/c++0x_warning.h:31:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
make: *** [clip-lines.o] Error 1

Just wanna share how I resolve the issue. I download the source package from CRAN, adding a line to isoband/src/Makevars, repack the package and install it from the new source package.

PKG_CXXFLAGS ="-std=c++0x"
clauswilke commented 4 years ago

gcc 4.4 stopped being maintained in 2012. You should consider updating to a more recent compiler.

https://www.gnu.org/software/gcc/gcc-4.4/

ycl6 commented 4 years ago

@clauswilke Thanks. I am using the university HPC resource, hence it is not something I can do but work around it. Still, I am glad I am able to have it compiled anyway.