Page MenuHomePhabricator

Clang and std::regex (stlib) incompatibility
Closed, ResolvedPublic

Description

For the clang compiler version

Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)

there occurs an exception while compiling the regular expressions used by the DICOM Reader. Something similar occured for the older gcc compiler. This lead to setting up the minimal version to 4.9 (in T19791).

I am not sure which stdlib implementation was selected for the compilation, as there is no explicit -stdlib= flag specified for MITK, however installing the libc++-dev package from the repository and enforcing the compiler to use this one through

CMAKE_CXX_FLAGS:STRING='-stdlib=libc++ '

did solve the issue. I followed the information given in this StackOverflow post
http://stackoverflow.com/questions/29632840/why-doesnt-this-program-run-properly-under-clang-or-gcc

This should be mentioned in the documentation of supported platforms (compilers) or enforced for clang compiler through CMake.

Event Timeline

kislinsk edited projects, added MITK (2016-11); removed MITK.
nolden added subscribers: goch, nolden.

I reverted this and merged it to master. Fixes Ubuntu 16.04 Clang build and doesn't break 14.04 , so maybe this could be included in the release? @goch @kislinsk ;)