-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
general crayCC compilation failure #1091
Comments
It seems I cannot edit my own issue (older browser?), so I will add here that I am using the version I cloned this morning from the development branch. |
That doesn't look like a json library issue, that looks like that the included system headers for the C++ standard |
Try compiling something like this using the same steps as you used above and tell what happens (don't run it, just compile it): #include <memory>
void main() {
std::shared_ptr<void*> test;
test = &test;
test.reset();
} |
Thank you for your comment. You may well be right that this is a compiler issue.
and gcc making the same complaint in different wording. FYI, I believe the crayCC compiler is using the STL of gcc 6.1.0 Thanks again for your input, Casper |
Eh ignore the
Yeah which is why it makes me thing that the json library is using shared_ptr more completely than your project... It's definitely hard to tell though, I've never even heard of that compiler, I thought all other systems have basically migrated to clang backends by now instead of inventing their own compilers... ^.^; |
Both compilers accept your code example with the assignment Thanks again, Casper |
Is the cray compiler a modified gcc? If so then do you know what version it is based on? Any updated one? If it is not then another standard library might help? Maybe a command-line flag to disable atomic operations? |
These are hard questions! The compiling environment is kind of opaque to me, so I can not really answer them at this moment. Since you are essentially suggesting that the issue is likely not with the JSON library, I have contacted support of the machine in question and will report back as soon as there is news! In the meantime, thank your for helping! Casper |
I'm exceptionally curious about this. ^.^ |
A helpful computational scientist working at the site of the machine came up with an interesting solution. While my original example didn't compile with crayCC, the following does: #include <iostream>
#include "nlohmann/json.hpp"
int main()
{
using nlohmann::json;
auto a = std::make_shared<double>(5.0);
std::stringstream ss1;
ss1 << "[\"foo\",1,2,3,false,{\"one\":1}]";
json j = json::parse(ss1);
std::cout << "hello world!" << std::endl;
std::cout << j << std::endl;
} It is not clear to me why this would be necessary, and what the general underlying idea is of this fix (though I have asked for clarification on that). It seems that simply using the shared_ptr gets rid of the first few compilation errors, and that actually using JSON gets rid of the last. I'll have to see how this works out in my larger project since JSON will be an optional component, but this is a good start! |
That... is very odd! I'm quite curious in this bug... What is that compiler doing... |
@OvermindDL1, thank you very much for thinking with/for me! I have just implemented the fix posted above in my bigger project and it compiles fine now. Since at the moment I have no further information sources that could lead to a more general solution, I will close this issue. If I get any more feedback (from e.g. technical support of the machine) I will be sure to share! All the best, Casper |
I am very interested to use this amazing JSON library for my project. However, I am virtually tied to using the Cray Compiling Environment (CCE) and the Cray C++ compiler (crayCC). I realise that what I am reporting below may well be outside the scope of the developer(s), and that moreover, CrayCC is not on the list of supported compilers. Yet I want to make mention of this, and leave it up to the author to decide what to do with this information. Any help would be appreciated!
I have constructed a minimal working example (hello world) which does absolutely nothing with JSON except include the single header file:
this program is compiled with either gcc 7.2.0 producing expected behaviour (hello world!), and with crayCC 8.6.5 (https://pubs.cray.com/content/S-2179/8.6/cray-c-and-c++-reference-manual-s-2179-86/about-the-cray-and-c++-reference-manual).
the output is:
FYI,
_ZN23_INTERNAL_b13fd261_main9__gnu_cxx27__exchange_and_add_dispatchEPii$$CFE_id_b13fd261_main
demangles toand
_ZZN8nlohmann10basic_jsonISt3mapSt6vectorNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEblmdSaNS_14adl_serializerEE6createIS8_JRKS8_EEEPT_DpOT0_ENKUlPS8_E_clESJ_$$CFE_id_b13fd261_main
demangles toPlease let me know if any more information is required!
Casper
The text was updated successfully, but these errors were encountered: