Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-09-04 04:18:04


Hi Ian,
> Hi, I'm a newcomer to Boost.Build, Jam, etc. Please redirect me if
> this is the wrong forum for this question.

This is precisely the right forum.

> I'm trying to use Boost.Build v2 to build MATLAB mex files which are
> compiled from a C++ file and link to several libraries built with
> Boost.Build already. A simple example is
> mex myfile.cc
> Which would produce
> myfile.mexglx on linux,
> myfile.mexmac on mac,
> myfile.mexhpux on hpux, etc.
>
> A more complex example would be like:
> mex myfile.cc -L/path/to/mylib -lmylib -I/path/to/myincludes -lmat
> -lm
>
> If someone wants to stop me right here and say "Its not easy" or "Its
> so easy here's the code" please do.

There's a problem with this. You try to use different extension on different
platforms. While it's possible, I'm not sure it's really needed. Is this a
requirement of the tool?

> Otherwise, my initial impression
> from Jam documentation is to create a Jamrules file which defines a
> UserObject rule for going from .cc to .mexXXX. Does this go out the
> window with Boost.Build, or can I still follow Jam documentation?

:-) This goes out the window. The only part in Jam documentation which is
relevant is language. For everything else, Boost.Build V2 are a better place.
See the link from http://boost.org/boost-build2

I think that your task can be solved as described in

http://boost.org/boost-build2/doc/html/bbv2.extender.html#bbv2.extender.intro

To be more specific, when I run "bjam -n" on the attached project, I get this
output:

mex -Ifoo -o bin/gcc/debug/a.mex a.cpp

I think this can be a start, and you can improve the "mex.jam" module
according to your needs. Of course, should you have further questions or
problems, please ask.

- Volodya

 --Boundary-00=_MhYOBPGJ4SQtZsA Content-Type: application/x-zip;
name="mex.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="mex.zip"

[Attachment content not displayed.] --Boundary-00=_MhYOBPGJ4SQtZsA--


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