Page MenuHomePhabricator

[Dashboard] Open CV Tests crash
Closed, ResolvedPublic

Description

Some windows dart clients report errors when running openCV dependent tests [1,2].

These tests crash due to missing dlls when run from a clean command line, after
\MITK-superbuild\ep\bin has been added to the PATH.

I tested it for two of those tests:

mitkCropOpenCVImageFilterTest additionally needs \MITK-superbuild\ep\src\OpenCV-build\bin\Release in the PATH.

mitkUSDeviceTest needs the above and \Qt\5.4\msvc2013_64_opengl\bin\ to work.

[1] http://cdash.mitk.org/viewTest.php?onlyfailed&buildid=563809
[2] http://cdash.mitk.org/viewTest.php?onlyfailed&buildid=563830

Event Timeline

The MITKDashboardSetup.cmake should take care of this:
set(CTEST_PATH "${CTEST_PATH};${CTEST_BINARY_DIRECTORY}/ep/bin;${QT_BINARY_DIR};${SOFA_BINARY_DIR};${BLUEBERRY_RUNTIME_DIR};${OPENCV_BIN_DIR}")

When starting the dart client it immediately fails to find the opencv path:
OpenCV runtime path: OPENCV_BIN_DIR-NOTFOUND

Tried changing the previous section:

if(WIN32)

if(CMAKE_CL_64)
  set(CMAKE_LIBRARY_ARCHITECTURE x64)
else()
  set(CMAKE_LIBRARY_ARCHITECTURE x86)
endif()
find_path(OPENCV_BIN_DIR opencv_core2411.dll
  PATHS "${CTEST_BINARY_DIRECTORY}/ep/${CMAKE_LIBRARY_ARCHITECTURE}"
  PATH_SUFFIXES vc10/bin vc11/bin vc12/bin vc13/bin vc14/bin
  NO_DEFAULT_PATH
)
message("OpenCV runtime path: ${OPENCV_BIN_DIR}")

set(SOFA_BINARY_DIR "${CTEST_BINARY_DIRECTORY}/ep/src/SOFA-build/bin/${CTEST_BUILD_CONFIGURATION}")
set(BLUEBERRY_RUNTIME_DIR "${CTEST_BINARY_DIRECTORY}/MITK-build/bin/plugins/${CTEST_BUILD_CONFIGURATION}")

set(CTEST_PATH "${CTEST_PATH};${CTEST_BINARY_DIRECTORY}/ep/bin;${QT_BINARY_DIR};${SOFA_BINARY_DIR};${BLUEBERRY_RUNTIME_DIR};${OPENCV_BIN_DIR}")

endif()

to

if(WIN32)

if(CMAKE_CL_64)
  set(CMAKE_LIBRARY_ARCHITECTURE x64)
else()
  set(CMAKE_LIBRARY_ARCHITECTURE x86)
endif()
string(SUBSTRING "${CMAKE_VS_PLATFORM_TOOLSET}" 1 2 vc_version)

set(OPENCV_BIN_DIR "${CTEST_BINARY_DIRECTORY}/ep/${CMAKE_LIBRARY_ARCHITECTURE}/vc${vc_version}/bin")
message("OpenCV runtime path: ${OPENCV_BIN_DIR}")

set(SOFA_BINARY_DIR "${CTEST_BINARY_DIRECTORY}/ep/src/SOFA-build/bin/${CTEST_BUILD_CONFIGURATION}")
set(BLUEBERRY_RUNTIME_DIR "${CTEST_BINARY_DIRECTORY}/MITK-build/bin/plugins/${CTEST_BUILD_CONFIGURATION}")

set(CTEST_PATH "${CTEST_PATH};${CTEST_BINARY_DIRECTORY}/ep/bin;${QT_BINARY_DIR};${SOFA_BINARY_DIR};${BLUEBERRY_RUNTIME_DIR};${OPENCV_BIN_DIR}")

endif()

However the tests still fail on the dart client.

It seems one of the problems is that not all of the cmake variables are available at that point. The following section uses variable already set in the dart client cmake script and should produce the desired path:

set(CTEST_PATH "$ENV{PATH}")
if(WIN32)

if("${CTEST_CMAKE_GENERATOR}" MATCHES ".*Win64")
  set(CMAKE_LIBRARY_ARCHITECTURE x64)
else()
  set(CMAKE_LIBRARY_ARCHITECTURE x86)
endif()
string(SUBSTRING "${MY_COMPILER}" 2 2 vc_version)

set(OPENCV_BIN_DIR "${CTEST_BINARY_DIRECTORY}/ep/${CMAKE_LIBRARY_ARCHITECTURE}/vc${vc_version}/bin")

set(SOFA_BINARY_DIR "${CTEST_BINARY_DIRECTORY}/ep/src/SOFA-build/bin/${CTEST_BUILD_CONFIGURATION}")
set(BLUEBERRY_RUNTIME_DIR "${CTEST_BINARY_DIRECTORY}/MITK-build/bin/plugins/${CTEST_BUILD_CONFIGURATION}")

set(CTEST_PATH "${CTEST_PATH};${CTEST_BINARY_DIRECTORY}/ep/bin;${QT_BINARY_DIR};${SOFA_BINARY_DIR};${BLUEBERRY_RUNTIME_DIR};${OPENCV_BIN_DIR}")

endif()

User goch has pushed new remote branch:

bug-18907-opencv-path-on-dartclient

[903a2a]: Merge branch 'bug-18907-opencv-path-on-dartclient'

Merged commits:

2015-04-01 18:29:30 Caspar Goch [fad281]
Use dashboard script variables instead of find

The build has not started when find is called and therefore there is
no directory to be found. Also at this point some of the used variables
have not been filled yet.