Opened 6 years ago

Last modified 6 years ago

#12365 new Bugs

fail to build under mingw

Reported by: anonymous Owned by:
Milestone: To Be Determined Component: Building Boost
Version: Boost 1.61.0 Severity: Problem
Keywords: Cc:

Description

Hi there. I cannot install boost under mingw. Accordingly to documentation i should start with bootstrap.bat without arguments in tools\build\ but it fails to run with reason: "'cl' is not recognized as an internal or external command"

(of course it is not recognized, i don't have visual studio at all!)

While i'm trying to run .\bootstrap.bat mingw i've got 'Unknown toolset: mingw'

Please, create rigth documentation to build it under mingw so that user should'n try different propositions like from http://stackoverflow.com/questions/38103244/building-boost-1-61-0-with-mingw-5-3-0 which doesn't work

Change History (2)

comment:1 by anonymous, 6 years ago

I'm having a similar issue building Boost (in my case with clang 3.8.0-win64 and mingw-w64 x86_64-5.3.0-posix-seh-rt_v4-rev0 on Windows 10). I'm still investigating, but the issues I've found so far that seem relevant here are:

  1. tools/build/bootstrap.bat invokes tools.build/src/engine/build.bat, which tries to guess the users toolset. One of the ways it does this is by testing if a particular executable file can be found on the users %PATH% using a function called Test_Path. The assumption is that Test_Path will set errorlevel 1 if the executable is not found, but this is not the case. In fact Test_Path will never set errorlevel 1. I have modified Test_Path locally as:
    :Test_Path
    REM Tests for the given executable file presence in the directories in the PATH
    REM environment variable. Additionaly sets FOUND_PATH to the path of the
    REM found file.
    call :Clear_Error
    setlocal
    set test=%~$PATH:1
    call :Test_Empty %test%
    endlocal
    if errorlevel 1 (
        call :Clear_Error
        set FOUND_PATH=%~dp$PATH:1
        goto :eof)
    call :Set_Error
    goto :eof
    

which appears to resolve this issue but is probably not the optimal fix (I claim no expertise with regard to Windows batch files).

  1. tools/build/bootstrap.bat has a set of supported toolsets which it uses to build jam. It then invokes jam to build b2. jam has its own set of supported toolsets. tools/build/bootstrap.bat supports mingw (line 30). jam appears not to (tools/build/src/engine/build.jam).

comment:2 by anonymous, 6 years ago

Experiencing similar issue in Windows 7: jam does not support mingw while its supported inside build.bat:

Guessed toolset: gcc ### ### Using 'mingw' toolset. ###

C:\Boost_dl\boost_1_63_0\boost_1_63_0\tools\build\src\engine>if exist bootstrap rd /S /Q bootstrap

C:\Boost_dl\boost_1_63_0\boost_1_63_0\tools\build\src\engine>md bootstrap

C:\Boost_dl\boost_1_63_0\boost_1_63_0\tools\build\src\engine>gcc -DNT -o bootstrap\jam0.exe command.c compile.c constants.c debug.c execcmd.c execnt.c filent.c frames.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathnt.c pathsys.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c md5.c class.c cwd.c w32_getreg.c native.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c

C:\Boost_dl\boost_1_63_0\boost_1_63_0\tools\build\src\engine>.\bootstrap\jam0 -f build.jam --toolset=mingw "--toolset-root=C:\MinGW\ " clean ### ### Unknown toolset: mingw ### ### Known toolsets are: acc, borland, cc, como, clang, darwin, gcc, gcc-nocygwin, intel-darwin, intel-linux, intel-win32, kcc, kylix, metrowerks, mipspro, msvc, qcc, pathscale, pgi, sun, sunpro, tru64cxx, vacpp, xlcpp, vc7, vc8, vc9, vc10, vc11, vc12, vc14, vc15, vmsdecc ###

C:\Boost_dl\boost_1_63_0\boost_1_63_0\tools\build\src\engine>.\bootstrap\jam0 -f build.jam --toolset=mingw "--toolset-root=C:\MinGW\ " ### ### Unknown toolset: mingw ### ### Known toolsets are: acc, borland, cc, como, clang, darwin, gcc, gcc-nocygwin, intel-darwin, intel-linux, intel-win32, kcc, kylix, metrowerks, mipspro, msvc, qcc, pathscale, pgi, sun, sunpro, tru64cxx, vacpp, xlcpp, vc7, vc8, vc9, vc10, vc11, vc12, vc14, vc15, vmsdecc ###

C:\Boost_dl\boost_1_63_0\boost_1_63_0\tools\build\src\engine>exit /b 1

Note: See TracTickets for help on using tickets.