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
infomap.cc: error: 'isnan' was not declared in this scope; did you mean 'std::isnan' #669
Comments
I've already fixed this yesterday because of this and I'll submit a fix to MacPorts as well. However, my understand was that this issue should only occur with GCC 5 and earlier. It seems you are using GCC 12. I'm not even sure how to do this, as using Can you give complete instructions for reproducing this? |
The R portgroup is set to use the same compiler which is used to build R. So you need to set libcxx to libstdc++ and use gcc to build R. Then the same settings can be used for R packages. On PowerPC that is the default, but I have the same setup on 10.6.8 x86_64, without any clangs, only gcc. |
I tried to compile R/igraph 1.4.0, as it is now on CRAN, using GCC 12, independently of MacPorts, but I cannot reproduce the issue. Nor do I see any way for this to occur with GCC 6 or later. Here are the complete details: I'm on macOS 10.14.6, using the official R binary distribution from https://www.r-project.org/, version 4.2.2 (i.e. not R from MacPorts). For this experiment, this is the contents of my
This is meant to force R to use GCC 12 from MacPorts. It seems that specifying Then in R, I run
and also later I can see that I cannot reproduce the issue this way. Now let's go back to MacPorts and do
It still uses clang-14 instead of gcc-12. So I cannot test this using MacPorts's R. @barracuda156 Is it possible that when you encountered this problem, you were in fact using a GCC version older than 6? What I am looking for here is to confirm that the issue does not occur with GCC 6 and later, or with Clang. If you can confirm this then I'll be confident that I understand the problem, and the fix will be in the next version. |
@szhorvat It is absolutely with gcc12, as you can see from the log. In fortran isnan is a part of ieee_arithmetic which is not supported on several archs and platforms. But igraph seems to use it in C. Then it is apparently a bug in the code. It should be 100% reproducible in 10.6.8 Rosetta. It can be tested in VM with native build for ppc with gcc12. I am pretty sure you get the same error on 10.5.8 with gcc7, which is the default compiler in Macports for < 10. |
I do not have access to such old OS X versions.
Actually the log does not show the compiler call, only that However, my understanding is that the issue is in the headers. You can read more here: https://developers.redhat.com/blog/2016/02/29/why-cstdlib-is-more-complicated-than-you-might-think Notice that the header mentioned in the error is actually
I do not believe this is an issue in igraph. Here's a minimal example that demonstrates the problem in GCC 5 and earlier: https://godbolt.org/z/dodzqacGs You can try this on your system to see if it's a bug in the headers. Compile the following using
This is valid code, and it should compile. All that said, a workaround will be included in igraph 1.4.1. |
@szhorvat I got an early flight tomorrow, so please allow me a day. But hopefully we can resolve this issue, otherwise everything is broken on PPC. If For gcc version, Macports chooses gcc7 for <10 and gcc12 for >=10. I am pretty sure gcc can be used to build R and R ports on any macOS, but I can try once I am back home. Generally speaking, builds with gcc should be tested for anything of importance. It is the only compiler universally supported. P. S. It is fairly easy to install 10.6.8 in VM, but perhaps not worth it for a single case. |
@szhorvat UPD. So the fix is this, right? igraph/igraph@7b42197#commitcomment-100264931 |
The same failure occurs on 10.6.8
|
@szhorvat (Sorry for sporadic replies, I am just back home today and sorting things out.) There is no variant defined, so
Two caveats:
|
My suggestion is to just wait for 1.4.1, which replaces It seems that the build did succeed on the MacPorts buildbots on all platforms that builds are produced for, inlcuding 10.6 i386 and x86_64: https://ports.macports.org/port/R-igraph/builds/ So this issue will affect very few people: only those who use a very old system, and choose a non-default compiler. A separate issue is whether there's a problem with |
If it is coming soon, then sure.
I think they all use Clang (in Macports), and the issue we are getting happens with GCC.
While I do not get obsession with Clang, using a non-default compiler is not a concern on my side (for that we would need far more than fixing a single port). But on PowerPC default compiler is GCC, and will remain GCC indefinitely (hopefully Macports will move from gcc7 to gcc12/13 across the board).
This is probably not something I can easily debug, I do not understand |
I'm going to close this now since the affected 1.4.1, which will include the fix, is planned to be submitted soon. |
@szhorvat Maybe we could have a patch for now, instead of having everything broken? ( |
And we got the same error with
|
The update is already submitted to CRAN, but it takes time for it to go through the approval process. I don't have time to submit a special patch right now, but hopefully there'll be an 1.4.1 soon.
Maybe that's a bit of an overstatement, since this seems to affect only very old platforms used by a small minority of people. Note that 10.6 on i386 and x86_64 are not affected. Only PCC seems to be affected, or more generally: systems which use headers from GCC 5 or earlier. |
Got it, sounds good.
IMO this is rather a problem of igraph+gcc+legacysupport (?) combo than of an arch. Macports, unfortunately, only tests with Clangs, so we have no idea what is going on with gcc builds. But it is not a problem exclusive to gcc5 (I won’t build gcc5 just to try, but for me these failures occur with gcc12). |
This error appeared in 1.4.0, earlier version built fine.
@szhorvat Somewhat unexpected breakage, but I should have tested earlier.
The text was updated successfully, but these errors were encountered: