{"action":"opened","issue":{"url":"https://api.github.com/repos/opencv/opencv/issues/7346","repository_url":"https://api.github.com/repos/opencv/opencv","labels_url":"https://api.github.com/repos/opencv/opencv/issues/7346/labels{/name}","comments_url":"https://api.github.com/repos/opencv/opencv/issues/7346/comments","events_url":"https://api.github.com/repos/opencv/opencv/issues/7346/events","html_url":"https://github.com/opencv/opencv/issues/7346","id":179437122,"number":7346,"title":"3rdparty: build of 3rdparty fails using clang","user":{"login":"tomoaki0705","id":3737315,"avatar_url":"https://avatars.githubusercontent.com/u/3737315?v=3","gravatar_id":"","url":"https://api.github.com/users/tomoaki0705","html_url":"https://github.com/tomoaki0705","followers_url":"https://api.github.com/users/tomoaki0705/followers","following_url":"https://api.github.com/users/tomoaki0705/following{/other_user}","gists_url":"https://api.github.com/users/tomoaki0705/gists{/gist_id}","starred_url":"https://api.github.com/users/tomoaki0705/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomoaki0705/subscriptions","organizations_url":"https://api.github.com/users/tomoaki0705/orgs","repos_url":"https://api.github.com/users/tomoaki0705/repos","events_url":"https://api.github.com/users/tomoaki0705/events{/privacy}","received_events_url":"https://api.github.com/users/tomoaki0705/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-27T09:09:49Z","updated_at":"2016-09-27T09:09:49Z","closed_at":null,"body":"build of 3rdparty fails using clang\r\n\r\n\r\n##### System information (version)\r\n- OpenCV => master (technically after 8f91529edfd3a74383a47120f574bb7de09bfe9f, merge of #6770)\r\n- Operating System / Platform => Raspbian OS(32bit)\r\n- Compiler => clang (Raspbian clang version 3.7.0-4~bpo8+1 (tags/RELEASE_370/final) (based on LLVM 3.7.0))\r\n- Platform => Raspberry Pi 3\r\n\r\n##### Detailed description\r\nI installed clang on RPi3. The clang was installed, but it seems that some of the option used in ```3rdparty/carotene``` doesn't exist on clang-3.7\r\n\r\n```\r\npi@raspberrypi:~ $ sudo apt-get -y install clang-3.7\r\npi@raspberrypi:~ $ cd ~/opencv-fork\r\npi@raspberrypi:~/opencv-fork $ mkdir clang\r\npi@raspberrypi:~/opencv-fork $ cd clang/\r\npi@raspberrypi:~/opencv-fork/clang $ cmake CC=/usr/bin/clang-3.7 CXX=/usr/bin/clang++-3.7 ..\r\n<snip>\r\npi@raspberrypi:~/opencv-fork/clang $ make opencv_test_core\r\n[  0%] Building CXX object 3rdparty/carotene/hal/carotene/CMakeFiles/carotene_objs.dir/src/colorconvert.cpp.o\r\nclang: error: unknown argument: '-fsched2-use-superblocks'\r\nclang: error: unknown argument: '-fsched2-use-traces'\r\nclang: error: unknown argument: '-fsched-stalled-insns-dep=100'\r\nclang: error: unknown argument: '-fsched-stalled-insns=2'\r\nclang: warning: optimization flag '-fweb' is not supported [-Wignored-optimization-argument]\r\nclang: warning: optimization flag '-frename-registers' is not supported [-Wignored-optimization-argument]\r\n<snip>\r\npi@raspberrypi:~/opencv-fork $ cd ..\r\npi@raspberrypi:~/opencv-fork $ git rev-parse HEAD\r\n8f91529edfd3a74383a47120f574bb7de09bfe9f\r\n```\r\n\r\nFull log of cmake and make is [here]( https://gist.github.com/tomoaki0705/232cfb5a9e9beb4e278ca67e580e0ca8 )\r\n\r\nI just verified that clang 3.7 doesn't really have these options, when gcc does.\r\n\r\n```\r\n$ clang++-3.7 -fsched-stalled-insns-dep=100 -fsched-stalled-insns=2 -fsched2-use-superblocks -fsched2-use-traces -frename-registers -fweb main.cpp\r\nclang: error: unknown argument: '-fsched-stalled-insns-dep=100'\r\nclang: error: unknown argument: '-fsched-stalled-insns=2'\r\nclang: error: unknown argument: '-fsched2-use-superblocks'\r\nclang: error: unknown argument: '-fsched2-use-traces'\r\nclang: warning: optimization flag '-frename-registers' is not supported\r\nclang: warning: optimization flag '-fweb' is not supported\r\n$ g++ -fsched-stalled-insns-dep=100 -fsched-stalled-insns=2 -fsched2-use-superblocks -fsched2-use-traces -frename-registers -fweb main.cpp # this build finished with no problem\r\n$ g++ -v\r\nUsing built-in specs.\r\nCOLLECT_GCC=g++\r\nCOLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper\r\nTarget: arm-linux-gnueabihf\r\nConfigured with: ../src/configure -v --with-pkgversion='Raspbian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf\r\nThread model: posix\r\ngcc version 4.9.2 (Raspbian 4.9.2-10)\r\n```\r\nIt really seems that ```carotene``` is not able to compile on clang because of some compiler options.\r\n\r\n\r\nI also tried the build on 3.1.0 using clang-3.7 to check whether clang was supported from the beginning.\r\nThe build of 3.1.0 passed successfully using clang-3.7.  I looked in some codes, and some files has ```#  if defined __clang__ ``` so although it's not specified explicitly, I think OpenCV is supposed to be build on clang.\r\nI couldn't find any specific requirement for clang version, so I'm sorry if I'm trying to build on a deprecated/unsupported platform."}}
{"actor":{"display_login":"tomoaki0705"}}