Page MenuHomePhabricator

Build error: Could not find git for clone of qRestAPI
Open, NormalPublic

Description

When configuring and building MITK with cmake via command line, I get the following error, if I build a second time using the same build-directory that was used before for building:

cmake --build . --target ALL_BUILD --config Release
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Creating directories for 'CTK'
  Building Custom Rule D:/MITK-BSQ/src/CMakeLists.txt
  CMake does not need to re-run because D:/MITK-BSQ/build2/CMakeFiles/generate.stamp is up-to-date.
  Performing download step (download, verify and extract) for 'CTK'
  -- verifying file...
         file='D:/MITK-BSQ/build2/ep/src/CTK_kislinsk_fix-pythonlibs-handling.tar.gz'
  -- File already exists and hash match (skip download):
    file='D:/MITK-BSQ/build2/ep/src/CTK_kislinsk_fix-pythonlibs-handling.tar.gz'
    MD5='49e1652cc505bdf3f77210976df97d63'
  -- extracting...
       src='D:/MITK-BSQ/build2/ep/src/CTK_kislinsk_fix-pythonlibs-handling.tar.gz'
       dst='D:/MITK-BSQ/build2/ep/src/CTK'
  -- extracting... [tar xfz]
  -- extracting... [analysis]
  -- extracting... [rename]
  -- extracting... [clean up]
  -- extracting... done
  No update step for 'CTK'
  No patch step for 'CTK'
  Performing configure step for 'CTK'
  loading initial cache file D:/MITK-BSQ/build2/ep/tmp/CTK-cache-Release.cmake
  -- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.10240.
  -- Generated: D:/MITK-BSQ/build2/ep/src/CTK-build/DGraphInput-alldep.txt
  CMake Error at C:/Program Files/CMake/share/cmake-3.14/Modules/ExternalProject.cmake:2427 (message):
CUSTOMBUILD : error : could not find git for clone of qRestAPI [D:\MITK-BSQ\build2\CTK.vcxproj]
  Call Stack (most recent call first):
    C:/Program Files/CMake/share/cmake-3.14/Modules/ExternalProject.cmake:3211 (_ep_add_download_command)
    CMakeExternals/qRestAPI.cmake:60 (ExternalProject_Add)
    CMake/ctkMacroCheckExternalProjectDependency.cmake:795 (include)
    CMake/ctkMacroCheckExternalProjectDependency.cmake:858 (ExternalProject_Include_Dependencies)
    CMake/ctkBlockCheckDependencies.cmake:134 (ExternalProject_Include_Dependencies)
    CMakeLists.txt:979 (include)


  -- Generated: D:/MITK-BSQ/build2/ep/src/CTK-build/DGraphInput-alldep-withext.txt
  -- Generated: D:/MITK-BSQ/build2/ep/src/CTK-build/DGraphInput.txt
  -- SuperBuild - First pass
  -- SuperBuild - First pass - done
  -- SuperBuild - Log4Qt[OPTIONAL]
  -- SuperBuild - VTK[OPTIONAL]
  -- SuperBuild - PythonQt[OPTIONAL]
  -- SuperBuild - ZMQ[OPTIONAL]
  -- SuperBuild - QtSOAP[OPTIONAL]
  -- SuperBuild - qxmlrpc[OPTIONAL]
  -- SuperBuild - OpenIGTLink[OPTIONAL]
  -- SuperBuild - ITK[OPTIONAL]
  -- SuperBuild - QtTesting[OPTIONAL]
  -- SuperBuild - CTK => Requires DCMTK, qRestAPI,
  -- SuperBuild -   DCMTK[OK]
  -- SuperBuild -   qRestAPI[OK]
  -- Configuring incomplete, errors occurred!
  See also "D:/MITK-BSQ/build2/ep/src/CTK-build/CMakeFiles/CMakeOutput.log".

This happened using Windows and Linux with CMake 3.14.5

Event Timeline

kalali triaged this task as Normal priority.Dec 5 2019, 10:08 AM
kalali created this task.

Maybe Git is not in PATH?

Well, first time works.

kalali added a comment.Dec 5 2019, 2:08 PM

Happens with VM and Azure. Local windows works (for now).

kalali added a comment.Dec 5 2019, 5:52 PM

Using my local windows I get the output message:

CUSTOMBUILD : CMake warning :  [D:\MITK-BSQ\build2\CTK.vcxproj]
    Manually-specified variables were not used by the project:

      Git_EXECUTABLE


  -- Build files have been written to: D:/MITK-BSQ/build2/ep/src/CTK-build
  Performing build step for 'CTK'
  Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
  Copyright (C) Microsoft Corporation. All rights reserved.

    Checking Build System
    CMake does not need to re-run because D:/MITK-BSQ/build2/ep/src/CTK-build/CMakeFiles/generate.stamp is up-to-date.
    Creating directories for 'DCMTK'
    Building Custom Rule D:/MITK-BSQ/build2/ep/src/CTK/CMakeLists.txt
    CMake does not need to re-run because D:/MITK-BSQ/build2/ep/src/CTK-build/CMakeFiles/generate.stamp is up-to-date.
    No download step for 'DCMTK'
    No update step for 'DCMTK'
    No patch step for 'DCMTK'
    No configure step for 'DCMTK'
    No build step for 'DCMTK'
    No install step for 'DCMTK'
    Completed 'DCMTK'
    Creating directories for 'qRestAPI'
    Building Custom Rule D:/MITK-BSQ/build2/ep/src/CTK/CMakeLists.txt
    CMake does not need to re-run because D:/MITK-BSQ/build2/ep/src/CTK-build/CMakeFiles/generate.stamp is up-to-date.
    Performing download step (git clone) for 'qRestAPI'
    Cloning into 'qRestAPI'...
    Note: checking out 'ddc0cfcc220d0ccd02b4afdd699d1e780dac3fa3'.
floca added a subscriber: floca.Dec 5 2019, 9:39 PM

I have the same error on my local Ubuntu VM. But only if configure via CMake command line. If I use the CMake gui and set the same values, then everything works fine.
Generator does not matter I have the problem with make and ninja; with one and multiple jobs.

kalali added a comment.Dec 6 2019, 3:59 PM

Using CMake command line I get this error with my local windows, if I build it the second time.

floca added a subscriber: gaoh.Dec 6 2019, 4:38 PM

I have managed to compile now just using cmake cli, when doing the following:

  1. Run: cmake -G "Ninja" ../source
  2. Run: cmake -DQt5_DIR:PATH=<myQt5path> -G "Ninja" ../source
  3. Run: cmake -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_TESTING:BOOL=OFF -DMITK_BUILD_CONFIGURATION:STRING=FlowBenchSegmentationRelease -G "Ninja" ../source

So emulating the cmake gui, by first doing a plain configure. Then adding Qt5. And then the rest.

Did not check so far if it can condensed to two steps. But it seems that something in our superbuild needs a rerun to be correctly configured or does not like to have all parameter set at onces.

@gaoh Could also be of interest for your compile issues ?!?

gaoh added a comment.Dec 9 2019, 4:52 PM

A two step build also works:

RUN cmake -DQt5_DIR:PATH=<myQt5path> ../source
RUN cmake \
  -DCMAKE_BUILD_TYPE:STRING=Release  \
  -DBUILD_TESTING:BOOL=OFF  \
  -DMITK_BUILD_CONFIGURATION:STRING=FlowBenchSegmentationRelease \
  -DCMAKE_INSTALL_PREFIX=/opt/install \
  ../source \
  && make -j"$(nproc)"

There seems to be a problem with the -DBUILD_TESTING:BOOL=OFF option.
If you use CMake-GUI the variable is ON per default when first configured and is then set to OFF (if you choose so) and re-configured.

That's why the two-step-build (three-step-build) works. The testing-variable is enabled initially and sets some configuration parameters(?).
Check if the two step build does not work if you do:

  1. cmake -DQt5_DIR:PATH=<myQt5path> -DBUILD_TESTING:BOOL=OFF -G "Ninja" ../source
  2. cmake -DCMAKE_BUILD_TYPE:STRING=Release -DMITK_BUILD_CONFIGURATION:STRING=FlowBenchSegmentationRelease -G "Ninja" ../source

When building CTK, the output writes:

Manually-specified variables were not used by the project:
[...]
Git_EXECUTABLE