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

RcppGSLExample fails to install on rhub (platform = "solaris-x86-patched-ods") #25

Closed
pcarbo opened this issue Jun 15, 2020 · 12 comments
Closed

Comments

@pcarbo
Copy link

@pcarbo pcarbo commented Jun 15, 2020

I was unable to find any instances of this issue being reported elsewhere (e.g., in R-package-devel), and I am a bit surprised by that, so I do apologize if this is a duplicate issue report.

I tested the provided "RcppGSLExample" package in the "solaris-x86-patched-ods" platform made available via rhub, and I got an error during the package installation step. I'm attaching the full 00install.out output; here is a brief summary of the relevant error messages, indicating issues with multiply defined labels:

/opt/developerstudio12.6/bin/CC -std=c++11 -library=stdcpp,CrunG3 -G -L/opt/csw/lib -o RcppGSLExample.so RcppExports.o colNorm.o -L/opt/csw/li\
b -lgsl -lgslcblas -lm
ld: fatal: symbol 'SEXPREC* Rcpp::wrap<gsl_vector>(const gsl_vector&)' is multiply-defined:
        (file RcppExports.o type=FUNC; file colNorm.o type=FUNC);
ld: fatal: symbol 'SEXPREC* Rcpp::wrap<gsl_vector_float>(const gsl_vector_float&)' is multiply-defined:
        (file RcppExports.o type=FUNC; file colNorm.o type=FUNC);
ld: fatal: symbol 'SEXPREC* Rcpp::wrap<gsl_vector_int>(const gsl_vector_int&)' is multiply-defined:
        (file RcppExports.o type=FUNC; file colNorm.o type=FUNC);

00install.out.gz

@eddelbuettel
Copy link
Owner

@eddelbuettel eddelbuettel commented Jun 15, 2020

Yes, but in general many more things fail on Solaris than on the other OSs so I am not sure what I could possibly do for you here -- not having access to Solaris myself (besides RHub) etc

@eddelbuettel
Copy link
Owner

@eddelbuettel eddelbuettel commented Jun 15, 2020

(Unless we did a simple mistake here, didn't inline the definitions properly and include the header multiple times. But for simple errors like that g++ and clang++ are also reasonably attentive....)

@pcarbo
Copy link
Author

@pcarbo pcarbo commented Jun 15, 2020

Thanks for the quick response @eddelbuettel—let me see if I can come up with a fix; if I do, I will report it here. At last resort, I will ask CRAN to grant us an exception for our package (which depends on RcppGSL).

@eddelbuettel
Copy link
Owner

@eddelbuettel eddelbuettel commented Jun 15, 2020

I see. I just checked another small package of mine depending in RcppGSL too, and it is reported 'healthy' at CRAN including Slowlaris so this does not appear to affect all...

https://cloud.r-project.org/web/checks/check_results_RcppZiggurat.html

Ditto with mvabund which is kinda the grand-daddy of all of these:
https://cloud.r-project.org/web/checks/check_results_mvabund.html

@pcarbo
Copy link
Author

@pcarbo pcarbo commented Jun 15, 2020

A solution that works—although not elegant at all—is to combine the RcppExports.cpp and colNorm.cpp into one .cpp file. When I do this, the ERRORs disappear.

@eddelbuettel
Copy link
Owner

@eddelbuettel eddelbuettel commented Jun 21, 2020

I took another look and there were arguably four inline statements missing at the end of RcppGSLForward.h:

modified   inst/include/RcppGSLForward.h
@@ -215,11 +215,11 @@ namespace Rcpp {
     template<> inline SEXP wrap(const gsl_matrix_view&);         
     template<> inline SEXP wrap(const gsl_matrix_const_view&);
 
-    template <typename T> SEXP wrap(const ::RcppGSL::vector<T>&);
-    template <typename T> SEXP wrap(const ::RcppGSL::matrix<T>&);
+    template <typename T> inline SEXP wrap(const ::RcppGSL::vector<T>&);
+    template <typename T> inline SEXP wrap(const ::RcppGSL::matrix<T>&);
     
-    template <typename T> SEXP wrap(const ::RcppGSL::vector_view<T>&);
-    template <typename T> SEXP wrap(const ::RcppGSL::matrix_view<T>&);
+    template <typename T> inline SEXP wrap(const ::RcppGSL::vector_view<T>&);
+    template <typename T> inline SEXP wrap(const ::RcppGSL::matrix_view<T>&);
     
 }
 

I am surprised that g++ on Linux is so much more forgiving. Trouble is testing the error from RcppGSLExample requires an updated package first...

Edit: Noticed I did already go all the way to test the client package during tests: test_client_package.R. So now I am surprised you are bitten by this as the test should have shown it too. Hm.

@eddelbuettel
Copy link
Owner

@eddelbuettel eddelbuettel commented Jun 21, 2020

And I may just have fixed it.

"Bad" borked Solaris build from maybe an half-an-hour ago:

RcppGSL 0.3.7.1: ERROR

Build ID: RcppGSL_0.3.7.1.tar.gz-c580dfc86e7c4dad9464437195d5ddea
Platform: Oracle Solaris 10, x86, 32 bit, R-release, Oracle Developer Studio 12.6
Submitted: 2 minutes 26.7 seconds ago
Build time: 2 minutes 23.4 seconds

ERRORS:

  • checking whether package ‘RcppGSL’ can be installed ... ERROR
    Installation failed.
    See ‘/export/home/Xv3Utay/RcppGSL.Rcheck/00install.out’ for details.

See the full build log:
HTML: https://builder.r-hub.io/status/RcppGSL_0.3.7.1.tar.gz-c580dfc86e7c4dad9464437195d5ddea
Text: https://builder.r-hub.io/status/original/RcppGSL_0.3.7.1.tar.gz-c580dfc86e7c4dad9464437195d5ddea
Artifacts: https://artifacts.r-hub.io/RcppGSL_0.3.7.1.tar.gz-c580dfc86e7c4dad9464437195d5ddea

"Good" one on new code I will commit now:

RcppGSL 0.3.7.1: OK

Build ID: RcppGSL_0.3.7.1.tar.gz-9ded1fed1a7344e6a6aa1b15bd8dfa81
Platform: Oracle Solaris 10, x86, 32 bit, R-release, Oracle Developer Studio 12.6
Submitted: 2 minutes 59.6 seconds ago
Build time: 2 minutes 58 seconds

See the full build log:
HTML: https://builder.r-hub.io/status/RcppGSL_0.3.7.1.tar.gz-9ded1fed1a7344e6a6aa1b15bd8dfa81
Text: https://builder.r-hub.io/status/original/RcppGSL_0.3.7.1.tar.gz-9ded1fed1a7344e6a6aa1b15bd8dfa81
Artifacts: https://artifacts.r-hub.io/RcppGSL_0.3.7.1.tar.gz-9ded1fed1a7344e6a6aa1b15bd8dfa81

@eddelbuettel
Copy link
Owner

@eddelbuettel eddelbuettel commented Jun 21, 2020

Package 0.3.8 is now on CRAN and I tried to say 'Thank you' to you on Twitter too.

@pcarbo
Copy link
Author

@pcarbo pcarbo commented Jun 22, 2020

Awesome! I am equally surprised that this error does not show up on other systems. I will see if the new RcppGSL version fixes our issue with the mashr package.

@eddelbuettel
Copy link
Owner

@eddelbuettel eddelbuettel commented Jun 22, 2020

So am I! I was thinking about this on the weekend, and given that RcppGSL has been there for years I can only suspect that it is a more recent compiler feature.

But whatever 🍰 is that a real and genuine bug got squashed! And it is good to see RcppGSL having some tires kicked. I always liked the package, and it is not so widely used so lovely to see it coming to use across town :) (It also got better a few years when I realized how to improve the ctor/dtor pairing around the inner C objects). So thanks again for the very helpful issue ticket, and cheers from a few miles away.

@pcarbo
Copy link
Author

@pcarbo pcarbo commented Jun 22, 2020

Our packages have relied very heavily on Rcpp, RcppArmadillo, et al, and this is the first hicccup we have encountered — an (overdue) thank you to you!

@eddelbuettel
Copy link
Owner

@eddelbuettel eddelbuettel commented Jun 22, 2020

Yes, I sort-of keep a list of Rcpp using packages (which once started as a short list...) so I know of some of the StephensLab goodies. And we can blame the "hickup" on the road less traveled -- RcppGSL is (for whichever reason) used a lot less than RcppArmadillo (and I partly blame having to link to GSL, partly because some content is more esoteric....)

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.