boostorg / build

B2 makes it easy to build C++ projects, everywhere.
Boost Software License 1.0
229 stars 47 forks source link

Python path detection incorrect on macOS + brew + clang, but disallowed to pass multiple lib paths via jamfile to fix issue #374

Open Yzrsah opened 5 years ago

Yzrsah commented 5 years ago

Hello,

When building Boost on macOS Mojave with Homebrew and LLVM+Clang 7.0.0:

First:

Next, build boost: 1) ./bootstrap.sh --with-toolset=clang --with-python=/usr/local/bin/python3 --with-python-version=3.7 2) Small issue: This will cause the build to fail because you also have to provide "--with-python-root=/usr/local/bin/python3 " otherwise path detection is incorrect. Providing the path to the binary twice might be confusing for the user.

So fixing that:

1) ./bootstrap.sh --with-toolset=clang --with-python=/usr/local/bin/python3 --with-python-root=/usr/local/bin/python3 --with-python-version=3.7

Now Python paths will be detected incorrectly. (Build will fail later on):

notice: [python-cfg] Configuring python...
notice: [python-cfg]   user-specified version: "3.7"
notice: [python-cfg]   user-specified cmd-or-prefix: "/usr/local/bin/python3"
notice: [python-cfg] Checking interpreter command "/usr/local/bin/python3"...
notice: [python-cfg] running command '/usr/local/bin/python3 -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1'
notice: [python-cfg] ...requested configuration matched!
notice: [python-cfg] Details of this Python configuration:
notice: [python-cfg]   interpreter command: "/usr/local/bin/python3"
notice: [python-cfg]   include path: "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/include/python3.7"
notice: [python-cfg]   library path: "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config" "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib"

Therefore I modify the project-config.jam file to add the paths manually:

    using python
        : 3.7
        : /usr/local/bin/python3
        : /usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/include/python3.7m
        : /usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin
          /usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib
        ;

However this produces a build error:

*** argument error
* rule python.init ( version ? : cmd-or-prefix ? : includes * : libraries ? : condition * : extension-suffix ? )
* called with: ( 3.7 : /usr/local/bin/python3 : /usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/include/python3.7m : /usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin
    /usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib :  :  :  :  )
* extra argument /usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib

Because only a single argument is allowed to be passed via libraries. But manually replacing all incorrectly detected paths requires passing multiple paths.

StamKaly commented 5 years ago

I am having the same problem on windows using user-config.jam. Did you ever find a solution?

sujit22993 commented 4 years ago

[Solution]

  1. Updating gcc to latest version latest releases gcc9.2

  2. Downgrading python3.7 --> python3.6 python releases

[Issue] Path looking for - '/Users/trionfo1/.virtualenv/kd_local/lib/python3.7/config-3.7m/libpython3.7.a' and actual path in the virtualenv was /usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin

I got the above error while installing uwsgi with following [Libraries] :

stale[bot] commented 3 years ago

Thank you for your contributions. Main development of B2 has moved to https://github.com/bfgroup/b2 This issue has been automatically marked as "transition" to indicate the potential for needing transition to the new B2 development project.