windows - 在Windows Win32 vs amd64上构建hadoop

标签 windows hadoop cpu-architecture

我尝试在Windows上构建hadoop 2.5.0,以在IDEA中使用它。但是如果我启动VisualStudio控制台并使用

setenv /x64
set TARGET_CPU=x64

我收到此错误消息:
[INFO] --- exec-maven-plugin:1.2:exec (compile-ms-winutils) @ hadoop-common ---
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 27.11.2014 14:11:31.
Project "C:\Users\user\hadoop\hadoop-common\hadoop-common-project\hadoop-common\src\main\winutils\winutils.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Release|Win32".
Project "C:\Users\user\hadoop\hadoop-common\hadoop-common-project\hadoop-common\src\main\winutils\winutils.sln" (1) is building "C:\Users\bachmann.s\R
CV\hadoop\hadoop-common\hadoop-common-project\hadoop-common\src\main\winutils\winutils.vcxproj.metaproj" (2) on node 1 (default targets).
Project "C:\Users\user\hadoop\hadoop-common\hadoop-common-project\hadoop-common\src\main\winutils\winutils.vcxproj.metaproj" (2) is building "C:\Users
\user\hadoop\hadoop-common\hadoop-common-project\hadoop-common\src\main\winutils\libwinutils.vcxproj" (3) on node 1 (default targets).
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets\Windows7.1SDK\Microsoft.Cpp.Win32.Windows7.1SDK.targets(20,5): error : You ar
e attempting to build a Win32 application from an x64 environment. If using the Windows 7.1 SDK build environment, type setenv /x86 [C:\Users\user\had
oop\hadoop-common\hadoop-common-project\hadoop-common\src\main\winutils\libwinutils.vcxproj]
Done Building Project "C:\Users\user\hadoop\hadoop-common\hadoop-common-project\hadoop-common\src\main\winutils\libwinutils.vcxproj" (default targets)
 -- FAILED.
Done Building Project "C:\Users\user\hadoop\hadoop-common\hadoop-common-project\hadoop-common\src\main\winutils\winutils.vcxproj.metaproj" (default ta
rgets) -- FAILED.
Done Building Project "C:\Users\user\hadoop\hadoop-common\hadoop-common-project\hadoop-common\src\main\winutils\winutils.sln" (default targets) -- FAI
LED.

Build FAILED.

"C:\Users\user\hadoop\hadoop-common\hadoop-common-project\hadoop-common\src\main\winutils\winutils.sln" (default target) (1) ->
"C:\Users\user\hadoop\hadoop-common\hadoop-common-project\hadoop-common\src\main\winutils\winutils.vcxproj.metaproj" (default target) (2) ->
"C:\Users\user\hadoop\hadoop-common\hadoop-common-project\hadoop-common\src\main\winutils\libwinutils.vcxproj" (default target) (3) ->
(_WindowsSDKPrepareForBuild target) ->
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets\Windows7.1SDK\Microsoft.Cpp.Win32.Windows7.1SDK.targets(20,5): error : You
are attempting to build a Win32 application from an x64 environment. If using the Windows 7.1 SDK build environment, type setenv /x86 [C:\Users\user\h
adoop\hadoop-common\hadoop-common-project\hadoop-common\src\main\winutils\libwinutils.vcxproj]

基本上是说我要切换到32位构建环境。
但是当我现在做
setenv /x86
set TARGET_CPU=x86

并开始一个新的构建,maven给我以下错误:
[INFO] --- exec-maven-plugin:1.2:exec (compile-ms-native-dll) @ hadoop-common ---
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 27.11.2014 14:17:06.
Project "C:\Users\user\hadoop\hadoop-common\hadoop-common-project\hadoop-common\src\main\native\native.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Release|Mixed Platforms".
Project "C:\Users\user\hadoop\hadoop-common\hadoop-common-project\hadoop-common\src\main\native\native.sln" (1) is building "C:\Users\user\h
adoop\hadoop-common\hadoop-common-project\hadoop-common\src\main\native\native.vcxproj" (2) on node 1 (default targets).
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\PlatformToolsets\Windows7.1SDK\Microsoft.Cpp.x64.Windows7.1SDK.targets(20,5): error : You are at
tempting to build an AMD64 application from an x86 environment. If using the Windows 7.1 SDK, type setenv /x64 [C:\Users\user\hadoop\hadoop-common\had
oop-common-project\hadoop-common\src\main\native\native.vcxproj]
Done Building Project "C:\Users\user\hadoop\hadoop-common\hadoop-common-project\hadoop-common\src\main\native\native.vcxproj" (default targets) -- FAI
LED.
Done Building Project "C:\Users\user\hadoop\hadoop-common\hadoop-common-project\hadoop-common\src\main\native\native.sln" (default targets) -- FAILED.


Build FAILED.

为什么所有项目都在不同的体系结构中,或者我需要设置其他一些选项才能完全构建在一个体系结构中?

最佳答案

您还必须正确设置平台。

将构建环境设置为x64的完整命令为:

setenv /x64
set TARGET_CPU=x64
set platform=x64

关于windows - 在Windows Win32 vs amd64上构建hadoop,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27171714/

相关文章:

linux - Linux 中 t32.exe 文件的用途是什么?

Android:为什么当计算量增加时整数计算比浮点计算慢很多?

c# - 为什么 C# System.Decimal (decimal) "waste"位?

windows - 如何知道 IEEE 1394 (FireWire) 是否连接到我的 Windows 7?

java - 如何在Windows 64位操作系统中使用apache ant和eclipse运行java程序?

C++ REG_SZ 到 char* 并在没有提升权限的情况下读取 HKLM

python - 在anaconda上的python脚本中指定hdfs目录的路径

hadoop - 为什么伪分布式需要hadoop命令?

hadoop - 如何通过集群中的oozie工作流将文本文件加载到hdfs

memory - 缓存设计中如何知道 "section/offset" block 的大小?