Gamaru / libyuv

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

CentOS build issue #574

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Issue reported by Alexander Kolesnik <alexkol75@gmail.com>: 
I can't build the latest master branch from the sources on the latest CentOS 6:

# cat /etc/issue
CentOS release 6.7 (Final)

# uname -a
Linux uat.domain.com 2.6.32-573.3.1.el6.x86_64 #1 SMP Thu Aug 13 22:55:16 UTC 
2015 x86_64 x86_64 x86_64 GNU/Linux

# git clone https://chromium.googlesource.com/libyuv/libyuv
Initialized empty Git repository in /vol/libyuv/.git/
remote: Total 14829 (delta 12032), reused 14829 (delta 12032)
Receiving objects: 100% (14829/14829), 4.17 MiB, done.
Resolving deltas: 100% (12032/12032), done.

# cd libyuv
# make -j7 V=1 -f linux.mk

What is the expected output? What do you see instead?
Compilation should pass. Instead this error is produced:

g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/compare.cc -o source/compare.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/compare_common.cc -o 
source/compare_common.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/compare_gcc.cc -o 
source/compare_gcc.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/convert.cc -o source/convert.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/convert_argb.cc -o 
source/convert_argb.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/convert_from.cc -o 
source/convert_from.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/convert_from_argb.cc -o 
source/convert_from_argb.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/convert_to_argb.cc -o 
source/convert_to_argb.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/convert_to_i420.cc -o 
source/convert_to_i420.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/cpu_id.cc -o source/cpu_id.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/planar_functions.cc -o 
source/planar_functions.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/rotate.cc -o source/rotate.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/rotate_any.cc -o 
source/rotate_any.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/rotate_argb.cc -o 
source/rotate_argb.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/rotate_common.cc -o 
source/rotate_common.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/rotate_gcc.cc -o 
source/rotate_gcc.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/rotate_mips.cc -o 
source/rotate_mips.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/row_any.cc -o source/row_any.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/row_common.cc -o 
source/row_common.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/row_mips.cc -o 
source/row_mips.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/row_gcc.cc -o source/row_gcc.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/scale.cc -o source/scale.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/scale_any.cc -o 
source/scale_any.o
g++ -c -O2 -fomit-frame-pointer -Iinclude/ source/scale_argb.cc -o 
source/scale_argb.o
source/row_common.cc: In function ‘void libyuv::YuvPixel(uint8, uint8, uint8, 
uint8*, uint8*, uint8*, const libyuv::YuvConstants*)’:
source/row_common.cc:1256: error: invalid types ‘const signed char 
__vector__[int]’ for array subscript
source/row_common.cc:1257: error: invalid types ‘const signed char 
__vector__[int]’ for array subscript
source/row_common.cc:1258: error: invalid types ‘const signed char 
__vector__[int]’ for array subscript
source/row_common.cc:1259: error: invalid types ‘const signed char 
__vector__[int]’ for array subscript
source/row_common.cc:1260: error: invalid types ‘const short int 
__vector__[int]’ for array subscript
source/row_common.cc:1261: error: invalid types ‘const short int 
__vector__[int]’ for array subscript
source/row_common.cc:1262: error: invalid types ‘const short int 
__vector__[int]’ for array subscript
source/row_common.cc:1263: error: invalid types ‘const short int 
__vector__[int]’ for array subscript
make: *** [source/row_common.o] Error 1
make: *** Waiting for unfinished jobs....

Please use labels and text to provide additional information.

Original issue reported on code.google.com by kjellan...@google.com on 15 Mar 2016 at 1:47

GoogleCodeExporter commented 8 years ago
I believe the problem here is that you have just cloned the repo.
You need to follow the instructions at 
https://chromium.googlesource.com/libyuv/libyuv/+/master/docs/getting_started.md
 to get a fully working checkout (run gclient sync etc).

Original comment by kjellan...@google.com on 15 Mar 2016 at 1:48

GoogleCodeExporter commented 8 years ago
There's still something wrong:

[dev@uat libyuv]$ git --version
git version 2.2.2
[dev@uat ~]$ export PATH=/vol/depot_tools/:$PATH
[dev@uat ~]$ cd /vol/libyuv/
[dev@uat libyuv]$ gclient config https://chromium.googlesource.com/libyuv/libyuv
[dev@uat libyuv]$ gclient sync
Syncing projects: 100% (2/2), done.

________ running '/usr/bin/python -u libyuv/sync_chromium.py --target-revision 
8cdf034791388299f18fba186f2941313320b706' in '/vol/libyuv'
Running "gclient sync --force --revision 
src@8cdf034791388299f18fba186f2941313320b706 --gclientfile .gclient.tmp 
--delete_unversioned_trees --reset --upstream" in /vol/libyuv/libyuv/chromium
[0:01:00] Still working on:
[0:01:00]   src
...
[0:14:45] Still working on:
[0:14:45]   src

________ running '/usr/bin/python src/build/landmines.py' in 
'/vol/libyuv/libyuv/chromium'

________ running '/usr/bin/python src/build/download_nacl_toolchains.py --mode 
nacl_core_sdk sync --extract' in '/vol/libyuv/libyuv/chromium'

________ running '/usr/bin/python src/build/android/play_services/update.py 
download' in '/vol/libyuv/libyuv/chromium'
Traceback (most recent call last):
  File "src/build/android/play_services/update.py", line 21, in <module>
    import devil_chromium
  File "src/build/android/play_services/../devil_chromium.py", line 143
    for dep_config in dep_configs
      ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "/vol/depot_tools/gclient.py", line 2323, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/vol/depot_tools/gclient.py", line 2309, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/vol/depot_tools/subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "/vol/depot_tools/gclient.py", line 2068, in CMDsync
    ret = client.RunOnDeps('update', args)
  File "/vol/depot_tools/gclient.py", line 1532, in RunOnDeps
    self.RunHooksRecursively(self._options)
  File "/vol/depot_tools/gclient.py", line 983, in RunHooksRecursively
    hook, cwd=self.root.root_dir, always=True)
  File "/vol/depot_tools/gclient_utils.py", line 293, in CheckCallAndFilterAndHeader
    return CheckCallAndFilter(args, **kwargs)
  File "/vol/depot_tools/gclient_utils.py", line 538, in CheckCallAndFilter
    rv, args, kwargs.get('cwd', None), None, None)
  File "/vol/depot_tools/subprocess2.py", line 37, in __init__
    super(CalledProcessError, self).__init__(returncode, cmd, output=stdout)
TypeError: __init__() got an unexpected keyword argument 'output'
Hook '/usr/bin/python -u libyuv/sync_chromium.py --target-revision 
8cdf034791388299f18fba186f2941313320b706' took 963.88 secs
Traceback (most recent call last):
  File "/vol/depot_tools/gclient.py", line 2323, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/vol/depot_tools/gclient.py", line 2309, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/vol/depot_tools/subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "/vol/depot_tools/gclient.py", line 2068, in CMDsync
    ret = client.RunOnDeps('update', args)
  File "/vol/depot_tools/gclient.py", line 1532, in RunOnDeps
    self.RunHooksRecursively(self._options)
  File "/vol/depot_tools/gclient.py", line 983, in RunHooksRecursively
    hook, cwd=self.root.root_dir, always=True)
  File "/vol/depot_tools/gclient_utils.py", line 293, in CheckCallAndFilterAndHeader
    return CheckCallAndFilter(args, **kwargs)
  File "/vol/depot_tools/gclient_utils.py", line 538, in CheckCallAndFilter
    rv, args, kwargs.get('cwd', None), None, None)
  File "/vol/depot_tools/subprocess2.py", line 37, in __init__
    super(CalledProcessError, self).__init__(returncode, cmd, output=stdout)
TypeError: __init__() got an unexpected keyword argument 'output'

Original comment by alexko...@gmail.com on 15 Mar 2016 at 2:31

GoogleCodeExporter commented 8 years ago
for gyp, i think centos theres a known issue and a note about centos builds:
https://chromium.googlesource.com/libyuv/libyuv/+/master/docs/getting_started.md

for linux.mk you may be hitting a legitimate source bug, but I dont spot any 
issues immediately.

The code below is where you had the build error:

// C reference code that mimics the YUV assembly.
static __inline void YuvPixel(uint8 y, uint8 u, uint8 v,
                              uint8* b, uint8* g, uint8* r,
                              const struct YuvConstants* yuvconstants) {
#if defined(__aarch64__)
  int ub = -yuvconstants->kUVToRB[0];
  int ug = yuvconstants->kUVToG[0];
  int vg = yuvconstants->kUVToG[1];
  int vr = -yuvconstants->kUVToRB[1];
  int bb = yuvconstants->kUVBiasBGR[0];
  int bg = yuvconstants->kUVBiasBGR[1];
  int br = yuvconstants->kUVBiasBGR[2];
  int yg = yuvconstants->kYToRgb[0] / 0x0101;
#elif defined(__arm__)
  int ub = -yuvconstants->kUVToRB[0];
  int ug = yuvconstants->kUVToG[0];
  int vg = yuvconstants->kUVToG[4];
  int vr = -yuvconstants->kUVToRB[4];
  int bb = yuvconstants->kUVBiasBGR[0];
  int bg = yuvconstants->kUVBiasBGR[1];
  int br = yuvconstants->kUVBiasBGR[2];
  int yg = yuvconstants->kYToRgb[0] / 0x0101;
#else
  int ub = yuvconstants->kUVToB[0];   <-------------- source/row_common.cc:1256: error: invalid types ‘const signed char __vector__[int]’ for array subscript
  int ug = yuvconstants->kUVToG[0];
  int vg = yuvconstants->kUVToG[1];
  int vr = yuvconstants->kUVToR[1];
  int bb = yuvconstants->kUVBiasB[0];
  int bg = yuvconstants->kUVBiasG[0];
  int br = yuvconstants->kUVBiasR[0];
  int yg = yuvconstants->kYToRgb[0];
#endif

  uint32 y1 = (uint32)(y * 0x0101 * yg) >> 16;
  *b = Clamp((int32)(-(u * ub         ) + y1 + bb) >> 6);
  *g = Clamp((int32)(-(u * ug + v * vg) + y1 + bg) >> 6);
  *r = Clamp((int32)(-(         v * vr) + y1 + br) >> 6);
}

the else is intended to be intel, but is supposed to work for any cpu.  what 
cpu are you building for?
the structure is defined in row.h
typedef int8 __attribute__((vector_size(32))) lvec8;

#if defined(__aarch64__)
// This struct is for Arm64 color conversion.
struct YuvConstants {
  uvec16 kUVToRB;
  uvec16 kUVToRB2;
  uvec16 kUVToG;
  uvec16 kUVToG2;
  vec16 kUVBiasBGR;
  vec32 kYToRgb;
};
#elif defined(__arm__)
// This struct is for ArmV7 color conversion.
struct YuvConstants {
  uvec8 kUVToRB;
  uvec8 kUVToG;
  vec16 kUVBiasBGR;
  vec32 kYToRgb;
};
#else
// This struct is for Intel color conversion.
struct YuvConstants {
  lvec8 kUVToB;
  lvec8 kUVToG;
  lvec8 kUVToR;
  lvec16 kUVBiasB;
  lvec16 kUVBiasG;
  lvec16 kUVBiasR;
  lvec16 kYToRgb;
};

Google shows a few other people hitting same issue on other platforms, but no 
solution?
Some are on older source code.  Current version is 1580

Original comment by fbarch...@google.com on 16 Mar 2016 at 2:36

GoogleCodeExporter commented 8 years ago
1. docs has a note about CentOS on 32-bit architecture. we use x64

2. the cpu is intel:
[dev@uat libyuv]$ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 63
model name      : Intel(R) Xeon(R) CPU E5-2666 v3 @ 2.90GHz
stepping        : 2
microcode       : 37
cpu MHz         : 2900.056
cache size      : 25600 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov 
pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc 
rep_good xtopology unfair_spinlock pni pclmulqdq ssse3 fma cx16 pcid sse4_1 
sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand 
hypervisor lahf_lm abm xsaveopt fsgsbase bmi1 avx2 smep bmi2 erms invpcid
bogomips        : 5800.11
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

(it's an Amazon instance launched from genuine CentOS 6 AMI)

3. since I ran "gclient sync" yesterday, I suppose it's the latest version

Original comment by alexko...@gmail.com on 16 Mar 2016 at 9:40

GoogleCodeExporter commented 8 years ago
Addon:

I might be wrong but the code looks incorrect for the compiler. Here is the 
example I found: http://ds9a.nl/gcc-simd/example.html

# g++ --version
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)

Original comment by alexko...@gmail.com on 16 Mar 2016 at 10:41

GoogleCodeExporter commented 8 years ago
OK, the issue has gone after compiling with gcc 4.8.2 
(http://people.centos.org/tru/devtools-2/readme)

Thanks for your help!

Original comment by alexko...@gmail.com on 16 Mar 2016 at 10:59