Building generator (from source) that generates cpp

View: New views
4 Messages — Rating Filter:   Alert me  

Building generator (from source) that generates cpp

by debionne :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,
I'm using BBV2 to build my own projects for quite a long time. Right now
I'm facing the following issue : I want to generate CPP from an other type
of file and I want this home made generator to be build from source when
necessary. This is basically what Quickbook toolset does so I try to start
from that.
The strange thing is that, as long as I don't generate CPP but other file
type (XML, what ever), it's fine. But when targeting CPP, I can't build
the generator 'automatically'.

I include a small test case that shows my problem. To play with the test
case, unzip next to your boost_1_39_0 directory.

If I try to build the generator directly (i.e. bjam tool/mygen with my
test case) it's fine. If I try to build the target that uses the generator
(i.e. bjam) I get the following message :

warn: Unable to construct tool/mygen
error: no generators were found for type 'EXE'
error: and the requested properties
error: make sure you've configured the needed tools

I'm pretty sure that MSVC toolset is correcty configured.

The detailed "debug generators" log gives :

         *** construct OBJ
             from { src/message.in.IN }
             properties: <asynch-exceptions>off <debug-store>object
<debug-symbols>off <define>BOOST_ALL_NO_LIB=1 <define>NDEBUG
<doxygen.doxproc.index>no <doxygen.processor>xsltproc
<embed-manifest>on <exception-handling>on
<extern-c-nothrow>off <format>html <hardcode-dll-paths>true
<host-os>windows <inlining>full <install-dependencies>off
<link>static <main-target-type>EXE <midl-robust>yes
<midl-stubless-proxy>yes <optimization>speed <os>NT <pch>on
<preserve-test-targets>on <profiling>off
<python-debugging>off
<python.interpreter>c:/Python26/python.exe <python>2.6
<rtti>on <runtime-debugging>off <runtime-link>shared
<stdlib>native <suppress-import-lib>false
<symlink-location>project-relative <target-os>windows
<threadapi>win32 <threading>multi
<toolset-msvc:version>9.0express <toolset>msvc
<user-interface>console <variant>release
<warnings-as-errors>off <warnings>on
         ***  6  viable generators
           ** generator msvc.compile.c++
           composing:
             *** construct CPP
                 from { src/message.in.IN }
                 properties: <asynch-exceptions>off <debug-store>object
<debug-symbols>off <define>BOOST_ALL_NO_LIB=1
<define>NDEBUG <doxygen.doxproc.index>no
<doxygen.processor>xsltproc <embed-manifest>on
<exception-handling>on <extern-c-nothrow>off <format>html
<hardcode-dll-paths>true <host-os>windows <inlining>full
<install-dependencies>off <link>static
<main-target-type>EXE <midl-robust>yes
<midl-stubless-proxy>yes <optimization>speed <os>NT
<pch>on <preserve-test-targets>on <profiling>off
<python-debugging>off
<python.interpreter>c:/Python26/python.exe <python>2.6
<rtti>on <runtime-debugging>off <runtime-link>shared
<stdlib>native <suppress-import-lib>false
<symlink-location>project-relative <target-os>windows
<threadapi>win32 <threading>multi
<toolset-msvc:version>9.0express <toolset>msvc
<user-interface>console <variant>release
<warnings-as-errors>off <warnings>on
             find-viable-generators target-type= CPP property-set=
msvc-9.0express/release/link-static/threading-multi
             trying type CPP
             there are generators for this type
             trying generator mygen.in-to-cpp ( IN -> CPP )
               is viable
             ***  1  viable generators
mygen-dir:  /D:/users/debionne/dev/boost/test-bbv2/tool
project:  object(project-target)@89
mygen-main-target:  object(project-target)@96 object(property-set)@9
mygen-main-target:  object(main-target)@432
                 *** construct EXE
                     from { mygen-simple.cpp.CPP }
                     properties: <asynch-exceptions>off
<debug-store>object <debug-symbols>off
<define>BOOST_ALL_NO_LIB=1 <define>NDEBUG
<doxygen.doxproc.index>no <doxygen.processor>xsltproc
<embed-manifest>on <exception-handling>on
<extern-c-nothrow>off <format>html
<hardcode-dll-paths>true <host-os>windows
<inlining>full <install-dependencies>off <link>static
<main-target-type>EXE <midl-robust>yes
<midl-stubless-proxy>yes <optimization>speed <os>NT
<pch>on <preserve-test-targets>on <profiling>off
<python-debugging>off
<python.interpreter>c:/Python26/python.exe
<python>2.6 <rtti>on <runtime-debugging>off
<runtime-link>shared <stdlib>native
<suppress-import-lib>false
<symlink-location>project-relative <target-os>windows
<threadapi>win32 <threading>multi
<toolset-msvc:version>9.0express <toolset>msvc
<user-interface>console <variant>release
<warnings-as-errors>off <warnings>on
                 ***  0  viable generators
warn: Unable to construct tool/mygen-simple
             find-viable-generators target-type= EXE property-set=
msvc-9.0express/release/link-static/threading-multi
             trying type EXE
             there are generators for this type
             trying generator msvc.link ( OBJ SEARCHED_LIB STATIC_LIB
IMPORT_LIB -> EXE )
               is viable
error: no generators were found for type 'EXE'
error: and the requested properties
error: make sure you've configured the needed tools

Could there be any "requested properties" conflict ?

Any help would great !
Regards,
Samuel
[attachment removed]
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: Building generator (from source) that generates cpp

by Vladimir Prus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Monday 29 June 2009 Samuel Debionne wrote:

> Hello,
> I'm using BBV2 to build my own projects for quite a long time. Right now
> I'm facing the following issue : I want to generate CPP from an other type
> of file and I want this home made generator to be build from source when
> necessary. This is basically what Quickbook toolset does so I try to start
> from that.
> The strange thing is that, as long as I don't generate CPP but other file
> type (XML, what ever), it's fine. But when targeting CPP, I can't build
> the generator 'automatically'.
>
> I include a small test case that shows my problem. To play with the test
> case, unzip next to your boost_1_39_0 directory.
>
> If I try to build the generator directly (i.e. bjam tool/mygen with my
> test case) it's fine. If I try to build the target that uses the generator
> (i.e. bjam) I get the following message :
>
> warn: Unable to construct tool/mygen
> error: no generators were found for type 'EXE'
> error: and the requested properties
> error: make sure you've configured the needed tools

Samuel,

what is happening is that you are building EXE target, which uses gcc.link
generator, which then recursively builds sources, invoking your custom
generator. This, in turn, tries to build another EXE target, again using
gcc.link generator. However, there's a safety net against infinite recursion,
which blocks second invocation of the same generator.

I have just checked in patch to make this logic somewhat more relaxed,
so if you update from SVN, your project should work.

If you wonder why this issue did not appear earlier, there are two
reasons:
1. quickbook generator is not building EXE, so this double-invocation
of generator does not happen.
2. The method quickbook uses is the most flexible, but also most
complex. The approach demonstrated by examples/built_tool is
considerably easier, and I suspect that's what most users do. Of
course, if your project works after SVN update, there's no reason
for you do change anything.

Hope this helps,
Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: Building generator (from source) that generates cpp

by debionne :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you Volodya,
your patch worked ! Thank you for your explanation as well, I could not
have figured out this issue on my own.
Is there any chance to have this fix in future releases ?
If I had found the examples/built_tool before, I would have problably gone
this way...
Samuel

> On Monday 29 June 2009 Samuel Debionne wrote:
>
>> Hello,
>> I'm using BBV2 to build my own projects for quite a long time. Right now
>> I'm facing the following issue : I want to generate CPP from an other
>> type
>> of file and I want this home made generator to be build from source when
>> necessary. This is basically what Quickbook toolset does so I try to
>> start
>> from that.
>> The strange thing is that, as long as I don't generate CPP but other
>> file
>> type (XML, what ever), it's fine. But when targeting CPP, I can't build
>> the generator 'automatically'.
>>
>> I include a small test case that shows my problem. To play with the test
>> case, unzip next to your boost_1_39_0 directory.
>>
>> If I try to build the generator directly (i.e. bjam tool/mygen with my
>> test case) it's fine. If I try to build the target that uses the
>> generator
>> (i.e. bjam) I get the following message :
>>
>> warn: Unable to construct tool/mygen
>> error: no generators were found for type 'EXE'
>> error: and the requested properties
>> error: make sure you've configured the needed tools
>
> Samuel,
>
> what is happening is that you are building EXE target, which uses gcc.link
> generator, which then recursively builds sources, invoking your custom
> generator. This, in turn, tries to build another EXE target, again using
> gcc.link generator. However, there's a safety net against infinite
> recursion,
> which blocks second invocation of the same generator.
>
> I have just checked in patch to make this logic somewhat more relaxed,
> so if you update from SVN, your project should work.
>
> If you wonder why this issue did not appear earlier, there are two
> reasons:
> 1. quickbook generator is not building EXE, so this double-invocation
> of generator does not happen.
> 2. The method quickbook uses is the most flexible, but also most
> complex. The approach demonstrated by examples/built_tool is
> considerably easier, and I suspect that's what most users do. Of
> course, if your project works after SVN update, there's no reason
> for you do change anything.
>
> Hope this helps,
> Volodya
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost-build
>



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: Building generator (from source) that generates cpp

by Vladimir Prus-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Samuel Debionne wrote:

> Thank you Volodya,
> your patch worked ! Thank you for your explanation as well, I could not
> have figured out this issue on my own.
> Is there any chance to have this fix in future releases ?

It will be definitely included.

Glad that things are working for you now.

- Volodya


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build