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

Can you make R Makevars specify gcc? ipcc fails. #62

Open
wdkrnls opened this issue Sep 11, 2020 · 9 comments
Open

Can you make R Makevars specify gcc? ipcc fails. #62

wdkrnls opened this issue Sep 11, 2020 · 9 comments

Comments

@wdkrnls
Copy link

wdkrnls commented Sep 11, 2020

Hello,

I noticed that the Intel compiler barfs on your package when trying to link with piton.

icpc -std=gnu++11 -I"/opt/R/R-4.0.2-mkl/lib64/R/include" -DNDEBUG  -I'/home/me/R/lib/pro/4.0/Rcpp/include' -I'/home/me/R/lib/pro/4.0/piton/include' -I/usr/local/include   -fpic  -g -O2  -c xlex.cpp -o xlex.o
token_grammar.h(107): error: "seq" is ambiguous
                                     seq< plus< D >, opt< dot, plus< D > > > > {};
                                     ^
          detected during:
            instantiation of class "xltoken::decimal<D> [with D=tao::pegtl::ascii::digit]" at line 35 of "/home/me/R/lib/pro/4.0/piton/include/pegtl/internal/duseltronik.hpp"

It seems to build fine with gcc.

@nacnudus
Copy link
Owner

nacnudus commented Sep 14, 2020

Thanks @wdkrnls. I know next to nothing about compilers, so if you can help me with any of these questions then I could do this more quickly.

  1. What is icpc?
  2. Is it reasonable to expect everyone to have gcc on their platform?
  3. Can this be configured in Makevars, or somewhere else?
  4. How can I access a platform similar to yours to reproduce the error?

@wdkrnls
Copy link
Author

wdkrnls commented Sep 25, 2020

  1. that is the Intel C++ compiler
  2. I am not sure. I was under the impression that Microsoft R was all compiled with the Intel Compiler. However, in my case GCC is also installed, but Intel is the default compiler on our High Performance Computing cluster.
  3. I think this is the relevant R documentation on making the code more portable to other infrastructures: https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Writing-portable-packages and https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Using-Makevars - this StackOverflow question might also be useful as it gives examples and answers from Dirk Eddelbuettel.
  4. Great question! I don't know the answer unfortunately.

@nacnudus
Copy link
Owner

nacnudus commented Oct 8, 2020

Thanks for replying. The piton package will hopefully be upgraded to the latest version of pegtl (which is the C library that it wraps). I'm going to wait until that happens before doing anything, because that might be where the bug is.

@wdkrnls
Copy link
Author

wdkrnls commented Oct 9, 2020

I will look out for that upgrade and give building tidyxl another shot then on the Intel compiler. In the meantime, my friendly sysadmins have graciously gotten me set up with a pure gcc R+openblas setup as well so I and all my colleagues can benefit from this indispensable tool. Thanks so much for sharing your genius.

@nacnudus
Copy link
Owner

@wdkrnls now that tidyxl and piton have been upgraded, please could you try building tidyxl? Thanks.

@wdkrnls
Copy link
Author

wdkrnls commented Dec 9, 2020

Hi @nacnudus,

I just tried again today with the Intel compiler. I'm still seeing "compilation aborted for xlex.cpp (code 2)". Fortunately, I have been able to keep everyone going with tidyxl using the gcc compiler.

@nacnudus
Copy link
Owner

nacnudus commented Dec 9, 2020

I wonder whether it would be as simple as putting CC="gcc" and CXX="g++" into src/Makevars. Would you be able to try that?

@nacnudus
Copy link
Owner

It turns out that packages can't override CC or CXX https://stackoverflow.com/a/49239581/937932. So I'll have to work out how to build and debug tidyxl with icc.

@wdkrnls
Copy link
Author

wdkrnls commented Jan 2, 2021

Perhaps you can check with the rstan developers for tips about what they do? They require the user to setup a special ~/.R/Makevars file to configure the compilation of Stan programs. Honestly, I think just including the warning to stick with gcc is enough. I am thankful you are volunteering your time to support the R community, and don't want to derail your invaluable efforts towards a niche use case which isn't free and thus hard to support.

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