title: Building Boost with MinGW64 without MASM
body: <p>I tried to build the Boost library for native 64bit using MinGW64 compiler, but got some failures. Any pointers are appreciated. Thanks.</p>
  
  <p>I got the bjam.exe (b2.exe) compiled in 64bit (with warning) and I used it the get the Boost built. I got the following error when building Boost.Context. (I wrote the command in batch for repeatable building). Anything I missed?</p>
  
  <ul>
  <li>Command: b2.exe install --prefix=%~dp0\bld\Boost.Build</li>
  <li>Error: 'ml64' is not recognized as an internal or external command, operable program or batch file.</li>
  </ul>
  
  <p>I read the documentation and it said:</p>
  
  <p>Boost.Context must be built for the particular compiler(s) and CPU architecture(s)s being targeted. Boost.Context includes assembly code and, therefore, requires GNU AS for supported POSIX systems, and MASM for Windows systems.</p>
  
  <p>So, is it possible to tell the bjam to use the as.exe included in my MinGW installation?
  (As I have multiple MinGW, the location is not standard as C:\MinGW\bin)</p>
  
  <p><b>project-config.jam</b></p>
  
  <pre><code>import option ;
  using gcc ; 
  option.set keep-going : false ; 
  </code></pre>
  
  <p><b>Platform</b></p>
  
  <ul>
  <li>Windows 7 x64</li>
  <li>Boost 1.52.0 (source from sourceforge)</li>
  <li>MinGW 4.7.2 (rubenvb x64)</li>
  <li>No MSVC installation (no ml64.exe installed/found in my machine)</li>
  <li><b>Edit</b> Problems occurred when installing WDK</li>
  </ul>
  
  <p><b>Warning when building BJam</b>, I think it can be ignored</p>
  
  <pre><code>function.c: In function 'check_alignment':
  function.c:222:5: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  </code></pre>
  
  <p><b>Full batch</b></p>
  
  <pre><code>SET OPATH=%PATH%
  SET BOOST_VER=boost_1_52_0
  SET "PATH_ZIP=C:\Program Files\7-zip"
  SET "PATH_MINGW=C:\MinGW\rubenvb-4.7.2-64"
  SET "PATH_SRC=%~dp0\%BOOST_VER%"
  SET "PATH_BJAM=%PATH_SRC%\tools\build\v2\engine"
  
  TITLE Extracting Packages ...
  IF NOT EXIST "%PATH_SRC%.7z" GOTO :err_nozip
  RD /S /Q "%PATH_SRC%"
  "%PATH_ZIP%"\7z x "%PATH_SRC%.7z"
  
  TITLE Building BJam ...
  PUSHD "%PATH_BJAM%"
  SET "PATH=%PATH_MINGW%\bin"
  SET "BOOST_JAM_TOOLSET_ROOT=%PATH_MINGW%\"
  CALL build.bat mingw --show-locate-target
  SET PATH=%OPATH%
  COPY "bin.ntx86_64\b2.exe" "%PATH_SRC%\" &gt; nul
  COPY "bin.ntx86_64\bjam.exe" "%PATH_SRC%\" &gt; nul
  POPD
  
  TITLE Installing Boost Build...
  PUSHD "%PATH_SRC%"
  ECHO import option ; &gt; project-config.jam
  ECHO. &gt;&gt; project-config.jam
  ECHO using gcc ; &gt;&gt; project-config.jam
  ECHO. &gt;&gt; project-config.jam
  ECHO option.set keep-going : false ; &gt;&gt; project-config.jam
  ECHO. &gt;&gt; project-config.jam
  b2.exe install --prefix=%~dp0\bld\Boost.Build
  POPD
  
  SET PATH=%OPATH%
  </code></pre>