Skip to content

Known Building Issues

Jose Alonso Solis-Lemus edited this page Jul 11, 2023 · 6 revisions

Eigen issues

Error shows as follows:

[ 63%] Performing configure step for 'Eigen'
loading initial cache file /Users/jsolislemus/dev/build/CEMRGapp/ep/tmp/Eigen-cache-Release.cmake
-- Standard libraries to link to explicitly: none
-- Found unsuitable Qt version "5.12.2" from /Users/jsolislemus/installs/Qt/5.12.2/clang_64/bin/qmake
CMake Error at cmake/EigenConfigureTesting.cmake:27 (string):
  string sub-command REGEX, mode MATCH needs at least 5 arguments total to
  command.

Solution Open the $CEMRG_BUILD/ep/src/Eigen/cmake/EigenConfigureTesting.cmake file and adding quotations where appropriate to lines 27, 29 and 31.

Lines 22-35 will look as follows:

# Overwrite default DartConfiguration.tcl such that ctest can build our unit tests.
# Recall that our unit tests are not in the "all" target, so we have to explicitely ask ctest to build our custom 'buildtests' target.
# At this stage, we can also add custom flags to the build tool through the user defined EIGEN_TEST_BUILD_FLAGS variable.
file(READ  "${CMAKE_CURRENT_BINARY_DIR}/DartConfiguration.tcl" EIGEN_DART_CONFIG_FILE)
# try to grab the default flags
string(REGEX MATCH "MakeCommand:.*-- (.*)\nDefaultCTestConfigurationType" "EIGEN_DUMMY" "${EIGEN_DART_CONFIG_FILE}")
if(NOT CMAKE_MATCH_1)
string(REGEX MATCH "MakeCommand:.*[^c]make (.*)\nDefaultCTestConfigurationType" "EIGEN_DUMMY" "${EIGEN_DART_CONFIG_FILE}")
endif()
string(REGEX REPLACE "MakeCommand:.*DefaultCTestConfigurationType" "MakeCommand: ${CMAKE_COMMAND} --build . --target buildtests --config \"\${CTEST_CONFIGURATION_TYPE}\" -- ${CMAKE_MATCH_1} ${EIGEN_TEST_BUILD_FLAGS}\nDefaultCTestConfigurationType"
       "EIGEN_DART_CONFIG_FILE2" "${EIGEN_DART_CONFIG_FILE}")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/DartConfiguration.tcl" ${EIGEN_DART_CONFIG_FILE2})

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake.in ${CMAKE_BINARY_DIR}/CTestCustom.cmake)

DCMTK issue ofstd_tests

Make sure you have the following installed:

apt-get install libxss1
apt install libnspr4
apt install libnss3

Also, check the DCMTK-Build folder on cmake. Make sure the following variables are properly set:

  • DCMTK_ENABLE_CHARSET_CONVERSION=stdlibc (iconv)

  • DCMTK_WITH_ICU=OFF

macOS compilation tips and troubleshooting

wchar.h not found

This problem occurs when compiling CppMicroServices, normally in macOS:

[  4%] Linking resources zip file for CppMicroServices
In file included from /Users/jsolislemus/dev/src/mitk2018.04.2/Modules/CppMicroServices/cmake/usCMakeResourceDependencies.cpp:22:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iostream:38:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/ios:215:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iosfwd:96:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/wchar.h:119:15: fatal error: 'wchar.h' file not found

Solution Open an editor, we recommend VSCode as it allows to Replace in multiple files, go to the $CEMRG_BUILD/MITK-build/Modules directory and search for all instances of -o stub.o, and replace for

-o stub.o -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk

then navigate to the $CEMRG_BUILD/MITK-build/and run make. It is important form this step to do it here.

limb not found

Get openlibm from homebrew.

brew install openlibm