Shians / NanoMethViz

https://shians.github.io/NanoMethViz/
Apache License 2.0
24 stars 1 forks source link

Error: C++20 standard requested but CXX20 is not defined #32

Closed martin-g closed 1 year ago

martin-g commented 1 year ago

Hello,

The build of NanoMethViz at https://bioconductor.org/checkResults/3.18/bioc-LATEST/NanoMethViz/kunpeng2-install.html (Linux ARM64) fails with:

Error: C++20 standard requested but CXX20 is not defined

It seems this is the only Bioconductor package that requires CXX20.

I have looked around and found that it actually requires CXX17 - https://github.com/Shians/NanoMethViz/blob/master/DESCRIPTION#L82, done with https://github.com/Shians/NanoMethViz/commit/b5bedf69475c19ea0a7618b6190e3bc999a18baa

Assuming that the code here in Github is newer than at Bioconductor Git repo (https://code.bioconductor.org/browse/NanoMethViz/blob/devel/DESCRIPTION#L77, CXX20) I'd like to request for an update of the Bioc repo, so that the build of NanoMethViz is fixed.

Thank you!

Shians commented 1 year ago

Thank you very much for letting me know, I just pushed the fix to BioC devel.

sachingadakh commented 7 months ago

@martin-g Hello I am facing the same issue. Has it resolved for you?

martin-g commented 7 months ago

@sachingadakh Yes, https://bioconductor.org/checkResults/3.18/bioc-LATEST/NanoMethViz/kunpeng2-install.html compiles fine since a while!

martin-g commented 7 months ago

Oops, I noticed after sending my previous message that the link is for Bioconductor 3.18!

https://bioconductor.org/checkResults/3.19/bioc-LATEST/NanoMethViz/kunpeng2-install.html - 3.19 still fails the same way!

@Shians Could you please take a new look ?

Shians commented 7 months ago

Thanks for letting me know, how do you actually get to that page? I usually keep an eye on the build status from clicking the badge on the devel site. https://bioconductor.org/checkResults/devel/bioc-LATEST/NanoMethViz/, but it doesn't include the Linux build.

I'll roll it back to C++17 again, but C++20 has been available for 3-4 years now, I'd like to figure out why it's still not properly supported on that particular build machine, or perhaps I've missed something.

martin-g commented 7 months ago

The Linux ARM64 machine is an experimental "guest builder" at Bioconductor. It is not maintained by the Bioc core team but by a community user (me). It seems the builder has been excluded from the build farm few days ago:

I've contacted the Bioc core team why it has been excluded. I guess it is because of the update to R 4.4 beta that happened last week. I was a bit slow with it and maybe this caused some problems ...

About C++20: the system uses by default GNU compilers version 10.3.1. I will change it to use ver. 12. I guess this will resolve the issue! I'll keep you posted!

martin-g commented 7 months ago

About C++20: the system uses by default GNU compilers version 10.3.1. I will change it to use ver. 12. I guess this will resolve the issue! I'll keep you posted!

It was an error in ~/.R/Makevars! There I had entries like:

CXX20: g++
CXX20FLAGS: -g -O2
CXX20PICFLAGS: -fPIC
CXX20STD: -std=gnu++20

but the delimiter must have been =, i.e.

CXX20 = g++
CXX20FLAGS = -g -O2
CXX20PICFLAGS = -fPIC
CXX20STD = -std=gnu++20

All is fine now, even with GCC 10:

* installing to library ‘/home/biocbuild/R/R-beta-2024-04-15_r86425/site-library’
* installing *source* package ‘NanoMethViz’ ...
** using staged installation
** libs
using C++ compiler: ‘g++ (GCC) 10.3.1’
using C++20
g++ -std=gnu++20 -I"/home/biocbuild/R/R-beta-2024-04-15_r86425/include" -DNDEBUG  -I'/home/biocbuild/R/R-beta-2024-04-15_r86425/site-library/Rcpp/include' -I/usr/local/include    -fPIC  -g -O2  -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++20 -I"/home/biocbuild/R/R-beta-2024-04-15_r86425/include" -DNDEBUG  -I'/home/biocbuild/R/R-beta-2024-04-15_r86425/site-library/Rcpp/include' -I/usr/local/include    -fPIC  -g -O2  -c convert_methy_to_dss.cpp -o convert_methy_to_dss.o
...

You can revert your last commit that changed C++20 to C++17 in the DESCRIPTION file!

sachingadakh commented 7 months ago

Hello Everyone; thanks for addressing this issue again. I seriously don't know how, but when I attempted to install the NanoMethViz on the command line Linux Ubuntu, it got installed somehow without any warnings so far, and it is reflected in the R studio as well. Concerning the earlier suggestion by Martin-S, I tried to work around with ~/.R/Makevars but didn't find any such file in my R studio or R, in Linux, but anyhow, attempting to install via the command line worked for me. Thank you again