Json: Logs are repeating while cmake

Created on 23 Oct 2019  路  5Comments  路  Source: nlohmann/json

  • What is the issue you have?
    I am trying to use this library within my C++ project, so using the Embedded feature as described in README.
    I am cross-compiling it for AM437, and in the CMakeLists.txt, I have provided the path for compiler to be CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++
    After adding the JSON library, it asked for the absolute path, so I provided that as CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-g++

But after this change, cmake .. is not getting completed and logs are repeating periodically as below:
`-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using the single-header code from /home/eternal/work/am437x_peripherals/json/single_include/
-- Configuring done
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_CXX_COMPILER= /usr/bin/c++

-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using the single-header code from /home/eternal/work/am437x_peripherals/json/single_include/
-- Configuring done
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_CXX_COMPILER= /usr/bin/c++

-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
^C
`

  • Please describe the steps to reproduce the issue. Can you provide a small but working code example?
    The issue is appearing at the CMAKE level only, and I followed the procedure as defined in the Embedded section in README.

  • What is the expected behavior?
    Logs are repeating and cmake itself is not getting completed

  • And what is the actual behavior instead?
    cmake should get complete and I should be able to make to experiment with building JSON

  • Which compiler and operating system are you using? Is it a supported compiler?
    We are using arm-linux-gnueabihf-g++.1 for our compilation

  • Did you use a released version of the library or the version from the develop branch?
    It was develop branch

  • If you experience a compilation error: can you compile and run the unit tests?

bug proposed fix needs more info stale

Most helpful comment

@saurabhbansal90

Cmake is telling you

You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_CXX_COMPILER= /usr/bin/c++

so this is expected. Try with a clean build directory and set all cmake variables in one call. If it happens then again (which it shouldn't) please post the exact command.

All 5 comments

I am not sure whether this is really related to the library. In any case, I am not a CMake expert, so I hope someone can help.

@saurabhbansal90

Cmake is telling you

You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_CXX_COMPILER= /usr/bin/c++

so this is expected. Try with a clean build directory and set all cmake variables in one call. If it happens then again (which it shouldn't) please post the exact command.

@saurabhbansal90 Did https://github.com/nlohmann/json/issues/1809#issuecomment-545475617 fix the issue?

For reconfiguring CMake the typical solution is deleting CMakeCache.txt (and if this doesn't help also the folder CMakeFiles/) to prevent any side effects. That's a CMake problem that affects any project.

But the bug here seems to be that CMake runs into an endless loop which shouldn't happen.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings