title: Missing 'ammintrin.h' when compiling Hadoop on Windows?
body: <p>UPDATE-2 <br>
  I have updated the Windows SDK compilers and now have reduced the errors to 2.</p>
  
  <pre><code>  c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\intrin.h(26): fatal error C1083: Cannot open include file: 'ammintrin.h': No such file or directory [C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\native\native.vcxproj]
  </code></pre>
  
  <p>now where ever I have searched, I have found that to get this .h file I need to install the Microsoft Visual Studio Service Pack 1. I don't have Visual Studio, I am using Windows SDK 7.1. Now, where can I find the equivalent Service Pack 1 for Windows SDK 7.1?<br>
  UPDATE-2 END<br></p>
  
  <p>UPDATE <br>
  After staring at the stack trace for sometime I see that the error occurs here<br></p>
  
  <pre><code>Midl:
    C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\midl.exe /W2 /WX /nologo /char signed /env x64 /Oicf /app_config /out"C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\target/winutils/" /h "hadoopwinutilsvc_h.h" /tlb "C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\target/winutils/libwinutils.tlb" /robust hadoopwinutilsvc.idl 
  TRACKER : error TRK0002: Failed to execute command: ""C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\midl.exe" /W2 /WX /nologo /char signed /env x64 /Oicf /app_config /outC:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\target/winutils/ /h hadoopwinutilsvc_h.h /tlb C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\target/winutils/libwinutils.tlb /robust hadoopwinutilsvc.idl". The handle is invalid. [C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\winutils\libwinutils.vcxproj]
  </code></pre>
  
  <p>So, I tried to run just this command</p>
  
  <pre><code>"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\midl.exe" /W2 /WX /nologo /char signed /env x64 /Oicf /app_config /outC:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\target/winutils/ /h hadoopwinutilsvc_h.h /tlb C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\target/winutils/libwinutils.tlb /robust hadoopwinutilsvc.idl"
  </code></pre>
  
  <p>Now I get the following error</p>
  
  <pre><code>64 bit Processing .\hadoopwinutilsvc.idl
  hadoopwinutilsvc.idl
  midl : command line error MIDL1001 : cannot open input file oaidl.idl
  </code></pre>
  
  <p>When I searched for the file oaidl.ild. I found it in folder</p>
  
  <pre><code>C:\Program Files\Microsoft SDKs\Windows\v7.1\Include
  </code></pre>
  
  <p>I included this in the PATH and ran the command again with the same error. I noticed that the file name is 'OAIdl.Idl' and not 'oaidl.idl'.</p>
  
  <p>The first line in the file hadoopwinutilsvc.idl is 'include oaidl.idl'.</p>
  
  <p><strong>Does this mean that these is an error in hadoop source?</strong></p>
  
  <p>END UPDATE - Original question below.</p>
  
  <p>I am trying to build hadoop on Windows 7 x64.<br>
  I keep getting the following error.<br>
  I have provided the relevant stack trace below. Any help will be much appreciated.<br>
  The command I ran on the command prompt is <br> <code>mvn package -Pdist,native-win -DskipTests -Dtar</code></p>
  
  <pre><code>[DEBUG] env: PATH=C:\csvn\bin\;C:\csvn\Python25\;C:\Program Files\CollabNet\Subversion Client;C:\Windows\system32;C:\Windows;C:\Windows\system32\wbem;C:\Windows\system32\windowspowershell\v1.0\;c:\program files\ibm\gsk8\lib64;c:\program files (x86)\ibm\gsk8\lib;C:\IBM\WEBSPH~1\APPSER~1\db2\BIN;C:\IBM\WEBSPH~1\APPSER~1\db2\FUNCTION;C:\IBM\WEBSPH~1\APPSER~1\db2\SAMPLES\REPL;C:\Program Files\nodejs\;%JAVA_HOME%\bin;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\CMake\bin;C:\Program Files (x86)\Git\cmd;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Users\ajayamrite\AppData\Roaming\npm;C:\apache-maven-3.3.3/bin;C:\cygwin64\bin;C:\protoc-2.5.0-win32;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin;C:\hadoop\bin;c:\hadoop\sbin;C:\Program Files (x86)\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64
  [DEBUG] env: PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
  [DEBUG] env: PLATFORM=x64
  [DEBUG] env: PROCESSOR_ARCHITECTURE=AMD64
  [DEBUG] env: PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 70 Stepping 1, GenuineIntel
  [DEBUG] env: PROCESSOR_LEVEL=6
  [DEBUG] env: PROCESSOR_REVISION=4601
  [DEBUG] env: PROGRAMDATA=C:\ProgramData
  [DEBUG] env: PROGRAMFILES=C:\Program Files
  [DEBUG] env: PROGRAMFILES(X86)=C:\Program Files (x86)
  [DEBUG] env: PROGRAMW6432=C:\Program Files
  [DEBUG] env: PROMPT=$P$G
  [DEBUG] env: PSMODULEPATH=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
  [DEBUG] env: PUBLIC=C:\Users\Public
  [DEBUG] env: PYTHONHOME=C:\csvn\Python25\
  [DEBUG] env: SESSIONNAME=Console
  [DEBUG] env: SYSTEMDRIVE=C:
  [DEBUG] env: SYSTEMROOT=C:\Windows
  [DEBUG] env: TEMP=C:\Users\AJAYAM~1\AppData\Local\Temp
  [DEBUG] env: TMP=C:\Users\AJAYAM~1\AppData\Local\Temp
  [DEBUG] env: USERDOMAIN=bedouinvm
  [DEBUG] env: USERNAME=ajayamrite
  [DEBUG] env: USERPROFILE=C:\Users\ajayamrite
  [DEBUG] env: WDIR=C:\
  [DEBUG] env: WINDIR=C:\Windows
  [DEBUG] env: ZLIB_HOME=C:\zlib127-dll
  [DEBUG] Executing command line: [msbuild, C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common/src/main/winutils/winutils.sln, /nologo, /p:Configuration=Release, /p:OutDir=C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\target/bin/, /p:IntermediateOutputPath=C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\target/winutils/, /p:WsceConfigDir=../etc/hadoop, /p:WsceConfigFile=wsce-site.xml]
  Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  Build started 5/27/2015 3:13:28 PM.
  Project "C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\winutils\winutils.sln" on node 1 (default targets).
  ValidateSolutionConfiguration:
    Building solution configuration "Release|x64".
  Project "C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\winutils\winutils.sln" (1) is building "C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\winutils\winutils.vcxproj.metaproj" (2) on node 1 (default targets).
  Project "C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\winutils\winutils.vcxproj.metaproj" (2) is building "C:\hadoop-2.7.0-src\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\Microsoft.CppBuild.targets(297,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid version number. [C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\winutils\libwinutils.vcxproj]
  InitializeBuildStatus:
    Touching "C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\target/winutils/libwinutils.unsuccessfulbuild".
  Midl:
    C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\midl.exe /W2 /WX /nologo /char signed /env x64 /Oicf /app_config /out"C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\target/winutils/" /h "hadoopwinutilsvc_h.h" /tlb "C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\target/winutils/libwinutils.tlb" /robust hadoopwinutilsvc.idl 
  TRACKER : error TRK0002: Failed to execute command: ""C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\midl.exe" /W2 /WX /nologo /char signed /env x64 /Oicf /app_config /outC:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\target/winutils/ /h hadoopwinutilsvc_h.h /tlb C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\target/winutils/libwinutils.tlb /robust hadoopwinutilsvc.idl". The handle is invalid. [C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\winutils\libwinutils.vcxproj]
  
  
  Done Building Project "C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\winutils\libwinutils.vcxproj" (default targets) -- FAILED.
  Done Building Project "C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\winutils\winutils.vcxproj.metaproj" (default targets) -- FAILED.
  Done Building Project "C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\winutils\winutils.sln" (default targets) -- FAILED.
  
  Build FAILED.
  
  "C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\winutils\winutils.sln" (default target) (1) -&gt;
  "C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\winutils\winutils.vcxproj.metaproj" (default target) (2) -&gt;
  "C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\winutils\libwinutils.vcxproj" (default target) (3) -&gt;
  (PrepareForBuild target) -&gt; 
    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(297,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid version number. [C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\winutils\libwinutils.vcxproj]
  
  
  "C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\winutils\winutils.sln" (default target) (1) -&gt;
  "C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\winutils\winutils.vcxproj.metaproj" (default target) (2) -&gt;
  "C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\winutils\libwinutils.vcxproj" (default target) (3) -&gt;
  (Midl target) -&gt; 
    TRACKER : error TRK0002: Failed to execute command: ""C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\midl.exe" /W2 /WX /nologo /char signed /env x64 /Oicf /app_config /outC:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\target/winutils/ /h hadoopwinutilsvc_h.h /tlb C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\target/winutils/libwinutils.tlb /robust hadoopwinutilsvc.idl". The handle is invalid. [C:\hadoop-2.7.0-src\hadoop-common-project\hadoop-common\src\main\winutils\libwinutils.vcxproj]
  
      1 Warning(s)
      1 Error(s)
  
  Time Elapsed 00:00:01.36
  [INFO] ------------------------------------------------------------------------
  [INFO] Reactor Summary:
  [INFO] 
  [INFO] Apache Hadoop Main ................................. SUCCESS [  1.558 s]
  [INFO] Apache Hadoop Project POM .......................... SUCCESS [  1.334 s]
  [INFO] Apache Hadoop Annotations .......................... SUCCESS [  2.580 s]
  [INFO] Apache Hadoop Assemblies ........................... SUCCESS [  0.170 s]
  [INFO] Apache Hadoop Project Dist POM ..................... SUCCESS [  2.133 s]
  [INFO] Apache Hadoop Maven Plugins ........................ SUCCESS [  2.585 s]
  [INFO] Apache Hadoop MiniKDC .............................. SUCCESS [  2.008 s]
  [INFO] Apache Hadoop Auth ................................. SUCCESS [  3.022 s]
  [INFO] Apache Hadoop Auth Examples ........................ SUCCESS [  2.663 s]
  [INFO] Apache Hadoop Common ............................... FAILURE [ 22.818 s]
  [INFO] Apache Hadoop NFS .................................. SKIPPED
  [INFO] Apache Hadoop KMS .................................. SKIPPED
  [INFO] Apache Hadoop Common Project ....................... SKIPPED
  [INFO] Apache Hadoop HDFS ................................. SKIPPED
  [INFO] Apache Hadoop HttpFS ............................... SKIPPED
  [INFO] Apache Hadoop HDFS BookKeeper Journal .............. SKIPPED
  [INFO] Apache Hadoop HDFS-NFS ............................. SKIPPED
  [INFO] Apache Hadoop HDFS Project ......................... SKIPPED
  [INFO] hadoop-yarn ........................................ SKIPPED
  [INFO] hadoop-yarn-api .................................... SKIPPED
  [INFO] hadoop-yarn-common ................................. SKIPPED
  [INFO] hadoop-yarn-server ................................. SKIPPED
  [INFO] hadoop-yarn-server-common .......................... SKIPPED
  [INFO] hadoop-yarn-server-nodemanager ..................... SKIPPED
  [INFO] hadoop-yarn-server-web-proxy ....................... SKIPPED
  [INFO] hadoop-yarn-server-applicationhistoryservice ....... SKIPPED
  [INFO] hadoop-yarn-server-resourcemanager ................. SKIPPED
  [INFO] hadoop-yarn-server-tests ........................... SKIPPED
  [INFO] hadoop-yarn-client ................................. SKIPPED
  [INFO] hadoop-yarn-server-sharedcachemanager .............. SKIPPED
  [INFO] hadoop-yarn-applications ........................... SKIPPED
  [INFO] hadoop-yarn-applications-distributedshell .......... SKIPPED
  [INFO] hadoop-yarn-applications-unmanaged-am-launcher ..... SKIPPED
  [INFO] hadoop-yarn-site ................................... SKIPPED
  [INFO] hadoop-yarn-registry ............................... SKIPPED
  [INFO] hadoop-yarn-project ................................ SKIPPED
  [INFO] hadoop-mapreduce-client ............................ SKIPPED
  [INFO] hadoop-mapreduce-client-core ....................... SKIPPED
  [INFO] hadoop-mapreduce-client-common ..................... SKIPPED
  [INFO] hadoop-mapreduce-client-shuffle .................... SKIPPED
  [INFO] hadoop-mapreduce-client-app ........................ SKIPPED
  [INFO] hadoop-mapreduce-client-hs ......................... SKIPPED
  [INFO] hadoop-mapreduce-client-jobclient .................. SKIPPED
  [INFO] hadoop-mapreduce-client-hs-plugins ................. SKIPPED
  [INFO] Apache Hadoop MapReduce Examples ................... SKIPPED
  [INFO] hadoop-mapreduce ................................... SKIPPED
  [INFO] Apache Hadoop MapReduce Streaming .................. SKIPPED
  [INFO] Apache Hadoop Distributed Copy ..................... SKIPPED
  [INFO] Apache Hadoop Archives ............................. SKIPPED
  [INFO] Apache Hadoop Rumen ................................ SKIPPED
  [INFO] Apache Hadoop Gridmix .............................. SKIPPED
  [INFO] Apache Hadoop Data Join ............................ SKIPPED
  [INFO] Apache Hadoop Ant Tasks ............................ SKIPPED
  [INFO] Apache Hadoop Extras ............................... SKIPPED
  [INFO] Apache Hadoop Pipes ................................ SKIPPED
  [INFO] Apache Hadoop OpenStack support .................... SKIPPED
  [INFO] Apache Hadoop Amazon Web Services support .......... SKIPPED
  [INFO] Apache Hadoop Azure support ........................ SKIPPED
  [INFO] Apache Hadoop Client ............................... SKIPPED
  [INFO] Apache Hadoop Mini-Cluster ......................... SKIPPED
  [INFO] Apache Hadoop Scheduler Load Simulator ............. SKIPPED
  [INFO] Apache Hadoop Tools Dist ........................... SKIPPED
  [INFO] Apache Hadoop Tools ................................ SKIPPED
  [INFO] Apache Hadoop Distribution ......................... SKIPPED
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 43.747 s
  [INFO] Finished at: 2015-05-27T15:13:30+01:00
  [INFO] Final Memory: 68M/306M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.1:exec (compile-ms-winutils) on project hadoop-common: Command execution failed. Process exited with an error: 1 (Exit value: 1) -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.1:exec (compile-ms-winutils) on project hadoop-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.buildProject(LifecycleModuleBuilder.java:116)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  Caused by: org.apache.maven.plugin.MojoExecutionException: Command execution failed.
      at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:303)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
      ... 20 more
  Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
      at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:402)
      at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:164)
      at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:750)
      at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:292)
      ... 22 more
  [ERROR] 
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  [ERROR] 
  [ERROR] After correcting the problems, you can resume the build with the command
  [ERROR]   mvn &lt;goals&gt; -rf :hadoop-common
  </code></pre>