hadoop 2.5.2 mvn build fail windows 7 x64-在hadoop common上编译ms本机dll?

ocebsuys  于 2021-05-30  发布在  Hadoop
关注(0)|答案(3)|浏览(503)

我在这里关注hadoop2onwindows wiki,我已经阅读了 BUILDING.txt 多次出现在源代码树中。我想我已经弄清楚了所有的依赖关系,但是我得到了一个奇怪的答案 Failed to execute goal (compile-ms-native-dll) 错误(请填写下面的日志)。
我已安装windows sdk 7.1
在我的道路上有以下事情: Cygwin/bin msbuild公司( C:\Windows\Microsoft.NET\Framework64\v4.0.30319 )
协议缓冲区2.5.0
zlib和zlib/include(以便它可以访问zlib.h)
findbugs公司
Maven
我还设置了 Platform=x64 不用说,我的 JAVA_HOME 以及 M2_HOME 也已设置。
我在跑步 mvn package -Pdist,native-win,docs -DskipTests -Dtar 在windows sdk 7.1命令提示符下。
我以前有过 Gnuwin32 这给了我下面的错误,但移动到 Cygwin/bin 怀疑出了什么问题 Gnuwin32 ,但我仍然得到下面的错误。我该怎么办?
这是错误日志,

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec (com
pile-ms-native-dll) on project hadoop-common: Command execution failed. Process
exited with an error: 1(Exit value: 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.codehaus.mojo:exec-maven-plugin:1.2:exec (compile-ms-native-dll) on project h
adoop-common: Command execution failed.
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:216)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThre
adedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:120)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Command execution fai
led.
        at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:345)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:132)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:208)
        ... 19 more

只是在 hadoop-common 它失败了。这里还有一些可能有用的日志,我只是不知道是什么,

[INFO]
[INFO] --- exec-maven-plugin:1.2:exec (compile-ms-native-dll) @ hadoop-common --
-
[DEBUG] Configuring mojo org.codehaus.mojo:exec-maven-plugin:1.2:exec from plugi
n realm ClassRealm[plugin>org.codehaus.mojo:exec-maven-plugin:1.2, parent: sun.m
isc.Launcher$AppClassLoader@1e4ad14c]
[DEBUG] Configuring mojo 'org.codehaus.mojo:exec-maven-plugin:1.2:exec' with bas
ic configurator -->
[DEBUG]   (f) arguments = [C:\hdc\hadoop-common-project\hadoop-common/src/main/n
ative/native.sln, /nologo, /p:Configuration=Release, /p:OutDir=C:\hdc\hadoop-com
mon-project\hadoop-common\target/bin/, /p:CustomSnappyPrefix=, /p:CustomSnappyLi
b=, /p:CustomSnappyInclude=, /p:RequireSnappy=false]
[DEBUG]   (f) basedir = C:\hdc\hadoop-common-project\hadoop-common
[DEBUG]   (f) classpathScope = runtime
[DEBUG]   (f) executable = msbuild
[DEBUG]   (f) longClasspath = false
[DEBUG]   (f) project = MavenProject: org.apache.hadoop:hadoop-common:2.5.2 @ C:
\hdc\hadoop-common-project\hadoop-common\pom.xml
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@1e54fd3d
[DEBUG]   (f) skip = false
[DEBUG] -- end configuration --
[DEBUG] Executing command line: msbuild C:\hdc\hadoop-common-project\hadoop-comm
on/src/main/native/native.sln /nologo /p:Configuration=Release /p:OutDir=C:\hdc\
hadoop-common-project\hadoop-common\target/bin/ /p:CustomSnappyPrefix= /p:Custom
SnappyLib= /p:CustomSnappyInclude= /p:RequireSnappy=false
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
Build started 23-11-2014 00:07:43.
Project "C:\hdc\hadoop-common-project\hadoop-common\src\main\native\native.sln"
on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Release|x64".
Project "C:\hdc\hadoop-common-project\hadoop-common\src\main\native\native.sln"
(1) is building "C:\hdc\hadoop-common-project\hadoop-common\src\main\native\nati
ve.vcxproj" (2) on node 1 (default targets).
InitializeBuildStatus:
  Touching "..\..\..\target\native\Release\native.unsuccessfulbuild".
ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\CL.exe /c /I.
.\winutils\include /I..\..\..\target\native\javah /IC:\Java\jdk1.7.0_71\include
/IC:\Java\jdk1.7.0_71\include\win32 /I.\src /Zi /nologo /W3 /WX- /O2 /Oi /GL /D
WIN32 /D NDEBUG /D _WINDOWS /D _USRDLL /D NATIVE_EXPORTS /D _WINDLL /D _UNICODE
/D UNICODE /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Fo"..\..
\..\target\native\Release\\" /Fd"..\..\..\target\native\Release\vcWindows7.1SDK.
pdb" /Gd /TC /wd4244 /errorReport:queue src\org\apache\hadoop\io\compress\zlib\Z
libCompressor.c src\org\apache\hadoop\io\compress\zlib\ZlibDecompressor.c
  ZlibCompressor.c
c:\hdc\hadoop-common-project\hadoop-common\src\main\native\src\org\apache\hadoop
\io\compress\zlib\org_apache_hadoop_io_compress_zlib.h(36): fatal error C1083: C
annot open include file: 'zlib.h': No such file or directory [C:\hdc\hadoop-comm
on-project\hadoop-common\src\main\native\native.vcxproj]
  ZlibDecompressor.c
c:\hdc\hadoop-common-project\hadoop-common\src\main\native\src\org\apache\hadoop
\io\compress\zlib\org_apache_hadoop_io_compress_zlib.h(36): fatal error C1083: C
annot open include file: 'zlib.h': No such file or directory [C:\hdc\hadoop-comm
on-project\hadoop-common\src\main\native\native.vcxproj]
Done Building Project "C:\hdc\hadoop-common-project\hadoop-common\src\main\nativ
e\native.vcxproj" (default targets) -- FAILED.
Done Building Project "C:\hdc\hadoop-common-project\hadoop-common\src\main\nativ
e\native.sln" (default targets) -- FAILED.

Build FAILED.

"C:\hdc\hadoop-common-project\hadoop-common\src\main\native\native.sln" (default
 target) (1) ->
"C:\hdc\hadoop-common-project\hadoop-common\src\main\native\native.vcxproj" (def
ault target) (2) ->
(ClCompile target) ->
  c:\hdc\hadoop-common-project\hadoop-common\src\main\native\src\org\apache\hado
op\io\compress\zlib\org_apache_hadoop_io_compress_zlib.h(36): fatal error C1083:
 Cannot open include file: 'zlib.h': No such file or directory [C:\hdc\hadoop-co
mmon-project\hadoop-common\src\main\native\native.vcxproj]
  c:\hdc\hadoop-common-project\hadoop-common\src\main\native\src\org\apache\hado
op\io\compress\zlib\org_apache_hadoop_io_compress_zlib.h(36): fatal error C1083:
 Cannot open include file: 'zlib.h': No such file or directory [C:\hdc\hadoop-co
mmon-project\hadoop-common\src\main\native\native.vcxproj]

    0 Warning(s)
    2 Error(s)
n1bvdmb6

n1bvdmb61#

下载protobuf并将其添加到您的路径中
https://code.google.com/p/protobuf/downloads/detail?name=protoc-2.5.0-win32.zip&can=2&q=

yws3nbqq

yws3nbqq2#

从日志中,很明显您错过了zlib.h您是否将env var zlib\u home设置为包含zlib.h的目录?请注意,将zlib.h目录放在路径中是错误的,并且不是必需的,只需要zlib bin目录,如《构建指南》中所述https://svn.apache.org/viewvc/hadoop/common/branches/branch-2/building.txt?view=markup
另外,zlib.h需要一些windows中不存在的头文件,因此您需要下载这些头文件并将其放在与zlib.h相同的文件夹中。有关更多详细信息,请参见是否有用于windows(visual c)的unistd.h的替代品?为了不受惩罚https://gist.github.com/ashelly/7776712 为了得到选择权
对于那些在win32上的人(像我一样),你可能遇到了更多的麻烦。关键的解决方案应该是编辑winutils和native包的.sln和.vcxprj文件,使它们与win32平台兼容。

monwx1rj

monwx1rj3#

我亲自用过这个命令 mvn clean package -Pdist,native-win -DskipTests -Dtar -Dmaven.javadoc.skip=true 已成功在windows 8上生成版本2.4.1。我有很多不同的问题,但不记得这是其中之一。但它似乎在抱怨兹利布。

相关问题