flink源码编译(windows环境)

前言

最新开始捣鼓flink,fucking the code之前,编译是第一步。

编译环境

win7 java maven

编译步骤

https://ci.apache.org/projects/flink/flink-docs-release-1.6/start/building.html   官方文档搞起,如下:

Building Flink from Source

This page covers how to build Flink 1.6.1 from sources.

Build Flink

In order to build Flink you need the source code. Either download the source of a release or clone the git repository.

In addition you need Maven 3 and a JDK (Java Development Kit). Flink requires at least Java 8 to build.

NOTE: Maven 3.3.x can build Flink, but will not properly shade away certain dependencies. Maven 3.2.5 creates the libraries properly. To build unit tests use Java 8u51 or above to prevent failures in unit tests that use the PowerMock runner.

To clone from git, enter:

git clone https://github.com/apache/flink

The simplest way of building Flink is by running:

mvn clean install -DskipTests

This instructs Maven (mvn) to first remove all existing builds (clean) and then create a new Flink binary (install).

To speed up the build you can skip tests, QA plugins, and JavaDocs:

mvn clean install -DskipTests -Dfast

The default build adds a Flink-specific JAR for Hadoop 2, to allow using Flink with HDFS and YARN.

Dependency Shading

Flink shades away some of the libraries it uses, in order to avoid version clashes with user programs that use different versions of these libraries. Among the shaded libraries are Google GuavaAsmApache CuratorApache HTTP ComponentsNetty, and others.

The dependency shading mechanism was recently changed in Maven and requires users to build Flink slightly differently, depending on their Maven version:

Maven 3.0.x, 3.1.x, and 3.2.x It is sufficient to call mvn clean install -DskipTests in the root directory of Flink code base.

Maven 3.3.x The build has to be done in two steps: First in the base directory, then in the distribution project:

mvn clean install -DskipTests
cd flink-dist
mvn clean install

Note: To check your Maven version, run mvn --version.

Back to top

Hadoop Versions

Info Most users do not need to do this manually. The download page contains binary packages for common Hadoop versions.

Flink has dependencies to HDFS and YARN which are both dependencies from Apache Hadoop. There exist many different versions of Hadoop (from both the upstream project and the different Hadoop distributions). If you are using a wrong combination of versions, exceptions can occur.

Hadoop is only supported from version 2.4.0 upwards. You can also specify a specific Hadoop version to build against:

mvn clean install -DskipTests -Dhadoop.version=2.6.1

Vendor-specific Versions  指定hadoop发行商

To build Flink against a vendor specific Hadoop version, issue the following command:

mvn clean install -DskipTests -Pvendor-repos -Dhadoop.version=2.6.1-cdh5.0.0

The -Pvendor-repos activates a Maven build profile that includes the repositories of popular Hadoop vendors such as Cloudera, Hortonworks, or MapR.

Back to top

Scala Versions

Info Users that purely use the Java APIs and libraries can ignore this section.

Flink has APIs, libraries, and runtime modules written in Scala. Users of the Scala API and libraries may have to match the Scala version of Flink with the Scala version of their projects (because Scala is not strictly backwards compatible).

Flink 1.4 currently builds only with Scala version 2.11.

We are working on supporting Scala 2.12, but certain breaking changes in Scala 2.12 make this a more involved effort. Please check out this JIRA issue for updates.

Back to top

Encrypted File Systems

If your home directory is encrypted you might encounter a java.io.IOException: File name too long exception. Some encrypted file systems, like encfs used by Ubuntu, do not allow long filenames, which is the cause of this error.

The workaround is to add:

<args>
    <arg>-Xmax-classfile-name</arg>
    <arg>128</arg>
</args>

in the compiler configuration of the pom.xml file of the module causing the error. For example, if the error appears in the flink-yarn module, the above code should be added under the <configuration> tag of scala-maven-plugin. See this issue for more information.

编译结果

原文地址:https://www.cnblogs.com/felixzh/p/9685529.html

时间: 2024-10-16 19:45:33

flink源码编译(windows环境)的相关文章

源码编译LNMP环境

  一.环境准备: 1.部署LNMP架构需要安装依赖包 yum -y install make gcc gcc-c++ flex bison file libtool libtool-libs autoconf kernel-devel libjpeg libjpeg-devel libpng libpng-devel gd freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glib2 glib2-devel bzip2

终于完成了 源码 编译lnmp环境

经过了大概一个星期的努力,终于按照海生的编译流程将lnmp环境源码安装出来了 nginx 和php 主要参考 http://hessian.cn/p/1273.html mysql 主要参考 http://blog.csdn.net/superchanon/article/details/8546254/ 文章中有的就不在赘述了 mysql 注意: *如果mysql的安装目录(解压目录)不是/usr/local/mysql,那么还必须指定目录参数,如 (下面改成我需要的路径) [[email p

CentOS 6 apache源码编译一键部署脚本

需求:源码编译apache 环境:CentOS 6 64位系统安装的桌面版 软件:httpd-2.4.12.tar.gz.pcre-8.31.tar.bz2.apr-util-1.5.3.apr-1.5.1.tar.gz 备注:目前只在centos 6环境下测试过,如果有报错可能是依赖包安装有缺失,本来想把这几个源码包上传上去的,上传一直失败,以上几个源码包需要到网上下载一下 [[email protected] ~]# cat apache.sh #!/bin/bash # #适用版本Cent

OpenCV在Windows平台下的源码编译

OpenCV库官方网站为http://opencv.org/. 在该网站可以下载最新的OpenCV for Windows,例如当前我下载的是opencv-2.4.9.exe ,双击该文件解压到某个目录下,解压后的根目录为opencv,opencv目录下有2个子目录,分别为build和sources,build目录中存放的是已经编译好的库,而sources目录中存放的是源代码.下面我们会在sources目录中编译源代码. 在sources目录中可以看到有个CMakeLists.txt文件,这个文

netcdf源码在windows上的编译

作者:朱金灿 来源:http://blog.csdn.net/clever101 今天搞搞netcdf源码在windows上的编译,折腾了半天,算是搞成了,特地记录一下过程.我的目标是要生成netcdf的工程文件.netcdf依赖于hdf5.zlib和curl这三个库. 首先在HDF5 Source Code下载最新的hdf5源码,然后使用CMake来生成编译hdf5的解决方案,如下图: 再下载netcdf的源码:NetCDF Downloads,开始使用CMake来生成netcdf的解决方案,

源码编译搭建LAMP环境&#160;

源码编译搭建LAMP环境  一.将 LAMP 相关软件包上传刡 linux 上 [[email protected] ~]# ls anaconda-ks.cfg      install.log         mysql-5.5.30.tar.gz  公共的  视频  文档  音乐 httpd-2.2.25.tar.gz  install.log.syslog  php-5.4.14.tar.bz2   模板    图片  下载  桌面 1. 安装apache [[email protect

CentOS6.5下搭建LAMP环境(源码编译方式)

CentOS 6.5安装配置LAMP服务器(Apache+PHP5+MySQL) 学习PHP脚本编程语言之前,必须先搭建并熟悉开发环境,开发环境有很多种,例如LAMP ,WAMP,MAMP等.这里我介绍一下LAMP环境的搭建,即Linux. Apache. MySQL .PHP环境. 一.首先安装操作系统 操作系统:centos6.5 操作系统安装步骤,此处不再详述. 备注:服务器系统采用最小化安装,安装一下GCC编译工具和一个桌面即可.如下图所示: 由于安装系统的时候我是最小化安装,只安装了一

ubuntu12.04 安装android sdk /ndk/源码 编译环境

做android已经近5年了,期间android的各种环境都自己配过,自己是个想法比较多的人,各自神奇到想法都有,包括写博客,但是一直是没有具体落实...想法再多,不去努力实现也只能是想法了,今天准备从写博客这个小事开始做起,磨练自己到,不废话了,直接进入主题: 一.JDK(下载并安装jdk),注意事项如下: a.32位需要下32的,64位的也注意是下载64位的: b.配置环境变量: $ sudo gedit /etc/profile           在文件的末尾加上如下内容:       

源码编译安装LAMP环境及配置基于域名访问的多虚拟主机

实验环境及软件版本: CentOS版本: 6.6(2.6.32.-504.el6.x86_64) apache版本: apache2.2.27 mysql版本:  Mysql-5.6.23 php版本:    php-5.3.27 一.关闭防火墙:service iptables stop chkconfig iptables off 二.关闭selinux: sed -i 's/SELINUX=disabled/SELINUX=enforcing/g' /etc/selinux/config