Skip to content
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

Which version can be used with GCC 4.8.2 ? #1424

Closed
samfux84 opened this issue Jan 10, 2019 · 4 comments
Closed

Which version can be used with GCC 4.8.2 ? #1424

samfux84 opened this issue Jan 10, 2019 · 4 comments
Labels
kind: question solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@samfux84
Copy link

I am installing the software MrTrix3 on our HPC cluster. It requires JSON for modern c++ as a dependency. Our main toolchain to build software is GCC 4.8.2.

Even though the "supported compilers" section in the README states that GCC 4.8 - 9.0 (and possibly later) are supported, JSON for modern c++ 3.5.0 fails, because the header file contains a check for the GCC version that fails for GCC < 4.9.0.

Can this check just be changed to

#if (GNUC * 10000 + GNUC_MINOR * 100 + GNUC_PATCHLEVEL) < 40800

to allow for GCC 4.8.2 or is there any older JSON for modern c++ version that works with GCC 4.8.2 ?

@nickaein
Copy link
Contributor

You might read the Supported compilers section of project description. There are some notes on GCC compiler support there.

Also as a workaround, you can disable the check for compiler support by defining JSON_SKIP_UNSUPPORTED_COMPILER_CHECK macro before including this library. Do you get any error in compile/runtime with that?

@nlohmann
Copy link
Owner

I am confused: the compiler check

// exclude unsupported compilers
#if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK)
    #if defined(__clang__)
        #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400
            #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers"
        #endif
    #elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER))
        #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800
            #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"
        #endif
    #endif
#endif

allows any GCC 4.8 version. Though we only test with GCC 4.8.5 on Travis, also GCC 4.8.2 may work, and it definitely should not trigger the compiler check.

Could you double check your compiler version and that it really triggers the error?

@nlohmann nlohmann added the state: needs more info the author of the issue needs to provide more details label Jan 11, 2019
@samfux84
Copy link
Author

@nlohmann : I am sorry, there was a mistake on my side. I did not notice that MrTRIX3 has bundled an older JSON version (2.1.1) and is not even using the 3.5.0 version that I have installed.

@nlohmann nlohmann added kind: question solution: proposed fix a fix for the issue has been proposed and waits for confirmation and removed state: needs more info the author of the issue needs to provide more details labels Jan 14, 2019
@nlohmann
Copy link
Owner

Thanks for checking back!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: question solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

No branches or pull requests

3 participants