Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor compilation fix #64

Closed
eddelbuettel opened this issue Sep 8, 2021 · 0 comments
Closed

Minor compilation fix #64

eddelbuettel opened this issue Sep 8, 2021 · 0 comments

Comments

@eddelbuettel
Copy link
Collaborator

I looked over how RcppSMC 0.2.4 fared at CRAN and noticed that Solaris is unhappy with a sole use of an unqualified pow():

/opt/csw/bin/g++ -std=gnu++14 -I"/home/ripley/R/gcc/include" -DNDEBUG -I../inst/include -I'/home/ripley/R/Lib32/Rcpp/include' -I'/home/ripley/R/Lib32/RcppArmadillo/include' -I/opt/csw/include -I/usr/local/include  -fPIC  -O2  -c RcppExports.cpp -o RcppExports.o
In file included from ../inst/include/RcppSMC.h:25:0,
                 from RcppExports.cpp:4:
../inst/include/conditionalSampler.h: In member function ‘std::ostream& smc::conditionalSampler<Space, Params>::StreamParticles(std::ostream&, int) const’:
../inst/include/conditionalSampler.h:630:41: error: call of overloaded ‘pow(int, int&)’ is ambiguous
         int roundDigits = pow(10, digits);
                                         ^
In file included from /usr/include/math.h:15: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:66,
                 from /home/ripley/R/Lib32/Rcpp/include/RcppCommon.h:30,
                 from /home/ripley/R/Lib32/RcppArmadillo/include/RcppArmadilloForward.h:26,
                 from /home/ripley/R/Lib32/RcppArmadillo/include/RcppArmadillo.h:31,
                 from ../inst/include/RcppSMC.h:18,
                 from RcppExports.cpp:4:
/opt/csw/lib/gcc/i386-pc-solaris2.10/5.2.0/include-fixed/iso/math_iso.h:204:21: note: candidate: long double std::pow(long double, long double)
  inline long double pow(long double __X, long double __Y) { return
                     ^
/opt/csw/lib/gcc/i386-pc-solaris2.10/5.2.0/include-fixed/iso/math_iso.h:171:15: note: candidate: float std::pow(float, float)
  inline float pow(float __X, float __Y) { return __powf(__X, __Y); }
               ^
/opt/csw/lib/gcc/i386-pc-solaris2.10/5.2.0/include-fixed/iso/math_iso.h:72:15: note: candidate: double std::pow(double, double)
 extern double pow __P((double, double));
               ^
*** Error code 1
make: Fatal error: Command failed for target `RcppExports.o'

I have the fix ready, and even tested it via RHub and its Solaris builder -- it just needs a std::pow as usual.

I will roll up a PR and suggest we do 0.2.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant