imneme / pcg-cpp

PCG — C++ Implementation
Apache License 2.0
747 stars 99 forks source link

Solaris build failure #42

Open rstub opened 6 years ago

rstub commented 6 years ago

I have incorporated the PCG family into an R package. On submission to CRAN I have been informed about a compilation error on Solaris:

In file included from dqrng.cpp:22:0: ../inst/include/pcg_random.hpp:1639:18: error: reference to ‘extended’ is ambiguous using ext_std8 = extended<table_pow2, advance_pow2, BaseRNG, ^ In file included from /usr/include/math.h:382:0, from /opt/csw/include/c++/5.2.0/cmath:44, from /home/ripley/R/Lib32/Rcpp/include/Rcpp/platform/compiler.h:100, from /home/ripley/R/Lib32/Rcpp/include/Rcpp/r/headers.h:48, from /home/ripley/R/Lib32/Rcpp/include/RcppCommon.h:38, from /home/ripley/R/Lib32/Rcpp/include/Rcpp.h:27, from dqrng.cpp:18: /usr/include/floatingpoint.h:71:18: note: candidates are: typedef unsigned int extended [3] typedef unsigned extended[3]; ^

I was able to circumvent this with a simple patch to use fully qualified names. Are you interested in a PR based on this patch?

vedranmiletic commented 5 years ago

Can confirm on:

$ uname -a
SunOS arno 5.11 omnios-r151032-702376803e i86pc i386 i86pc
$ gcc --version
gcc (OmniOS 151032/8.3.0-il-0) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
hannes commented 3 years ago

Ran into this as well. The simplest fix is to rename the extended template to something else, like pcg_extended.