Issue 1:
System information (version)

OpenCV => 4.0.1

Operating System / Platform => Ubuntu 16.04 LTS

Compiler => gcc 5.5.0

Detailed description

Related to: opencv_contrib (probably)

Probably it is related to the tests compilation.

See CMakeError log after the CMake configuration info in the down part of this issue.

Compilation fails in:

[ 40%] Built target opencv_gapi [ 40%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/scale_layer.cpp.o [ 40%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/eltwise_layer.cpp.o [ 40%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/mvn_layer.cpp.o [ 40%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/prior_box_layer.cpp.o [ 40%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/padding_layer.cpp.o [ 40%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/reorg_layer.cpp.o [ 40%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/recurrent_layers.cpp.o [ 40%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/crop_and_resize_layer.cpp.o [ 40%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/darknet/darknet_importer.cpp.o [ 40%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/darknet/darknet_io.cpp.o [ 40%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/op_halide.cpp.o [ 40%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/init.cpp.o [ 40%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/src/op_prior_box.cpp.o [ 40%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/src/op_pool.cpp.o [ 40%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/src/op_softmax.cpp.o [ 40%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/src/op_concat.cpp.o [ 40%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/src/context.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/src/buffer.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/src/op_permute.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/src/tensor.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/src/op_relu.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/src/internal.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/src/op_lrn.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/src/op_base.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/src/op_conv.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/vulkan/vk_loader.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/vulkan/vk_functions.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/shader/dw_conv_spv.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/shader/softmax_spv.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/shader/avg_pool_spv.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/shader/lrn_spv.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/shader/relu_spv.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/shader/prior_box_spv.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/shader/concat_spv.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/shader/max_pool_spv.cpp.o [ 41%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/shader/conv_spv.cpp.o [ 42%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/shader/conv48_spv.cpp.o [ 42%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/shader/permute_spv.cpp.o [ 42%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/ocl4dnn/src/ocl4dnn_lrn.cpp.o [ 42%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/ocl4dnn/src/common.cpp.o [ 42%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/ocl4dnn/src/ocl4dnn_softmax.cpp.o [ 42%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/ocl4dnn/src/ocl4dnn_pool.cpp.o [ 42%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/ocl4dnn/src/ocl4dnn_inner_product.cpp.o [ 42%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/ocl4dnn/src/math_functions.cpp.o [ 42%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/ocl4dnn/src/ocl4dnn_conv_spatial.cpp.o [ 42%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/opencl_kernels_dnn.cpp.o [ 42%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/layers/layers_common.avx.cpp.o [ 42%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/layers/layers_common.avx2.cpp.o [ 42%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/layers/layers_common.avx512_skx.cpp.o [ 42%] Linking CXX shared library ../../lib/libopencv_dnn.so [ 42%] Built target opencv_dnn Makefile:160: fallo en las instrucciones para el objetivo 'all' make: *** [all] Error 2

Cmake configuration:

General configuration for OpenCV 4.0.1-dev =====================================
Version control: 3.4.1-2515-g54a1bbe

Extra modules:
Location (extra): /home/tino/libs/opencv/opencv_contrib/modules
Version control (extra): 3.4.3-295-g301aa7e

Platform:
Timestamp: 2019-02-14T14:31:08Z
Host: Linux 4.15.0-45-generic x86_64
CMake: 3.5.1
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/make
Configuration: Release

CPU/HW features:
Baseline: SSE SSE2 SSE3
requested: SSE3
Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
SSE4_1 (7 files): + SSSE3 SSE4_1
SSE4_2 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2
FP16 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
AVX (5 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
AVX2 (15 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
AVX512_SKX (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_SKX

C/C++:
Built as dynamic libs?: YES
C++ Compiler: /usr/bin/g++-5 (ver 5.5.0)
C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
C Compiler: /usr/bin/gcc-5
C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release):
Linker flags (Debug):
ccache: YES
Precompiled headers: NO
Extra dependencies: dl m pthread rt
3rdparty dependencies:

OpenCV modules:
To be built: aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dpm face features2d flann freetype fuzzy gapi hdf hfs highgui img_hash imgcodecs imgproc java java_bindings_generator line_descriptor ml objdetect optflow phase_unwrapping photo plot reg rgbd saliency sfm shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
Disabled: python2 python_bindings_generator world
Disabled by dependency: -
Unavailable: cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv js matlab ovis python3 viz
Applications: tests perf_tests apps
Documentation: NO
Non-free algorithms: YES

GUI:
GTK+: YES (ver 3.18.9)
GThread : YES (ver 2.48.2)
GtkGlExt: NO
VTK support: NO

Media I/O:
ZLib: /home/tino/anaconda/lib/libz.so (ver 1.2.11)
JPEG: build-libjpeg-turbo (ver 1.5.3-62)
WEBP: /usr/lib/x86_64-linux-gnu/libwebp.so (ver encoder: 0x0202)
PNG: build (ver 1.6.35)
TIFF: build (ver 42 - 4.0.9)
JPEG 2000: /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1)
OpenEXR: build (ver 1.7.1)
HDR: YES
SUNRASTER: YES
PXM: YES
PFM: YES

Video I/O:
DC1394: YES (2.2.4)
FFMPEG: YES
avcodec: YES (57.107.100)
avformat: YES (57.83.100)
avutil: YES (55.78.100)
swscale: YES (4.8.100)
avresample: YES (2.1.0)
GStreamer: YES (1.8.3)
v4l/v4l2: YES (linux/videodev2.h)

Parallel framework: pthreads

Trace: YES (with Intel ITT)

Other third-party libraries:
Intel IPP: 2019.0.0 Gold [2019.0.0]
at: /home/tino/libs/opencv/build_FEB_19/3rdparty/ippicv/ippicv_lnx/icv
Intel IPP IW: sources (2019.0.0)
at: /home/tino/libs/opencv/build_FEB_19/3rdparty/ippicv/ippicv_lnx/iw
Lapack: YES (/usr/lib/liblapack.so /usr/lib/libcblas.so /usr/lib/libatlas.so)
Eigen: YES (ver 3.2.92)
Custom HAL: NO
Protobuf: build (3.5.1)

OpenCL: YES (no extra features)
Include path: /home/tino/libs/opencv/opencv/3rdparty/include/opencl/1.2
Link libraries: Dynamic load

Python (for build): /usr/bin/python2.7

Java:
ant: /usr/bin/ant (ver 1.9.6)
JNI: /usr/lib/jvm/java-8-oracle/include /usr/lib/jvm/java-8-oracle/include/linux /usr/lib/jvm/java-8-oracle/include
Java wrappers: YES
Java tests: YES

Install to: /usr/local/opencv_4_0_1
-----------------------------------------------------------------

Configuring done

Steps to reproduce

Last lines in CMakeError.log:

TestEndianess.c:
/* A 16 bit integer is required. */
typedef unsigned short cmakeint16;

/* On a little endian machine, these 16bit ints will give "THIS IS LITTLE ENDIAN."
On a big endian machine the characters will be exchanged pairwise. */
const cmakeint16 info_little[] = {0x4854, 0x5349, 0x4920, 0x2053, 0x494c, 0x5454, 0x454c, 0x4520, 0x444e, 0x4149, 0x2e4e, 0x0000};

/* on a big endian machine, these 16bit ints will give "THIS IS BIG ENDIAN."
On a little endian machine the characters will be exchanged pairwise. */
const cmakeint16 info_big[] = {0x5448, 0x4953, 0x2049, 0x5320, 0x4249, 0x4720, 0x454e, 0x4449, 0x414e, 0x2e2e, 0x0000};

#ifdef __CLASSIC_C__
int main(argc, argv) int argc; char *argv[];
#else
int main(int argc, char *argv[])
#endif
{
int require = 0;
require += info_little[argc];
require += info_big[argc];
(void)argv;
return require;
}

Build output check failed:
Regex: 'unrecognized .*option'
Output line: 'cc1: warning: unrecognized command line option ‘-Wno-misleading-indentation’'
Compilation failed:
source file: '/home/tino/libs/opencv/build_FEB_19/CMakeFiles/CMakeTmp/src.c'
check option: ' -Wno-misleading-indentation'
===== BUILD LOG =====
Change Dir: /home/tino/libs/opencv/build_FEB_19/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_f2cce/fast"
/usr/bin/make -f CMakeFiles/cmTC_f2cce.dir/build.make CMakeFiles/cmTC_f2cce.dir/build
make[1]: se entra en el directorio '/home/tino/libs/opencv/build_FEB_19/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_f2cce.dir/src.c.o
/usr/bin/gcc-5 -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wstrict-prototypes -Winit-self -Wpointer-arith -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -Wno-unused-but-set-variable -Wno-missing-prototypes -Wno-missing-declarations -Wno-undef -Wno-unused -Wno-sign-compare -Wno-cast-align -Wno-shadow -Wno-maybe-uninitialized -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -O3 -DNDEBUG -fPIE -Wno-misleading-indentation -o CMakeFiles/cmTC_f2cce.dir/src.c.o -c /home/tino/libs/opencv/build_FEB_19/CMakeFiles/CMakeTmp/src.c
/home/tino/libs/opencv/build_FEB_19/CMakeFiles/CMakeTmp/src.c:1:0: warning: ignoring #pragma [-Wunknown-pragmas]
#pragma
^
cc1: warning: unrecognized command line option ‘-Wno-misleading-indentation’
Linking C executable cmTC_f2cce
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f2cce.dir/link.txt --verbose=1
/usr/bin/gcc-5 -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wstrict-prototypes -Winit-self -Wpointer-arith -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -Wno-unused-but-set-variable -Wno-missing-prototypes -Wno-missing-declarations -Wno-undef -Wno-unused -Wno-sign-compare -Wno-cast-align -Wno-shadow -Wno-maybe-uninitialized -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -O3 -DNDEBUG -Wl,--gc-sections CMakeFiles/cmTC_f2cce.dir/src.c.o -o cmTC_f2cce
make[1]: se sale del directorio '/home/tino/libs/opencv/build_FEB_19/CMakeFiles/CMakeTmp'

===== END =====

Build output check failed:
Regex: 'unrecognized .*option'
Output line: 'cc1plus: warning: unrecognized command line option ‘-Wno-misleading-indentation’'
Compilation failed:
source file: '/home/tino/libs/opencv/build_FEB_19/CMakeFiles/CMakeTmp/src.cxx'
check option: ' -Wno-misleading-indentation'
===== BUILD LOG =====
Change Dir: /home/tino/libs/opencv/build_FEB_19/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_15132/fast"
/usr/bin/make -f CMakeFiles/cmTC_15132.dir/build.make CMakeFiles/cmTC_15132.dir/build
make[1]: se entra en el directorio '/home/tino/libs/opencv/build_FEB_19/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_15132.dir/src.cxx.o
/usr/bin/g++-5 -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Winit-self -Wpointer-arith -Wsign-promo -Winit-self -Wsuggest-override -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -Wno-shadow -Wno-unused -Wno-sign-compare -Wno-undef -Wno-missing-declarations -Wno-uninitialized -Wno-switch -Wno-parentheses -Wno-array-bounds -Wno-extra -Wno-deprecated-declarations -O3 -DNDEBUG -fPIE -Wno-misleading-indentation -o CMakeFiles/cmTC_15132.dir/src.cxx.o -c /home/tino/libs/opencv/build_FEB_19/CMakeFiles/CMakeTmp/src.cxx
/home/tino/libs/opencv/build_FEB_19/CMakeFiles/CMakeTmp/src.cxx:1:0: warning: ignoring #pragma [-Wunknown-pragmas]
#pragma
^
cc1plus: warning: unrecognized command line option ‘-Wno-misleading-indentation’
Linking CXX executable cmTC_15132
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_15132.dir/link.txt --verbose=1
/usr/bin/g++-5 -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Winit-self -Wpointer-arith -Wsign-promo -Winit-self -Wsuggest-override -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -Wno-shadow -Wno-unused -Wno-sign-compare -Wno-undef -Wno-missing-declarations -Wno-uninitialized -Wno-switch -Wno-parentheses -Wno-array-bounds -Wno-extra -Wno-deprecated-declarations -O3 -DNDEBUG -Wl,--gc-sections CMakeFiles/cmTC_15132.dir/src.cxx.o -o cmTC_15132
make[1]: se sale del directorio '/home/tino/libs/opencv/build_FEB_19/CMakeFiles/CMakeTmp'

===== END =====

Issue 2:
System information (version)

OpenCV => ❔

Operating System / Platform => ❔

Compiler => ❔

Detailed description

Steps to reproduce