Tencent / rapidjson

A fast JSON parser/generator for C++ with both SAX/DOM style API
http://rapidjson.org/
Other
14.14k stars 3.52k forks source link

Compile with PGI and CRAY compilers #1115

Open bonfus opened 6 years ago

bonfus commented 6 years ago

Hi, just to let you know that changing this line:

https://github.com/Tencent/rapidjson/blob/17ae6ffa857173c25708e61610121bc908c0a6cd/include/rapidjson/internal/biginteger.h#L255

and this line:

https://github.com/Tencent/rapidjson/blob/17ae6ffa857173c25708e61610121bc908c0a6cd/include/rapidjson/internal/diyfp.h#L77

to

#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) && !defined(__PGIC__) && !defined(_CRAYC)

allows to successfully compile the current master branch of rapidjson with Cray Compilers and PGI compilers (v 17.5). There's probably a better strategy to do this anyway.

miloyip commented 6 years ago

Thank you for your info. But I am not sure if I should modify this...

Bu11etmagnet commented 6 years ago

Why do Cray Compilers and PGI compilers define GNUC ? Perhaps there should be a different test for (what I guess is) checking whether __int128 is available. This is what autoconf is for.

DavidPoliakoff commented 5 years ago

Just letting you know I've run into the issue as well. Regrettably, I'm solving it in my code by checking in my code if I'm using PGI. Then, right before including you, I unset GNUC. I include you, then reset GNUC to its old value.

...I'm not nominating it for any software engineering awards, but specifically to solve this problem, it works.