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

Scott A. Smith ssmith at magnet.fsu.edu
Fri May 24 18:49:23 CEST 2002


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!

================== Snipped from an earlier message ============

>> Do I have to use CygWin's Python rather than that I downloaded?

> Yes. This is a Cygwin (not Boost) limitation. Also you may need to build
> your own Cygwin version of Python from within cygwin to do this, if Cygwin
> doesn't supply the version of Python you want.

================================================================

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. 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\runt
ime-link-dynamic\types.obj
cc1plus.exe: Invalid option `-foptimize-sibling-calls'





g++  -c -Wall -ftemplate-depth-100  -DNDEBUG -DUSE_DL_IMPORT -DBOOST_PYTHON_
DYNAMIC_LIB  -O3 -Wno-inline  -fomit-fra
me-pointer -foptimize-sibling-calls  -I"..\..\..\libs\python\build" -I"." -I
"c:\Program Files\Boost\boost_1_28_0" -I"C:\
cygwin\usr\include\python2.2"   -o
"..\..\..\libs\python\build\bin\boost_python.dll\gcc\release\inlining-on\run
time-link
-dynamic\types.obj"  "../src\types.cpp"

...failed gcc-C++-action
..\..\..\libs\python\build\bin\boost_python.dll\gcc\release\inlining-on\runt
ime-link-dynamic\ty
pes.obj...
gcc-C++-action
..\..\..\libs\python\build\bin\boost_python.dll\gcc\release\inlining-on\runt
ime-link-dynamic\classes.obj
cc1plus.exe: Invalid option `-foptimize-sibling-calls'
.
.
.




g++  -c -Wall -ftemplate-depth-100  -DNDEBUG -DUSE_DL_IMPORT -DBOOST_PYTHON_
DYNAMIC_LIB  -O3 -Wno-inline  -fomit-fr
me-pointer -foptimize-sibling-calls  -I"..\..\..\libs\python\build" -I"." -I
"c:\Program Files\Boost\boost_1_28_0" -I"C:
cygwin\usr\include\python2.2"   -o
"..\..\..\libs\python\build\bin\boost_python.dll\gcc\release\inlining-on\run
time-lin
-dynamic\errors.obj"  "../src\errors.cpp"

...failed gcc-C++-action
..\..\..\libs\python\build\bin\boost_python.dll\gcc\release\inlining-on\runt
ime-link-dynamic\e
rors.obj...
...skipped
<libs!python!build\boost_python.dll\gcc\release\inlining-on\runtime-link-dyn
amic>boost_python.lib for lack o

<libs!python!build\boost_python.dll\gcc\release\inlining-on\runtime-link-dyn
amic>types.obj...
...skipped
<libs!python!build\boost_python.dll\gcc\release\inlining-on\runtime-link-dyn
amic>boost_python.dll for lack o

<libs!python!build\boost_python.dll\gcc\release\inlining-on\runtime-link-dyn
amic>types.obj...
...skipped <!libs!python!build!bin-stage>boost_python.dll for lack of
<libs!python!build\boost_python.dll\gcc\release\i
lining-on\runtime-link-dynamic>boost_python.dll...
...skipped <!libs!python!build!bin-stage>boost_python.lib for lack of
<libs!python!build\boost_python.dll\gcc\release\i
lining-on\runtime-link-dynamic>boost_python.lib...
...failed updating 10 targets...
...skipped 4 targets...

Any ideas?

Thanks for bearing with me Dave,
Scott


-----------------------------------------
-----------------------------------------

 Dr. Scott A. Smith
 Associate in Research
 National High Magnetic Field Laboratory
 1800 East Paul Dirac Drive
 Tallahassee, FL 32310

 phone: (850) 644-6348
 FAX:   (850) 644-1366
 email: ssmith at magnet.fsu.edu
 http://www.magnet.fsu.edu
 http://gamma.magnet.fsu.edu>






More information about the Cplusplus-sig mailing list