Boost logo

Boost-Build :

From: Ian Fasel (ianfasel_at_[hidden])
Date: 2004-09-09 17:47:51

Vladimir, thanks for the help!

I have something working now, however I have one more
question about this.

Unfortunately it is a requirement of the tool that it
will always add a platform-specific extension to the
output filename. Matlab also stores include files and
libaries in a directory whose path can be determined
by the platform, e.g., $MATLABPATH/mac-includes or
$MATLABPATH/hpux-includes, etc.

So right now, at the top of my mex.jam file, the user
would have to change the value of a variable befoore
building, i.e.,

# Change to glnx if using linux, hpux if HP-UX, etc.
MEXEXTEN = mac ;
# MEXEXTEN = glnx ;

Then I use this variable throughout the mex.jam file.
Since I know what the extension should be given the
platform, is there any way for this to be determined

I have a similar question about setting a variable
based on the output of a command-line tool
(specifically, xml-config), but I'll put it in a
separate post.


--- Vladimir Prus <ghost_at_[hidden]> wrote:

> 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
> > Which would produce
> > myfile.mexglx on linux,
> > myfile.mexmac on mac,
> > myfile.mexhpux on hpux, etc.
> >
> > A more complex example would be like:
> > mex -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
> I think that your task can be solved as described in
> 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

> ATTACHMENT part 2 application/x-zip

Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at