[C++-sig] Re: Q: Problems building boost.python under cygwin

David Abrahams dave at boost-consulting.com
Mon Nov 11 14:29:33 CET 2002


Claudius Schnörr <schnoerr at mailzone.com> writes:

> Hello David,
>
> since only you answered me, I think my problems are very specific. 
> I therefore reply to you directly:

Please don't assume that. You'll get much better service if you post
your C++-sig questions to the C++-sig.

> 1) You are right, I didn't use the downloadable bjam.exe but built
> it from boost/tools/build/jam_src.  After having defined the
> cygwin-options in Makefile (CC=gcc, CFLAGS=-D__cygwin__), I could
> build it.
>
> Since I don't have MSVC, I now tried both, the downloadable bjam.exe for
> Cygwin and Windows, as you suggested:
> a) bjam.exe.gz for Cygwin is somehow corrupted, gzip -t bjam.exe.gz
> reports 'unexpected end of file'.

That appears to be true. John, are you ever going to fix this?

>    I tried it three times. In addition, I tried to rename it
> (bjam.exe.gz --> bjam.exe) for the case    Netscape decompressed it but
> keept its name). This was not the case.

Oh, well. bjam is easy enough to rebuild under Cygwin, though: just go
to $BOOST_ROOT/tools/build and do "make CC=gcc". Not that it
matters. I was suggesting that you use the regular Win32 bjam
executable in a regular Win32 shell.

> b) With bjam.exe for Windows, I cannot figure out how to set the
> environment variables correctly.
>    It would be easier to find the right settings, if not all variables
> were reported but only those which are still set badly. 

It can't tell which ones are badly set, though.

> This bjam does not accept the settings which worked in 1).

Which settings?

> 3) I try to reformulate my last sentence (sorry for my bad English):
> Since bjam tried to build shared libs as *.so instead of *.dll, I
> got the impression that I have missed to set some necessary
> environment variables/options/directives for cygwin.

No, you haven't. A cygwin-built bjam is not the same as a Win32-built
bjam. Quit messing around with the cygwin one if you want to use
Boost.Python (we'll support that in Boost.Build v2, but not yet). Just
download the "Microsoft Windows" version of bjam and use that. It will
generate the appropriate extensions.

> David Abrahams wrote:
>> 
>> The following message is a courtesy copy of an article
>> that has been posted to gmane.comp.lib.boost.user as well.
>> 
>> "Schnörr, Claudius Dr."    <Claudius.Schnoerr at ddg.de> writes:
>> 
>> > Hello,
>> >
>> > I run into problems building boost under cygwin.
>> >
>> > It seems to be merely a matter of a wrong configuration or wrong scripts.
>> >
>> > After running 'bjam -sTOOLS=gcc -n > build.com' in boost/libs/python/build
>> > in order to get hands on the statements being executed by bjam,
>> 
>> Did you use the Win32 bjam downloaded from the website, or did you try
>> to build your own bjam under Cygwin? I build and test a Cygwin version
>> of on Boost.Python on a regular basis using the former executable (or
>> one built from source with a regular Win32 toolset like MSVC).
>> 
>> > there had to be made a lot of textual replacements to get the statements in
>> > build.com run:
>> >
>> > Just to mention some:
>> >
>> > - replace '-isystem ' by '-I'
>> 
>> Was that neccessary? My Cygwin GCC responds nicely to -isystem.
>> 
>> > - remove '-I""'
>> > - change shared library-names from *.so to *.dll
>> 
>> That's handled automatically when you do it my way.
>> 
>> > - insert '-L <path_to_libpython2.2.dll> -lpython2.2'  where shared libs are
>> > created
>> >
>> >
>> > In boost/libs/python/test, going the same way, there have in addition this
>> > changes to be made:
>> > - LD_LIBRARY_PATH=...  --> PATH=$PATH:..., because cygwin uses PATH to look
>> > for .dlls
>> >
>> >
>> > My question:
>> >
>> > I think there have to be made more configurations than I did to create the
>> > boost.python-stuff under cygwin.
>> 
>> I don't understand that sentence.
>> 
>> --
>>                     David Abrahams
>> dave at boost-consulting.com * http://www.boost-consulting.com

-- 
                       David Abrahams
   dave at boost-consulting.com * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution





More information about the Cplusplus-sig mailing list