Boost logo

Boost-Build :

From: Bilokon, Paul (paul.bilokon_at_[hidden])
Date: 2008-05-08 16:38:23


Hi Jurko,

Once again, many thanks for your help!

I have modified your solution slightly to resolve some of the deficiencies you have mentioned:

rule xyz-python-extension
{
    echo "Building XYZ Python extension '$(1)'..." ;

    python-extension $(1)
    : # Sources
    $(CPP_SRC_DIR)/$(1).cpp
    /boost/python//boost_python
    :
    <link>shared
    ;
}

rule xyz-python-test
{
    echo "Building XYZ Python test '$(1)'..." ;
    
    make $(1)_test.py : $(PY_SRC_DIR)/$(1).py : @common.copy ;
}

rule xyz-python
{
    xyz-python-extension $(1) ;
    xyz-python-test $(1) ;
}

xyz-python hello ;

It works when <link>shared is used, but if we change it above to <link>static, the *.pyd files and *.py files end up in different directories:

(project root)\build\msvc-8.0\release\link-static\threading-multi\ <- pyd file, etc.
(project root)\build\msvc-8.0\release\threading-multi\

I'm not sure whether this is a bug or expected behaviour. In each case, thank your solution works with <link>static. Thank you very much.

Best wishes,
Paul

-----Original Message-----
From: boost-build-bounces_at_[hidden] [mailto:boost-build-bounces_at_[hidden]] On Behalf Of Jurko Gospodnetic
Sent: Thursday, May 08, 2008 8:30 PM
To: boost-build_at_[hidden]
Subject: Re: [Boost-build] Using Boost.Build with Boost.Python: Three Questions; "Copy" Rule

   Hi Paul.

> I need to copy test_hello.py (a Python test harness for the Python extension "hello") to each variant of the build directory:
>
> (project root)\build\msvc-8.0\debug\link-static\threading-multi\
> (project root)\build\msvc-8.0\release\link-static\threading-multi\
>
> How can I achieve this using the builtin install rule? I've tried a number of things, but a copy of the file doesn't appear.

   Hmmm... as I see it the install/stage rule as has been currently implemented is not intended for copying additional data to build folders but only to folders (relative to the project's Jamfile path) known when the Jamfile was written.

   Not sure if this is ok or not, however there is something you can do if you want to do this. A quick-fix without having to dig in deeper into Boost Build would be:

   import make ;
   make aaa-copy.txt : aaa.txt : @common.copy ;

   However there are a several things 'wrong' with this solution:
     1. It is not exactly the most intuitive line of code for what you want it to do.
     2. Forces you to duplicate file name information.
     3. There is no way to make the file to keep its original name.
     4. Does not work with multiple source files.
     5. Does not have any extra install rule logic like install-source-path feature or shared library relinking support.

   I guess a cleaner approach would be to upgrade Boost Build to allow specifying target locations (something like the current <location>
property) relative to the build folder instead of the Jamfile location which would hopefully allow the original install rule to be used for this as well.

   I have added a feature request at
https://zigzag.cs.msu.su:7813/boost.build/ticket/181 for this so hopefully it will not get lost again. :-)

   Best regards,
     Jurko Gospodnetiæ

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

This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice.


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk