Concurrency issue during configuration step ? (`No CMAKE_OBJCXX_COMPILER could be found.`)

Hi people :wave:

My current challenge is to enable parallelization for an e2e tests suite.

The fun part is that what we test is also based on CMake. So each test will run the cmake configure command.

Before parallelization, all worked adequately, but now I get this error:

59: -- Executing: cmake -S <a-path> -B <a-path> -G Xcode -DCMAKE_BUILD_TYPE=Release
59: -- The CXX compiler identification is AppleClang
59: -- The OBJCXX compiler identification is unknown
59: -- Detecting CXX compiler ABI info
59: -- Detecting CXX compiler ABI info - done
59: -- Check for working CXX compiler: /Applications/ - skipped
59: -- Detecting CXX compile features
59: -- Detecting CXX compile features - done
59: CMake Error at CMakeLists.txt:19 (project):
59:   No CMAKE_OBJCXX_COMPILER could be found.

Maybe some of this forum audience know about a project that runs parallel tests that use CMake underneath?

Note: I’m in the CI context (CircleCI)

@tonygo Can you reproduce this outside of CTest? i.e. can you try running the various CMake-based tests directly from your terminal, in parallel?

Does it work there, or does it fail in the same way as within CTest?

1 Like

Yeah, I’m working on a script that will run cmake configuration in parallel, the same CMake file with different parameters for instance.

I’d prefer to post that topic earlier in my research as someone could already have the same experience.

I’m not sure what structural arrangement you’re using, but you must not run more than one CMake instance for a given build directory at the same time. Parallel instances in different build directories should be fine though.

1 Like

In-source builds take the Highlander approach to things: there can only be one. Instead, use a per-test build directory.

1 Like

Thanks @ben.boeckel @craig.scott

Some of our test suits use the same build directory; I’ll see if I can inject something to make each unique.