{"action":"created","issue":{"url":"https://api.github.com/repos/hadley/dplyr/issues/1368","labels_url":"https://api.github.com/repos/hadley/dplyr/issues/1368/labels{/name}","comments_url":"https://api.github.com/repos/hadley/dplyr/issues/1368/comments","events_url":"https://api.github.com/repos/hadley/dplyr/issues/1368/events","html_url":"https://github.com/hadley/dplyr/issues/1368","id":104075612,"number":1368,"title":"Why would dplyr fail to compile using std=gnu++11?","user":{"login":"aadler","id":5596401,"avatar_url":"https://avatars.githubusercontent.com/u/5596401?v=3","gravatar_id":"","url":"https://api.github.com/users/aadler","html_url":"https://github.com/aadler","followers_url":"https://api.github.com/users/aadler/followers","following_url":"https://api.github.com/users/aadler/following{/other_user}","gists_url":"https://api.github.com/users/aadler/gists{/gist_id}","starred_url":"https://api.github.com/users/aadler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aadler/subscriptions","organizations_url":"https://api.github.com/users/aadler/orgs","repos_url":"https://api.github.com/users/aadler/repos","events_url":"https://api.github.com/users/aadler/events{/privacy}","received_events_url":"https://api.github.com/users/aadler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"romainfrancois","id":2625526,"avatar_url":"https://avatars.githubusercontent.com/u/2625526?v=3","gravatar_id":"","url":"https://api.github.com/users/romainfrancois","html_url":"https://github.com/romainfrancois","followers_url":"https://api.github.com/users/romainfrancois/followers","following_url":"https://api.github.com/users/romainfrancois/following{/other_user}","gists_url":"https://api.github.com/users/romainfrancois/gists{/gist_id}","starred_url":"https://api.github.com/users/romainfrancois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romainfrancois/subscriptions","organizations_url":"https://api.github.com/users/romainfrancois/orgs","repos_url":"https://api.github.com/users/romainfrancois/repos","events_url":"https://api.github.com/users/romainfrancois/events{/privacy}","received_events_url":"https://api.github.com/users/romainfrancois/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2015-08-31T15:27:12Z","updated_at":"2015-08-31T21:55:37Z","closed_at":null,"body":"When trying to compile dplyr from source (using an experimental GCC 4.9.2/3 based toolchain), if I pass `=std=gnu++11`, then dplyr fails with the error posted below. However, when not passing any standardization flag, it compiles without any problems. Any insight would be appreciated.\r\n\r\nThank you,\r\n\r\nAvi\r\n\r\n```\r\nC:/MINGW64/gcc-4.9.2/bin/g++ -m64 -I\"C:/R/RCurrent/R-32~1.2PA/include\"\r\n-DNDEBUG -I../inst/include -DCOMPILING_DPLYR\r\n-I\"C:/R/RCurrent/R-3.2.2patched/library/Rcpp/include\"\r\n-I\"C:/R/RCurrent/R-3.2.2patched/library/BH/include\"\r\n-I\"C:/R/RLocalSoft/extsoft/include\"     -std=gnu++11 -O2\r\n-march=ivybridge -mtune=ivybridge --param l1-cache-line-size=64\r\n--param l1-cache-size=32 --param l2-cache-size=256 -pipe -c\r\nRcppExports.cpp -o RcppExports.o\r\nIn file included from ../inst/include/dplyr/Result/all.h:25:0,\r\n                 from ../inst/include/dplyr.h:141,\r\n                 from RcppExports.cpp:4:\r\n../inst/include/dplyr/Result/Name.h:51:16: error: specialization of\r\n'template<class _Tp> struct std::hash' in different namespace\r\n[-fpermissive]\r\n         struct hash< dplyr::Name > {\r\n                ^\r\nIn file included from\r\nC:/MINGW64/gcc-4.9.2/i686-w64-mingw32/include/c++/bits/basic_string.h:3068:0,\r\n                 from\r\nC:/MINGW64/gcc-4.9.2/i686-w64-mingw32/include/c++/string:52,\r\n                 from\r\nC:/MINGW64/gcc-4.9.2/i686-w64-mingw32/include/c++/stdexcept:39,\r\n                 from\r\nC:/MINGW64/gcc-4.9.2/i686-w64-mingw32/include/c++/array:38,\r\n                 from\r\nC:/MINGW64/gcc-4.9.2/i686-w64-mingw32/include/c++/tuple:39,\r\n                 from\r\nC:/MINGW64/gcc-4.9.2/i686-w64-mingw32/include/c++/unordered_map:41,\r\n                 from\r\nC:/R/RCurrent/R-3.2.2patched/library/Rcpp/include/Rcpp/platform/compiler.h:153,\r\n                 from\r\nC:/R/RCurrent/R-3.2.2patched/library/Rcpp/include/Rcpp/r/headers.h:48,\r\n                 from\r\nC:/R/RCurrent/R-3.2.2patched/library/Rcpp/include/RcppCommon.h:29,\r\n                 from\r\nC:/R/RCurrent/R-3.2.2patched/library/Rcpp/include/Rcpp.h:27,\r\n                 from ../inst/include/dplyr.h:4,\r\n                 from RcppExports.cpp:4:\r\nC:/MINGW64/gcc-4.9.2/i686-w64-mingw32/include/c++/bits/functional_hash.h:58:12:\r\nerror:   from definition of 'template<class _Tp> struct std::hash'\r\n[-fpermissive]\r\n     struct hash;\r\n            ^\r\nIn file included from ../inst/include/dplyr/Result/all.h:25:0,\r\n                 from ../inst/include/dplyr.h:141,\r\n                 from RcppExports.cpp:4:\r\n../inst/include/dplyr/Result/Name.h:52:61: error: definition of\r\n'std::size_t std::hash<dplyr::Name>::operator()(const dplyr::Name&)\r\nconst' is not in namespace enclosing 'std::hash<dplyr::Name>'\r\n[-fpermissive]\r\n             std::size_t operator()( const dplyr::Name & c ) const {\r\n                                                             ^\r\nmake: *** [RcppExports.o] Error 1\r\nWarning: running command 'make -f \"Makevars.win\" -f\r\n\"C:/R/RCurrent/R-32~1.2PA/etc/x64/Makeconf\" -f\r\n\"C:/R/RCurrent/R-32~1.2PA/share/make/winshlib.mk\" -f\r\n\"//[REDACTED]/.R/Makevars\"\r\nSHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)'\r\nSHLIB=\"dplyr.dll\" WIN=64 TCLBIN=64 OBJECTS=\"RcppExports.o address.o\r\narrange.o between.o bind.o combine_variables.o distinct.o dplyr.o\r\nfilter.o group_indices.o init.o join.o select.o strings_addresses.o\r\nsummarise.o test.o window.o\"' had status 2\r\nERROR: compilation failed for package 'dplyr'\r\n* removing 'C:/R/RCurrent/R-3.2.2patched/library/dplyr'\r\nWarning in install.packages :\r\n  running command '\"C:/R/RCurrent/R-32~1.2PA/bin/x64/R\" CMD INSTALL\r\n--byte-compile -l \"C:\\R\\RCurrent\\R-3.2.2patched\\library\"\r\nC:\\R\\temp\\Rtmp0s39u5/downloaded_packages/dplyr_0.4.2.tar.gz' had\r\nstatus 1\r\nWarning in install.packages :\r\n  installation of package ‘dplyr’ had non-zero exit status\r\n```"},"comment":{"url":"https://api.github.com/repos/hadley/dplyr/issues/comments/136512077","html_url":"https://github.com/hadley/dplyr/issues/1368#issuecomment-136512077","issue_url":"https://api.github.com/repos/hadley/dplyr/issues/1368","id":136512077,"user":{"login":"aadler","id":5596401,"avatar_url":"https://avatars.githubusercontent.com/u/5596401?v=3","gravatar_id":"","url":"https://api.github.com/users/aadler","html_url":"https://github.com/aadler","followers_url":"https://api.github.com/users/aadler/followers","following_url":"https://api.github.com/users/aadler/following{/other_user}","gists_url":"https://api.github.com/users/aadler/gists{/gist_id}","starred_url":"https://api.github.com/users/aadler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aadler/subscriptions","organizations_url":"https://api.github.com/users/aadler/orgs","repos_url":"https://api.github.com/users/aadler/repos","events_url":"https://api.github.com/users/aadler/events{/privacy}","received_events_url":"https://api.github.com/users/aadler/received_events","type":"User","site_admin":false},"created_at":"2015-08-31T21:55:37Z","updated_at":"2015-08-31T21:55:37Z","body":"@kevinushey @romainfrancois, cloning the repo, building a source package based on the dev branch (dplyr_0.4.2.9002.tar.gz), and installing locally from source passing `std=gnu++11` and `mtune=ivybridge` no longer has the `const` issue, but another.\r\n\r\n```\r\ng++ -m64 -shared -s -static-libgcc -o dplyr.dll tmp.def RcppExports.o address.o api.o arrange.o between.o bind.o combine_variables.o distinct.o dplyr.o filter.o group_indices.o init.o join.o select.o strings_addresses.o summarise.o test.o window.o -LC:/R/RLocalSoft/extsoft/lib/x64 -LC:/R/RLocalSoft/extsoft/lib -LC:/R/R-PATC~2/bin/x64 -lR\r\ncollect2.exe: error: ld returned 5 exit status\r\ninstalling to C:/R/R-patched/library/dplyr/libs/x64\r\n```\r\n\r\nAt first blush, I would have thought this was related to <https://stat.ethz.ch/pipermail/r-devel/2015-March/070814.html> and <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2015-August/008920.html>. However, I am passing O2 in CXXFLAGS. Do I need to pass O2 in CPPFLAGS as well to capture the case when g++  is used to combine the .o files? Windows error box below\r\n\r\n![Uploading Error.png…]()\r\n\r\n\r\n\r\n\r\n"}}