{"action":"created","issue":{"url":"https://api.github.com/repos/Itseez/opencv/issues/6508","repository_url":"https://api.github.com/repos/Itseez/opencv","labels_url":"https://api.github.com/repos/Itseez/opencv/issues/6508/labels{/name}","comments_url":"https://api.github.com/repos/Itseez/opencv/issues/6508/comments","events_url":"https://api.github.com/repos/Itseez/opencv/issues/6508/events","html_url":"https://github.com/Itseez/opencv/issues/6508","id":153199008,"number":6508,"title":"cross-platform build fails with msys2","user":{"login":"jzee","id":385258,"avatar_url":"https://avatars.githubusercontent.com/u/385258?v=3","gravatar_id":"","url":"https://api.github.com/users/jzee","html_url":"https://github.com/jzee","followers_url":"https://api.github.com/users/jzee/followers","following_url":"https://api.github.com/users/jzee/following{/other_user}","gists_url":"https://api.github.com/users/jzee/gists{/gist_id}","starred_url":"https://api.github.com/users/jzee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzee/subscriptions","organizations_url":"https://api.github.com/users/jzee/orgs","repos_url":"https://api.github.com/users/jzee/repos","events_url":"https://api.github.com/users/jzee/events{/privacy}","received_events_url":"https://api.github.com/users/jzee/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Itseez/opencv/labels/category:%20build/install","name":"category: build/install","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-05-05T09:36:55Z","updated_at":"2016-05-09T15:47:13Z","closed_at":null,"body":"### Please state the information for your system\r\nOpenCV version: 3.1 (verified with 3.0)\r\nHost OS: Windows 7 and Windows Server 2012R2\r\nTarget OS: ARM board\r\nCompiler & CMake: GCC 4.9.3 (linaro 2015.05) & CMake 3.4.1\r\n\r\n### In which part of the OpenCV library you got the issue?\r\nCross-building of core\r\n\r\n### Expected behaviour\r\nBuild works irrespective of msys environment\r\n\r\n### Actual behaviour\r\nBuild works fine using the much older msys1 (make 3.81 / 2006) but fails with msys2 (make 4.1-4 / 2014)\r\n\r\n### Additional description\r\nbuilding with msys2 fails while attempting to generate precomp.hpp. \r\n\r\n\r\n### Code example to reproduce the issue / Steps to reproduce the issue\r\nConfiguration:\r\n```\r\nc:\\jenkins\\tools\\hudson.plugins.cmake.CmakeTool\\3.4.1\\bin\\cmake -G \"MSYS Makefiles\" -D CMAKE_BUILD_TYPE=Release -Wno-dev -DCMAKE_INSTALL_PREFIX=c:\\jenkins\\workspace\\libopencv\\838c53df -DCMAKE_TOOLCHAIN_FILE=c:\\jenkins\\workspace\\libopencv\\838c53df/cmake-scripts/arm-linaro.cmake -DEXECUTABLE_OUTPUT_PATH=c:/jenkins/workspace/libopencv/838c53df/bin -DWITH_CUDA=OFF -DWITH_OPENEXR=OFF -DWITH_TIFF=OFF -DBUILD_TIFF=OFF -DWITH_JPEG=OFF -DBUILD_JPEG=OFF -DWITH_PNG=OFF -DBUILD_PNG=OFF -DWITH_WEBP=OFF -DBUILD_WEBP=OFF -DWITH_FFMPEG=OFF -DWITH_IPP=OFF -DWITH_JASPER=OFF -DBUILD_JASPER=OFF -DWITH_VTK=OFF -DWITH_V4L=OFF -DWITH_OPENCL=OFF -DBUILD_opencv_video=OFF -DBUILD_opencv_videostab=OFF -DBUILD_opencv_videolo=OFF -DBUILD_opencv_apps=OFF -DBUILD_opencv_stitching=OFF -DBUILD_DOCS=OFF -DBUILD_JASPER=OFF -DBUILD_TESTS=ON -DINSTALL_TESTS=ON -DBUILD_PERF_TESTS=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TBB=OFF -DEIGEN_INCLUDE_PATH=c:\\jenkins\\workspace\\libopencv\\838c53df/libeigen c:\\jenkins\\workspace\\libopencv\\838c53df\\repository\r\n```\r\nand running the build with\r\n```\r\nc:\\jenkins\\tools\\hudson.plugins.cmake.CmakeTool\\3.4.1\\bin\\cmake --build c:\\jenkins\\workspace\\libopencv\\838c53df\\jenkins-build --target install --config Release\r\n```\r\n\r\nThis generates the offending command:\r\n```\r\ncd /C/jenkins/workspace/libopencv/838c53df/jenkins-build/modules/core && /c/jenkins/tools/hudson.plugins.cmake.CmakeTool/3.4.1/bin/cmake.exe -E make_directory C:/jenkins/workspace/libopencv/838c53df/jenkins-build/modules/core/precomp.hpp.gch\r\ncd /C/jenkins/workspace/libopencv/838c53df/jenkins-build/modules/core && /C/linaro/gcc-4.9-2015.05-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-g++.exe -O3 -DNDEBUG -DNDEBUG \"-D_ARM\" \"-D_ARM\" \"-D__OPENCV_BUILD=1\" -isystem\"C:/jenkins/workspace/libopencv/838c53df/jenkins-build\" -isystem\"C:/jenkins/workspace/libopencv/838c53df/libeigen\" -isystem\"C:/jenkins/workspace/libopencv/838c53df/jenkins-build\" -isystem\"C:/jenkins/workspace/libopencv/838c53df/libeigen\" -I\"C:/jenkins/workspace/libopencv/838c53df/repository/modules/core/include\" -I\"C:/jenkins/workspace/libopencv/838c53df/repository/modules/core/src\" -isystem\"C:/jenkins/workspace/libopencv/838c53df/jenkins-build/modules/core\" -I\"C:/jenkins/workspace/libopencv/838c53df/repository/modules/core/include\" -isystem\"C:/jenkins/workspace/libopencv/838c53df/repository/3rdparty/zlib\" -isystem\"C:/jenkins/workspace/libopencv/838c53df/jenkins-build/3rdparty/zlib\" -std=c++11 -O3 -DNDEBUG -mvectorize-with-neon-quad -mcpu=cortex-a9 -mfloat-abi=softfp -mfpu=neon -ffast-math -funroll-loops -fomit-frame-pointer -mthumb -fdata-sections -fsigned-char -Wno-psabi -mthumb -fdata-sections -fsigned-char -Wno-psabi -fPIC -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 -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -x c++-header -o C:/jenkins/workspace/libopencv/838c53df/jenkins-build/modules/core/precomp.hpp.gch/opencv_core_Release.gch C:/jenkins/workspace/libopencv/838c53df/jenkins-build/modules/core/precomp.hpp\r\nC:/jenkins/workspace/libopencv/838c53df/jenkins-build/modules/core/precomp.hpp:46:38: fatal error: opencv2/opencv_modules.hpp: No such file or directory\r\n #include \"opencv2/opencv_modules.hpp\"\r\n```\r\nthe problem being that the build system generates two pairs of -isystem includes for the project root instead of generating one -isystem and one standard -I include pair:\r\n\r\ngenerated include statements (extracted from above, breaks the build):\r\n```\r\n-isystem\"C:/jenkins/workspace/libopencv/838c53df/jenkins-build\" -isystem\"C:/jenkins/workspace/libopencv/838c53df/libeigen\" -isystem\"C:/jenkins/workspace/libopencv/838c53df/jenkins-build\" -isystem\"C:/jenkins/workspace/libopencv/838c53df/libeigen\" \r\n```\r\n\r\nmanually corrected include statements (fixes the build):\r\n```\r\n-isystem\"C:/jenkins/workspace/libopencv/838c53df/jenkins-build\" -isystem\"C:/jenkins/workspace/libopencv/838c53df/libeigen\" -I\"C:/jenkins/workspace/libopencv/838c53df/jenkins-build\" -I\"C:/jenkins/workspace/libopencv/838c53df/libeigen\" \r\n```\r\n\r\nEverything else being the same, this build runs fine with msys1. The infrastructure however runs on msys2. I would very much appreciate a hint on how to fix or workaround the issue. \r\n"},"comment":{"url":"https://api.github.com/repos/Itseez/opencv/issues/comments/217903718","html_url":"https://github.com/Itseez/opencv/issues/6508#issuecomment-217903718","issue_url":"https://api.github.com/repos/Itseez/opencv/issues/6508","id":217903718,"user":{"login":"jzee","id":385258,"avatar_url":"https://avatars.githubusercontent.com/u/385258?v=3","gravatar_id":"","url":"https://api.github.com/users/jzee","html_url":"https://github.com/jzee","followers_url":"https://api.github.com/users/jzee/followers","following_url":"https://api.github.com/users/jzee/following{/other_user}","gists_url":"https://api.github.com/users/jzee/gists{/gist_id}","starred_url":"https://api.github.com/users/jzee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzee/subscriptions","organizations_url":"https://api.github.com/users/jzee/orgs","repos_url":"https://api.github.com/users/jzee/repos","events_url":"https://api.github.com/users/jzee/events{/privacy}","received_events_url":"https://api.github.com/users/jzee/received_events","type":"User","site_admin":false},"created_at":"2016-05-09T15:47:13Z","updated_at":"2016-05-09T15:47:13Z","body":"@alalek thanks again for your response. \r\nI dabbled with these settings, inserting it into the cmakefile and doing a clean rebuild but keep getting the same build failure - it appears those switches do not influence the construction of the gcc invocation in that very place. \r\n\r\nsetting them to something that will fail (-ifoobar) does however show that they are being interpreted - just not at the point of pre-compiling the headers. Could you please point me in a good direction in where to look to fix this?\r\n\r\n@StevenPuttemans agreed"}}