[C++-sig] Cygwin Boost.Python Build

David Abrahams david.abrahams at rcn.com
Fri May 24 19:09:41 CEST 2002


----- Original Message -----
From: "Scott A. Smith" <ssmith at magnet.fsu.edu>
To: <c++-sig at python.org>
Sent: Friday, May 24, 2002 12:49 PM
Subject: RE: [C++-sig] Cygwin Boost.Python Build


> Hi Dave,
>
> > > Now, can anyone tell me what I need for the following environment
> > > variables? The values to the right are those suggested in the build
> > > directions and those in () are the ones I assume are correct.
> > >
> > >   PYTHON_ROOT       /usr/local                (?)
> >
> > The root directory of your regular Windows Python (not Cygwin)
> > installation; should contain a Lib/ subdirectory. I guess this is my
> > mistake -- I never set this up to work with Cygwin but no ordinary
Python.
>
> In a previous e-mail you said that I needed to have Cygwin built Python,
> not Windows Python!

Yes, you do. However, the helpful configuration checking is slightly
broken; if you're building with Cygwin your windows python will be largely
ignored, but it still expects to find the right material in the ordinary
Windows relationship to PYTHON_ROOT.

> OK, I have both on the system anyway, so I'll switch back to using
> the Windows Python directory.
>
> > However, if you haven't installed that, you can get around the "no
python
> > installation" message by setting PYTHON_STDLIB_PATH to point at your
> Cygwin
> > python's Lib/ directory.
>
> No, I don't think this is possible unless I install the Python sources
> from CygWin. I don't think there is a Python directory will all of this
> stuff
> if one does a typical CygWin installation.

There is at least a Lib/ directory; that contains the Python standard
library which is full of .py files.
However, for a Cygwin build you /will/ need the #includes as well (which
according to your previous message you already have).

> I have downloaded the latest
> sources from them (they do not build either however), so I could set
this,
> but I'll stick to the Windows flavor for now.
>
> > In theory, you should be able to set PYTHON_ROOT to c:/cygwin/usr, but
I
> > don't think it actually will make a difference if you set
> > PYTHON_STDLIB_PATH.
>
> We'll see. Here is the next go through. A little closer to getting a
> build. I will show two different attempts.... although you told me
> (I think) that one needs to build in a Windows command shell, I still
> give it a go in a CygWin bash shell too. I don't think there is any
> problems with the latter.
>
> I did the following in a Windows command shell:
>
> set PYTHON_ROOT=C:\PROGRA~1\Python22
> set PYTHON_VERSION=2.2
> set CYGWIN_ROOT=C:\cywin
> set GCC_PYTHON_ROOT=C:\cygwin\usr
> set PATH=C:\cygwin\bin;C:\cygwin\usr\local\bin;%PATH%
> cd C:\PROGRA~1\Boost\boost_1_28_0\libs\python\build
> bjam -sTOOLS=gcc -sBUILD=release
>
> I did the following in a Cygwin bash shell
>
> PYTHON_ROOT="C:/Program Files/Python22"
> export PYTHON_ROOT
> PYTHON_VERSION="2.2"
> export PYTHON_VERSION
> CYGWIN_ROOT="C:/cywin"
> export CYGWIN_ROOT
> GCC_PYTHON_ROOT="C:/cygwin/usr"
> export GCC_PYTHON_ROOT
> cd c:/Prog*/Boost/boost*/libs/python/build
> bjam -sTOOLS=gcc -sBUILD=release
>
> Now, the output from both attempts is essentially the same.
> Below is an excerpt, I hope you can make some sense out of
> what is going wrong. Maybe it is just a bad compiler command.
>
> $ bjam -sTOOLS=gcc -sBUILD=release
> ...found 260 targets...
> ...updating 14 targets...
> gcc-C++-action
>
..\..\..\libs\python\build\bin\boost_python.dll\gcc\release\inlining-on\run
t
> ime-link-dynamic\types.obj
> cc1plus.exe: Invalid option `-foptimize-sibling-calls'

If you are seeing -foptimize-sibling-calls, something is wrong with the
Boost release. This was not supposed to be in the release and was fixed in
the right place, but I guess it crept in. Please find
tools/build/python.jam and change the line which reads:

      <inlining>on <cxxflags>-foptimize-sibling-calls

to read:

      <inlining>on







More information about the Cplusplus-sig mailing list