elbersb / segregation

R package to calculate entropy-based segregation indices, with a focus on the Mutual Information Index (M) and Theil’s Information Index (H)
https://elbersb.com/segregation
Other
35 stars 3 forks source link

Warnings when compiling on R 4.2 or lower #13

Open mfansler opened 11 months ago

mfansler commented 11 months ago

This package uses C++17 syntax, which is declared in the DESCRIPTION file. However, R does not use this information to control the C++ standard, but instead defaults to gnu++14 in R 4.2 and gnu++11 in R 4.1. This results in warnings about C++17 extensions during installation (e.g., see recent CRAN install log1).

These warnings could be avoided by explicitly setting CXX_STD=CXX17 in Makevars(.win) files.

This is just a minor suggestion (nothing urgent).


[1]: Unfortunately, this is not a persistent log. Specifically, there are two warning: decomposition declarations are a C++17 extension resulting from compiling compression.cpp with -std=gnu++14.

elbersb commented 9 months ago

Hi! Would a Makevars file in the src directory solve this? Or do I need a Makevars.win file as well?

mfansler commented 9 months ago

Not sure if windows will use the generic one, so might need both.