[metapost] Trying to figure out MPLib

Shriramana Sharma samjnaa at gmail.com
Fri Aug 3 18:14:49 CEST 2012


On Fri, Aug 3, 2012 at 9:12 PM, Taco Hoekwater <taco at elvenkind.com> wrote:
>> So given your patch for the kpathsea problem, does this mean that I
>> can execute a program linked against the libmplib.a as it is produced
>> by compiling the tarball on a system which does not have TeX?
>
> Yes.

Very nice.

>> What
>> will happen if a label command is included in the command argument I
>> pass to mp_execute and the system doesn't have the least trace of TeX
>> on it?
>
> For a TeX label, nothing will happen.

A TeX label? I don't know what that is. I meant the labels that we
attach to points -- I suppose this is what you mean below:

> For an actually typeset metapost
> string, you will get an error in the 'terminal' and 'log' outputs
> because the font and its support files will not be present. These
> are not fatal errors, so perhaps it does not bother you.

Yes, and especially since for my purpose I am not going to be using
labels anyway. My question was just out of curiosity.

>> And pardon me if I missed this somewhere, but does the source-tree as
>> it is distributed even have a *build*-dependency on any
>> TeX-components?
>
> It is set out not to need a pre-existing installation of any kind of
> TeX/MP, but it is vaguely possible that something crept in because
> my system is littered with TeX and mp installations and at times it
> is amazingly hard to keep autoconf 'localized'.

So I then had the idea of trying to build the tree on a VirtualBox
installation of Kubuntu Oneiric 32bit (my main running version is
Precise 64bit) which does not have any tex or such on it, and I had no
problems building. Of course, executing the thereby-produced mpost
executable threw errors:

<quote>
warning: kpathsea: configuration file texmf.cnf not found in these
directories: /home/shriramana/sr/metapost-1.212/build/texk/web2c:/home/shriramana/sr/metapost-1.212/build/texk:/home/shriramana/sr/metapost-1.212/build:/home/shriramana/sr/metapost-1.212/build/texk/web2c/share/texmf-local/web2c:/home/shriramana/sr/metapost-1.212/build/texk/share/texmf-local/web2c:/home/shriramana/sr/metapost-1.212/build/share/texmf-local/web2c:/home/shriramana/sr/metapost-1.212/build/texk/web2c/texmf-local/web2c:/home/shriramana/sr/metapost-1.212/build/texk/texmf-local/web2c:/home/shriramana/sr/metapost-1.212/build/texmf-local/web2c:/home/shriramana/sr/metapost-1.212/build/texk/w(Starting
toeb2c/share/texmf/web2c:/home/shriramana/sr/metapost-1.212/build/texk/share/texmf/web2c:/home/shriramana/sr/metapost-1.212/build/share/texmf/web2c:/home/shriramana/sr/metapost-1.212/build/texk/web2c/texmf/web2c:/home/shriramana/sr/metapost-1.212/build/texk/texmf/web2c:/home/shriramana/sr/metapost-1.212/build/texmf/web2c.

kpathsea: Running mktexfmt mpost.mem
mktexfmt: No such file or directory

Sorry, I can't find the 'mpost' mem file; will try 'plain'.
kpathsea: Running mktexfmt plain.mem
mktexfmt: No such file or directory

I can't find the 'plain' mem file!
</quote>

But that is perhaps only to be expected as it is looking for a TeX
installation...

I tried compiling my test.c on that 32 bit virtual machine
installation by copying the libmplib.a and libkpathsea.a from that
32-bit build tree and it worked identical on that system without TeX
to my 64 bit system with TeX. Very nice.

> That's tricky; the build system is set up to create only a static
> library at the moment, and it would require some autoconf jiggling
> to switch to allowing .so creation as well. If that is important to
> you, I can investigate, but that will take me some time.

OK -- for now I'll use the static lib.

-- 
Shriramana Sharma



More information about the metapost mailing list