Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCompilation issue: UINT64_MAX/UINT64_C not declared in scope #27
Comments
|
These are odd errors, since both these macros should be defined in |
|
Hi, thanks for the comment. Yes this is almost certainly due to an old glibc version:
/usr/include/stdint.h has these lines:
|
|
As it stands, the If we're fixing it by adding macros, we should probably use a more C++ idiomatic approach: // Not tested!
#ifndef UINT64_C
#define UINT64_C(c) std::static_cast<std::uint64_t>(c)
#endif
#ifndef UINT64_MAX
#define UINT64_MAX UINT64_C(-1)
#endif |
|
Instead of defining our own macros, I would prefer to use those provided in
Unfortunately I cannot reproduce the issue. A @snsansom How did you install gcc 5.3.0 on CentOS 6? Are you willing to test-drive a |
|
Whatever solution you decide on, keep in mind that the same solution will need to be used for all downstream packages that |
|
I have now implemented 1 in a separate header file, since both @snsansom Can you give https://github.com/daqana/dqrng/tree/issue/27 a try? E.g. via
|
|
Many thanks both. Unfortunately
did not fix the issue for me: compile.messages.log |
|
That's to bad. Can you tell me then how you installed gcc 5.3.0 on CentOS 6? This might help me reproducing the issue. |
|
Sure gcc was compiled with a custom install location (--prefix) and installed as a bash module with the "bin" location prepended to $PATH and the "lib" + "lib64" locations prepended to the $LD_LIBRARY_PATH. So far we've no issues with other R packages (>400, including many from Bioconductor) on R 3.4, 3.5 or 3.6. With this said if this is not an issue for anyone else we can easily work around! |
|
I think I have found the reason why my patch did not solve the issue: What would your workaround entail? Since the issue here is missing C++11 compatibility I am inclined to mark this as "wontfix" for now. BTW, searching for |
|
Can we just modify |
|
Problem is that
It is just the first to be compiled. |
|
Hm, okay. It would be very unpalatable to have to edit the PCG headers, that would break our ability to just copy-and-paste updates of the PCG source. I guess we could just manually define I would also be content with leaving it as it is; but I would request adding a |
|
@rstub Brilliant that fixes the issue! Thanks all for the help with this. |
fixes #27 * New file mystdint.h making the C99 macros available in C++ * Construct a uint64_t instead of using the UINT64_C macro * Define UINT64_MAX as a last resort
R 3.6.0
dqrng 0.2.0
Centos 6 with gcc 5.3.0
I encountered the following compilation issue:
Adding the following lines to inst/include/xoshiro.h (after the #include cstdint statement) fixes the issue: