leeslove / libyuv

Automatically exported from code.google.com/p/libyuv
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Windows Clang build #412

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Follow chrome instructions
https://code.google.com/p/chromium/wiki/Clang#Windows

1. install cmake

2. set GYP_DEFINES=clang=1
call python tools\clang\scripts\update.py

3.call python gyp_libyuv -fninja libyuv_test.gyp
ninja -C out\Debug
ninja -C out\Release

In step 2 the compiler source code downloads but the build of the compiler 
fails.

Original issue reported on code.google.com by fbarch...@google.com on 10 Mar 2015 at 11:29

GoogleCodeExporter commented 9 years ago
chromium provides a local repo:

set GYP_DEFINES=clang=1
set LLVM_REPO_URL=svn://svn.chromium.org/llvm-project
call python tools\clang\scripts\update.py

Original comment by fbarch...@google.com on 11 Mar 2015 at 4:52

GoogleCodeExporter commented 9 years ago
needed to uninstall mingw, and then tools\clang\scripts\update.py works.
But the build fails

[61/67] CXX obj\util\psnr.psnr.obj
..\..\util\psnr.cc(210,22) :  error(clang): redefinition of '__cpuid'
static __inline void __cpuid(int cpu_info[4], int info_type) {
                     ^
c:\src\libyuv3\trunk\third_party\llvm-build\Release+Asserts\bin\..\lib\clang\3.7
.0\include\intrin.h(908,1) :  note(clang): previous definition is here
__cpuid(int __info[4], int __level) {
^
1 error generated.

Original comment by fbarch...@google.com on 12 Mar 2015 at 9:41

GoogleCodeExporter commented 9 years ago
Once buildable there is a performance difference

Visual C
852 tests from 1 test case ran. (855394 ms total)

ClangCL
847 tests from 1 test case ran. (2806132 ms total)

Original comment by fbarch...@chromium.org on 15 Mar 2015 at 11:30

GoogleCodeExporter commented 9 years ago
Visual C with assembly disabled
852 tests from 1 test case ran. (2700391 ms total)

Original comment by fbarch...@chromium.org on 17 Mar 2015 at 11:19

GoogleCodeExporter commented 9 years ago
clang port complete.  performance is same as clang on osx/linux.
Faster for 64 bit, since Visual C doesnt support inline for 64 bit.
Slower for 32 bit on AVX2, since some functions arent ported from Visual C to 
clang.

On Sandy Bridge (SSSE3)
vs2013  32 bit
ARGBToI420_Opt (402 ms)

vs2013  64 bit
ARGBToI420_Opt (2709 ms)

clangcl 32 bit
ARGBToI420_Opt (419 ms)

clangcl 64 bit
ARGBToI420_Opt (401 ms)

Future work - optimize frintf for clangcl
Port visual c assembly to gcc style.
Add arm clangcl support for arm based windows.

Original comment by fbarch...@chromium.org on 20 Mar 2015 at 5:46