Reputation: 321
I am currently try to build hadoop 2.5 for windows 7 x64 Plateform. I am following instruction from
https://wiki.apache.org/hadoop/Hadoop2OnWindows and have all dependencies mentioned in https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.5/BUILDING.txt. I am getting a error for Apache Hadoop Common Project while building using following maven command
mvn package -Pdist,native-win -DskipTests -Dtar
. Following is error
[INFO]
[INFO] --- exec-maven-plugin:1.2:exec (compile-ms-native-dll) @ hadoop-common ---
Build started 15-11-2014 11:08:28.
Project "D:\hadoop-2.5.0-src\hadoop-common-project\hadoop-common\src\main\native\native.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "Release|x64".
Project "D:\hadoop-2.5.0-src\hadoop-common-project\hadoop-common\src\main\native\native.sln" (1) is building "D:\hadoop-2.5.0-src\hadoop-common-project\hadoop-common\src\main\native\native.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 /I"C:\Progra~1\Java\jdk1.7.0_51\include" /I"C:\Progra~1\Java\jdk1.7.0_51\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\ZlibCompressor.c src\org\apache\hadoop\io\compress\zlib\ZlibDecompressor.c
ZlibCompressor.c
d:\hadoop-2.5.0-src\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: Cannot open include file: 'zlib.h': No such file or directory [D:\hadoop-2.5.0-src\hadoop-common-project\hadoop-common\src\main\native\native.vcxproj]
ZlibDecompressor.c
d:\hadoop-2.5.0-src\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: Cannot open include file: 'zlib.h': No such file or directory [D:\hadoop-2.5.0-src\hadoop-common-project\hadoop-common\src\main\native\native.vcxproj]
Done Building Project "D:\hadoop-2.5.0-src\hadoop-common-project\hadoop-common\src\main\native\native.vcxproj" (default targets) -- FAILED.
Done Building Project "D:\hadoop-2.5.0-src\hadoop-common-project\hadoop-common\src\main\native\native.sln" (default targets) -- FAILED.
Build FAILED.
"D:\hadoop-2.5.0-src\hadoop-common-project\hadoop-common\src\main\native\native.sln" (default target) (1) ->
"D:\hadoop-2.5.0-src\hadoop-common-project\hadoop-common\src\main\native\native.vcxproj" (default target) (2) ->
(ClCompile target) ->
d:\hadoop-2.5.0-src\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: Cannot open include file: 'zlib.h': No such file or directory [D:\hadoop-2.5.0-src\hadoop-common-project\hadoop-common\src\main\native\native.vcxproj]
d:\hadoop-2.5.0-src\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: Cannot open include file: 'zlib.h': No such file or directory [D:\hadoop-2.5.0-src\hadoop-common-project\hadoop-common\src\main\native\native.vcxproj]
0 Warning(s)
2 Error(s)
Upvotes: 0
Views: 483
Reputation: 530
From the log, it is obviously that you miss zlib.h Did you set the env var ZLIB_HOME to the directory containing zlib.h? Note that put zlib.h directory in PATH is wrong and not necessary, only zlib bin directory is needed, as said in Building guide https://svn.apache.org/viewvc/hadoop/common/branches/branch-2/BUILDING.txt?view=markup
Also, zlib.h requires some header not present in Windows, so you will need to download those headers and put in the same folder with zlib.h. For more details, see Is there a replacement for unistd.h for Windows (Visual C)? to get unistd.h, and https://gist.github.com/ashelly/7776712 to get getopt.h
For those folks on Win32 (like me), you may have faced much more troubles. The key solution should be editing .sln and .vcxprj file of winutils and native package so that they are compatible with Win32 platform.
Upvotes: 2