tidyxl
tidyxl copied to clipboard
Can you make R Makevars specify gcc? ipcc fails.
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.
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.
- What is
icpc
? - Is it reasonable to expect everyone to have
gcc
on their platform? - Can this be configured in
Makevars
, or somewhere else? - How can I access a platform similar to yours to reproduce the error?
- that is the Intel C++ compiler
- 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.
- 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.
- Great question! I don't know the answer unfortunately.
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.
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.
@wdkrnls now that tidyxl and piton have been upgraded, please could you try building tidyxl? Thanks.
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.
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?
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.
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.