libyuv编译(各平台)【转】

转自:http://blog.csdn.net/wszawsz33/article/details/51669719

版权声明:本文为博主原创文章,未经博主允许不得转载。

目录(?)[-]

  1. Getting Started
    1. Pre-requisites
    2. Getting the Code
      1. Android
    3. Building the Library and Unittests
      1. Windows
        1. Building with clangcl
      2. OSX
      3. iOS
      4. Android
        1. Building with GN
      5. Building Offical with GN
      6. Linux
        1. CentOS
      7. Windows Shared Library
      8. Build targets
    4. Building the Library with make
      1. Linux
    5. Building the Library with cmake
      1. Windows 8 Phone
      2. Windows Shared Library
      3. 64 bit Windows
      4. ARM Linux
    6. Running Unittests
      1. Windows
      2. OSX
      3. Linux
    7. CPU Emulator tools
      1. Intel SDE Software Development Emulator
    8. Memory tools
      1. Running Dr Memory memcheck for Windows
      2. Running UBSan
      3. Running Valgrind memcheck
      4. Running Thread Sanitizer TSan
      5. Running Address Sanitizer ASan
    9. Benchmarking
      1. Windows
      2. Linux and Mac
    10. Making a change

最近用到视频格式转码,发现谷歌的开源库 libyuv 很好用,所以记录下编译过程

直接贴 官网的编译流程

https://chromium.googlesource.com/libyuv/libyuv/+/master/docs/getting_started.md

不过我得吐槽一下,我特么就想编译个libyuv 你特么非要让我把chrome项目check 下来是几个意思。。。。如果没猜错 应该是好几个g

Getting Started

How to get and build the libyuv code.

Pre-requisites

You‘ll need to have depot tools installed: https://www.chromium.org/developers/how-tos/install-depot-tools Refer
to chromium instructions for each platform for other prerequisites.

说明:依赖工具,谷歌的这套东西还是比较好用的,首先要安装depottools 这点不多说,命令行就行,最重要的是在下载完成之后要有

export PATH=`pwd`/depot_tools:"$PATH" 命令使能这个工具

Getting
the Code

Create a working directory, enter it, and run:

说明:设置与同步代码,里面自带脚本,关于代码如何同步的就无需关心了。

Then you‘ll get a .gclient file like:

solutions = [
  { "name"        : "libyuv",
    "url"         : "https://chromium.googlesource.com/libyuv/libyuv",
    "deps_file"   : "DEPS",
    "managed"     : True,
    "custom_deps" : {
    },
    "safesync_url": "",
  },
];

For iOS add ios‘]; to your OSX .gclient and run  Browse the Git reprository: https://chromium.googlesource.com/libyuv/libyuv/+/master

Android

For Android add android‘]; to your Linux .gclient

solutions = [
  { "name"        : "libyuv",
    "url"         : "https://chromium.googlesource.com/libyuv/libyuv",
    "deps_file"   : "DEPS",
    "managed"     : True,
    "custom_deps" : {
    },
    "safesync_url": "",
  },
];
target_os = ["android", "unix"];

Then run:

Caveat: Theres an error with Google Play services updates. If you get
the error “Your version of the Google Play services library is not up to
 date”, run the following: cd chromium/src
./build/android/play_services/update.py download cd ../..

For Windows the gclient sync must be done from an Administrator command prompt.

The sync will generate native build files for your environment using gyp (Windows: Visual Studio, OSX: XCode, linux: make). This generation can also be forced manually:  To get just the source (not buildable): git clone https://chromium.googlesource.com/libyuv/libyuv

Building the Library and Unittests

Windows

Building
 with clangcl
OSX

Clang 64 bit shown. Remove clang=1 for GCC and change x64 to ia32 for 32 bit.

iOS

http://www.chromium.org/developers/how-tos/build-instructions-ios

Add to .gclient last line: target_os=[‘ios‘];

armv7

arm64
both armv7 and arm64 (fat)
simulator
Android

https://code.google.com/p/chromium/wiki/AndroidBuildInstructions

Add to .gclient last line: target_os=[‘android‘];

armv7

arm64
ia32
mipsel
arm32 disassembly:
arm64 disassembly:
Running tests:
Running test as benchmark:
Running test with C code:
Building
 with GN
Building
 Offical with GN
Linux
CentOS

On CentOS 32 bit the following work around allows a sync:

Windows
 Shared Library

Modify libyuv.gyp from ‘static_library’ to ‘shared_library’, and add ‘LIBYUV_BUILDING_SHARED_LIBRARY’ to ‘defines’.

After this command follow the building the library instructions above.

If you get a compile error for atlthunk.lib on Windows, read http://www.chromium.org/developers/how-tos/build-instructions-windows

Build targets

Building
 the Library with make

Linux

Building
 the Library with cmake

Install cmake: http://www.cmake.org/

Default debug build:

Release build/install
Windows
 8 Phone

Pre-requisite:

  • Install Visual Studio 2012 and Arm to your environment.

Then:

or with Visual Studio 2013:
Windows
 Shared Library

Modify libyuv.gyp from ‘static_library’ to ‘shared_library’, and add ‘LIBYUV_BUILDING_SHARED_LIBRARY’ to ‘defines’. Then run this.

After this command follow the building the library instructions above.

If you get a compile error for atlthunk.lib on Windows, read http://www.chromium.org/developers/how-tos/build-instructions-windows

64 bit Windows

ARM
 Linux
export GYP_DEFINES="target_arch=arm"
export CROSSTOOL=`<path>`/arm-none-linux-gnueabi
export CXX=$CROSSTOOL-g++
export CC=$CROSSTOOL-gcc
export AR=$CROSSTOOL-ar
export AS=$CROSSTOOL-as
export RANLIB=$CROSSTOOL-ranlib
gclient runhooks

Running Unittests

Windows

OSX
Linux
Replace --gtest_filter=“*” with specific unittest to run. May include wildcards. e.g.
CPU
 Emulator tools

Intel SDE (Software Development Emulator)

Pre-requisite: Install IntelSDE for Windows: http://software.intel.com/en-us/articles/intel-software-development-emulator

Then run:

Memory
 tools

Running Dr Memory memcheck for Windows

Pre-requisite: Install Dr Memory for Windows and add it to your path: http://www.drmemory.org/docs/page_install_windows.html

Running
 UBSan

See Chromium instructions for sanitizers: https://www.chromium.org/developers/testing/undefinedbehaviorsanitizer

Sanitizers available: TSan, MSan, ASan, UBSan, LSan

Running
 Valgrind memcheck

Memory errors and race conditions can be found by running tests under special memory tools. [Valgrind] 1 is an instrumentation framework for building dynamic analysis tools. Various tests and profilers are built upon it to find memory handling errors and memory leaks, for instance.

Then run:
For more information, see http://www.chromium.org/developers/how-tos/using-valgrind

Running Thread Sanitizer (TSan)

For more info, see http://www.chromium.org/developers/how-tos/using-valgrind/threadsanitizer

Running Address Sanitizer (ASan)

For more info, see http://dev.chromium.org/developers/testing/addresssanitizer

Benchmarking

The unittests can be used to benchmark.

Windows

Linux
 and Mac
Indicates 0.547 ms/frame for 1280 x 720.

Making a change

gclient sync
git checkout -b mycl -t origin/master
git pull
<edit files>
git add -u
git commit -m "my change"
git cl lint
git cl try
git cl upload -r [email protected] -s
<once approved..>
git cl land
时间: 2024-08-02 12:13:23

libyuv编译(各平台)【转】的相关文章

关于静态与动态编译arm平台程序的比较

由于最近弄个console程序,调用了readline,ncurses库,这两个动态库加起来有四百多k,而程序其实很小,其他地方也没使用到这两个库 所以想静态编译看看console程序有多大. #arm-linux-gcc cli.c -o console libreadline.a  libncurses.a #ls -l total 1932 -rwxrwxr-x 1 root root   8427 Jul  7 15:19 cli -rw-r--r-- 1 root root   664

Shell脚本自动部署(编译)LAMP平台

Shell脚本自动部署(编译)LAMP平台 LAMP是当下非常流行的一套Web架构,我们可以在GNU/Linux下通过其他人打包的程序包来进行安装; 但是在生产环境中,很多时候都需要我们自己定制安装AMP,编译安装LAMP有以下几个优点 根据生产环境灵活定制程序 优化编译参数,提高性能 解决不必要的软件依赖 友情提示:对编译安装有疑问的朋友, 查看我以前写的博客:教你使用rpm.yum.编译等方式安装软件 点击此处获得更好的阅读体验 为什么要用脚本进行部署? 在很多情况下部署LAMP平台并不止一

在CentOS6上使用源码编译LAMP平台

最近在学习重要的Web服务,当然也就少不了很重要的httpd和php.而动态网站必定又会使用数据库如mysql之类的,那么,今天就总结一下最近做的LAMP平台编译实验.具体过程如下. 实验名:在CentOS6上使用源码编译LAMP平台 实验环境:CentOS6.5,安装时选择了使用最多的两个开发包组. 使用系统默认基本yum源+epel6源(aliyun: http://mirrors.aliyun.com/repo/epel-6.repo) 使用源码包:httpd-2.4.9 ;二进制安装包m

IOS 之 PJSIP 笔记(一) 编译多平台支持的静态库

好久没有写博客了,这也算是我步入新工作后的第一篇技术博文吧.在进入新公司前,早就有了技术层进入下一个迭代的准备,但很多事情是意想不到的,就像我以 C# 程序员的身份面试入职的,而今却是一个全职的 IOS 开发.从 C# 到 Objective-C 的切换,还是有不少成本的,加上今年又推出了 Swift,以后要学习的路是漫长的,其实,学习的路本身就是漫长的,不应该满足于一个阶段和特定领域.对我而言,语言的切换,已经太常见了,学习一门语言是很容易的事情,但,完全的掌握它,却不是易事,就像去摸清一个陌

Linux内核的配置与编译(X86平台)

说明:只供学习交流 目的: (1):配置.编译X86平台下的Linux-2.6.29内核 (2):在vmware下安装编译好的内核并启动 工具: Gcc编译器, Linux-2.6.29内核 步骤: (一):清除临时文件,中间文件和配置文件等(刚从网上下载下来的文件这步可省略). make clean 删除大多数的由编译生成的文件.但会保留内核的配置文件.config. make mrproper 删除所有的编译生成的文件,还有内核配置文件,再加上各种备份文件. make distclean m

Linux下编译静态MinGW环境,编译windows平台Qt程序(使用MXE)

参考链接: MXE.>大多数程序都是在windows平台下开发的程序.windows 在现实中也是绕不过的一个系统平台,做为受过几年VC,MFC”虐待”的程序员,在做为一个程序员之前是一位Linux重度使用者,受够了MFC之后一直想要找一个框架替换,使用过GTK,wxWidgets,Qt,最后还是Qt用得多一些.我认为程序跨平台应该是一个基本标准,同一份代码不需改动,或者改动极少,放在不同的平台下编译就能使用.不同平台,同样的界面,同样的操作,同样的体验.这里要讲的是我如何在Linux 下开发跨

Linux下编译Android平台的ffmpeg库

在Linux平台下编译要方便些,我这里使用的环境是openSUSE,用Ubutunu也是一样的. 首先你需要Android-NDK 和ffmpeg源码,不同的版本里的文件结构有所差别,编译环境也有所不同.我这里使用的是以下两个版本: android-ndk-r8-linux-x86.tar.bz2 ffmpeg-0.7.17.tar.gz 1. 解压 android-ndk-r8-linux-x86.tar.bz2 cd ~ tar xvf android-ndk-r8-linux-x86.ta

libyuv编译

 下载代码(要翻墙): git clone http://git.chromium.org/external/libyuv.git 用 make 编译(linux.mingw.cygwin): make -f linux.mk 用 cmake 编译(vs.linux.mingw.msys等): mkdir out cd out cmake .. cmake --build . Release build/install mkdir out cd out cmake -DCMAKE_INSTA

nginx1.11.9 apt即源码编译各平台测试

测试系统:ubuntu16.04 server,debian8.7 netinstall,centos7 mini. 系统配置:使用virtualbox安装,内存1G,cpu单核,物理CPU  i5-4460 3.20GHz 测试目标:源码编译nginx-1.11.9,源码编译openresty/1.11.2.2,ubuntu apt nginx-1.10,debian apt nginx-1.6 测试工具:ab 2.3 测试方法:安装完成后,使用index.html内容为"helloworld