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

Compilation error #9

Closed
byoo opened this issue Jan 24, 2022 · 1 comment
Closed

Compilation error #9

byoo opened this issue Jan 24, 2022 · 1 comment

Comments

@byoo
Copy link

byoo commented Jan 24, 2022

Can you help with the installation issue below? I tried R 4.0.3 and R 4.1.0 without success. Thanks!

✔  checking for file ‘/tmp/RtmpGeWbBu/remotes26b536a8a2737/xihaoli-STAAR-7887209/DESCRIPTION’ (573ms)
─  preparing ‘STAAR’:
✔  checking DESCRIPTION meta-information
─  cleaning src
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘STAAR_0.9.6.tar.gz’

* installing *source* package ‘STAAR’ ...
...

g++ -std=gnu++11 -I"/software/R/R-4.0.3/lib64/R/include" -DNDEBUG -DARMA_64BIT_WORD=1 -I'/software/R/R-4.0.3/lib64/R/library/Rcpp/include' -I'/software/R/R-4.0.3/lib64/R/library/RcppArmadillo/include' -I/usr/local/include   -fpic  -g -O2  -c CCT_pval.cpp -o CCT_pval.o
CCT_pval.cpp: In function ‘double CCT_pval(arma::vec, arma::vec)’:
CCT_pval.cpp:28:42: error: ‘PI’ was not declared in this scope
   28 |    cct_stat = cct_stat + weights(k)/x(k)/PI;
      |                                          ^~
CCT_pval.cpp:31:52: error: ‘PI’ was not declared in this scope
   31 |    cct_stat = cct_stat + weights(k)*tan((0.5-x(k))*PI);
      |                                                    ^~
CCT_pval.cpp:37:29: error: ‘PI’ was not declared in this scope
   37 |         pval = (1/cct_stat)/PI;
      |                             ^~
make: *** [/software/R/R-4.0.3/lib64/R/etc/Makeconf:181: CCT_pval.o] Error 1
ERROR: compilation failed for package ‘STAAR’
@xihaoli
Copy link
Owner

xihaoli commented Jan 24, 2022

Hi byoo,

Thank you for letting me know. Upon checking your error message, it seems that the issue comes from the newly updated Rcpp package (RcppCore/Rcpp#1158) for undeclared math constant PI (3.1415926…) in C++ functions.

Could you please send me an email to have a further discussion?

Best,
Xihao

@xihaoli xihaoli closed this as completed Jan 24, 2022
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

2 participants