Dear all, I'm using ConTeXt MkIV on Debian with the following version: ConTeXt ver: 2008.05.21 15:21 MKIV fmt: 2008.8.4 int: english/english Everything seems to work well (I am able to run lua code, use otf font facilities, etc...) but the mplib mechanism. Indeed, running through the following simple file : \starttext \startMPcode path p ; p := fullcircle scaled 4cm ; fill p withcolor red ; fill p shifted(2cm,0cm) withcolor blue ; \stopMPcode \stoptext provokes the following logging : mplib : loading format: metafun.mp, name: /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/formats/cont-en-metafun.mem mplib : version mismatch: mp_parent_version <> 2008.05.21 15:21 mplib : making format: metafun.mp, name: /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/formats/cont-en-metafun.mem mplib : loading format: metafun.mp, name: /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/formats/cont-en-metafun.mem report >> mp terminal: (/usr/share/texmf/metapost/context/base/mp-tool.mp ! Missing `=' has been inserted. <to be read again> , l.51 vardef mpversioncmp(expr s, c) = etc... The format metafun.mp is not good at first, but seems to be regenerated dynamically with success ? Is this a known issue ? Any hints on what's going on ? Olivier
On Mon, Sep 29, 2008 at 5:55 PM, Olivier
Dear all,
I'm using ConTeXt MkIV on Debian with the following version:
ConTeXt ver: 2008.05.21 15:21 MKIV fmt: 2008.8.4 int: english/english
Everything seems to work well (I am able to run lua code, use otf font facilities, etc...) but the mplib mechanism. Indeed, running through the following simple file :
\starttext \startMPcode path p ; p := fullcircle scaled 4cm ; fill p withcolor red ; fill p shifted(2cm,0cm) withcolor blue ; \stopMPcode \stoptext
I have prepended \setupcolors[state=start] BTW, no problems with MtxRun | current version: 2008.08.05 18:47 This is LuaTeX, Version snapshot-0.29.0-2008071816 and with beta MtxRun | current version: 2008.09.24 18:41 This is LuaTeX, Version snapshot-0.29.0-2008071816 -- luigi
Hi Luigi,
\starttext \startMPcode path p ; p := fullcircle scaled 4cm ; fill p withcolor red ; fill p shifted(2cm,0cm) withcolor blue ; \stopMPcode \stoptext
I have prepended \setupcolors[state=start]
This is indeed required to get the color but my problem is that the graphic do not get typeset at all! As can be seen from the log file report >> mp terminal: (/usr/share/texmf/metapost/context/base/mp-tool.mp ! Missing `=' has been inserted. <to be read again> , l.51 vardef mpversioncmp(expr s, c) = ! Missing `=' has been inserted. <to be read again> ) [...a long list of such errors omitted...] there is an issue with loading mp-tool.mp Could it be that something related to mplib is not package in Norbert Preining's packages? Is there a particular file that I should look for?
BTW, no problems with MtxRun | current version: 2008.08.05 18:47 This is LuaTeX, Version snapshot-0.29.0-2008071816
and with beta MtxRun | current version: 2008.09.24 18:41 This is LuaTeX, Version snapshot-0.29.0-2008071816
Thanks for the information, Olivier
On Mon, Sep 29, 2008 at 9:44 PM, Olivier
Hi Luigi,
\starttext \startMPcode path p ; p := fullcircle scaled 4cm ; fill p withcolor red ; fill p shifted(2cm,0cm) withcolor blue ; \stopMPcode \stoptext
I have prepended \setupcolors[state=start]
This is indeed required to get the color
yes, I didn't like greys circles...
but my problem is that the graphic do not get typeset at all! As can be seen from the log file
Just to be sure, in attachment my pdf I found really easy to install minimals under ubuntu (just download first-setup.sh), so I can have one sandbox of mkiv+luatex stable and one for beta . Why don't you give it a try ? (don't forget to update to latest luatex) -- luigi
Hi Luigi,
I found really easy to install minimals under ubuntu (just download first-setup.sh), so I can have one sandbox of mkiv+luatex stable and one for beta . Why don't you give it a try ? (don't forget to update to latest luatex)
I'm sure minimals are worth a try. But as I stated before, everything but the mplib is working fine + I like the packaging of Norbert Preining which is very well done and LuaTeX is getting updated very often + I packaged for Debian a lot of conTeXt style files and font setups for people in my group + using such official Debian packages gives them a chance to be improved and debugged which will benefit other people... Olivier
On Tue, Sep 30, 2008 at 10:54 AM, Olivier
Hi Luigi,
I found really easy to install minimals under ubuntu (just download first-setup.sh), so I can have one sandbox of mkiv+luatex stable and one for beta . Why don't you give it a try ? (don't forget to update to latest luatex)
I'm sure minimals are worth a try. But as I stated before, everything but the mplib is working fine + I like the packaging of Norbert Preining which is very well done and LuaTeX is getting updated very often + I packaged for Debian a lot of conTeXt style files and font setups for people in my group + using such official Debian packages gives them a chance to be improved and debugged which will benefit other people...
All ok, I didn't meant that you must switch to minimals . In Ubuntu I have put minimals under /opt/luatex/minimals (and minimals-beta in /opt/luatex/minimals-beta) . They are unrelated with package system, texlive2007, texlive2008 and so on ; also installing/updating minimals is easy (at least on ubuntu) apart luatex version (but it's not really a problem) . I run every tests under minimals and minimals-beta . If they work, I assume minimals / minimals-beta are OK . Your test works on my minimals, so (my) minimals are OK. So if you install minimals /minimals-beta you can even say what is wrong in your packaging (if something is wrong: maybe you have mixed files) . I feel good with ubuntu, but for TeX related stuff I prefear manual installation . I don't expect that anyone agree on this . -- luigi
Olivier: What system do you use? I am using MacOSX and in july this year I mailed about the error below:
mplib : making format: metafun.mp, name: /Users/hans/TeX/ luatex-cache/context/60e9a4b67d8fc84c21043806bb9e2fb8/formats/cont- en-metafun.mem mplib : loading format: metafun.mp, name: /Users/hans/TeX/ luatex-cache/context/60e9a4b67d8fc84c21043806bb9e2fb8/formats/cont- en-metafun.mem report >> mp terminal: (/usr/local/texlive/2007/texmf-context/ metapost/context/base/mp-tool.mp ! Missing `=' has been inserted. <to be read again> , l.51 vardef mpversioncmp(expr s, c) = ! Missing `=' has been inserted. <to be read again> ) l.55 vardef mpversionlt (expr s)
Sounds familiar? If you are also working on MacOSX(10.5.x) then I should expect the problem to be platform specific. I had some discussions with Taco Hoekwater about this problem, but we never solved it and I have no inkling of its cause. Since I am not well enough acquainted with the code behind mplib and friends, I had to fall back on using MKII and putting MKIV aside. But I guess the solution to this problem is pressing, since we cannot have one platform falling out on ConTeXt. Hans van der Meer On 29 sep 2008, at 17:55, Olivier wrote:
Dear all,
I'm using ConTeXt MkIV on Debian with the following version:
ConTeXt ver: 2008.05.21 15:21 MKIV fmt: 2008.8.4 int: english/ english
Everything seems to work well (I am able to run lua code, use otf font facilities, etc...) but the mplib mechanism. Indeed, running through the following simple file :
\starttext \startMPcode path p ; p := fullcircle scaled 4cm ; fill p withcolor red ; fill p shifted(2cm,0cm) withcolor blue ; \stopMPcode \stoptext
provokes the following logging :
mplib : loading format: metafun.mp, name: /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/ formats/cont-en-metafun.mem mplib : version mismatch: mp_parent_version <> 2008.05.21 15:21 mplib : making format: metafun.mp, name: /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/ formats/cont-en-metafun.mem mplib : loading format: metafun.mp, name: /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/ formats/cont-en-metafun.mem report >> mp terminal: (/usr/share/texmf/metapost/context/base/mp-tool.mp ! Missing `=' has been inserted. <to be read again> , l.51 vardef mpversioncmp(expr s, c) = etc...
The format metafun.mp is not good at first, but seems to be regenerated dynamically with success ?
Is this a known issue ? Any hints on what's going on ?
Olivier ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
Hi, To both of you: Hans van der Meer wrote:
/usr/local/texlive/2007/texmf-context/metapost/context/base/mp-tool.mp
Olivier wrote:
/usr/share/texmf/metapost/context/base/mp-tool.mp
Can you guys check if these are the correct versions of mp-tool.mp ? The problem could be as basal as mp finding older versions of the metafun files (from before the mkiv support). Best wishes, Taco (who assumes Olivier is on intel/amd, not powerpc)
Hi Taco,
Hans van der Meer wrote:
/usr/local/texlive/2007/texmf-context/metapost/context/base/mp-tool.mp
Olivier wrote:
/usr/share/texmf/metapost/context/base/mp-tool.mp
Can you guys check if these are the correct versions of mp-tool.mp ? The problem could be as basal as mp finding older versions of the metafun files (from before the mkiv support).
My mp-tool.mp file is the same as http://minimals.contextgarden.net/current/context/latest/metapost/context/ba... that is contains if not known mpversion : string mpversion ; mpversion := "0.641" ; fi ; and %D version=1998.02.15,
(who assumes Olivier is on intel/amd, not powerpc)
I'm indeed working on a Debian system with intel plateform. (But Hans' config is not that different : some sort of Unix with TeXlive distrib.) The texlive packages I'm using are those of Norbert Preining, last version. What is the executable that is triggered by a call to mplib? (I would like to check I have it installed, not only mpost.) Again, everything else in conTeXt works well (otf direct from file names, lua scripting, etc). Olivier
Olivier wrote:
What is the executable that is triggered by a call to mplib? (I would like to check I have it installed, not only mpost.)
There isn't one, it is all internal to luatex's executable. There are no external executables and no config files involved, and that is what makes these errors so weird (well, that and the fact that it only seems to happen to Hans and you). Confused, Taco
Hi Taco, Quoting "Taco Hoekwater" :
-- was taco@elvenkind.com on Sep 29, 2008 at 11:27:03 --
Olivier wrote:
What is the executable that is triggered by a call to mplib? (I would like to check I have it installed, not only mpost.)
There isn't one, it is all internal to luatex's executable.
There are no external executables and no config files involved,
So, I guess it would make sense to test the compiler directly: what is the most basic way to trigger mplib from a plain tex file directly run through LuaTeX (i.e. the equivalent of the startMPgraphic if any? (And this might provide some more information on what's going on.) Olivier
Olivier wrote:
So, I guess it would make sense to test the compiler directly: what is the most basic way to trigger mplib from a plain tex file directly run through LuaTeX (i.e. the equivalent of the startMPgraphic if any? (And this might provide some more information on what's going on.)
Just look at mlib-run.lua from the context distribution, it should be clear enough. Best wishes, Taco
Taco,
So, I guess it would make sense to test the compiler directly: what is the most basic way to trigger mplib from a plain tex file directly run through LuaTeX (i.e. the equivalent of the startMPgraphic if any? (And this might provide some more information on what's going on.)
Just look at mlib-run.lua from the context distribution, it should be clear enough.
Thanks for the pointer. I played a bit with pdfluatex directly which seems to work. (I'm not to the point of producing figures, because I would have to rebuild all the functions that are located in mlib-run.lua and the luatexref-t.tex does not give straightforward example of how the mplib module should be used, it only describes the functions API. Btw: could you add in the doc a simple example of how to set up an mplib instance (loading the format file) and typesetting a minimal graphic, and then use it from within plain TeX for instance; this is transparent to conTeXt users since there are files like mlib-run.lua but not easy for plain TeX users :P And I'm not advocating the use of plain TeX, I'm a converted conTeXt user since 2003, but this will help user understand (a bit) how things work behind the scene.) Thanks for your (and all the posters') interest, Olivier
Hi Olivier, Olivier wrote:
Btw: could you add in the doc a simple example of how to set up an mplib instance (loading the format file) and typesetting a minimal graphic, and then use it from within plain TeX for instance; this is transparent to conTeXt users since there are files like mlib-run.lua but not easy for plain TeX users :P
Running mplib is easy enough to document, but that is only a part of the work: you also have to convert the image to pdf literals, and that is more work than I would like to put in the manual. Anyway, attached is a bunch of definitions I stripped out of context that will allow you to run mplib in plain tex provided that you also have context installed (you need mlib-pdf.lua for the PDF conversion) Best wishes, Taco metapost = (metapost or {}) function metapost.report (a) print ("\n" .. a) end function metapost.finder (name, mode, ftype) return (mode=="w" and name) or kpse.find_file(name, ftype) end function metapost.make(name, target, finder) local status = 2 -- higher numbers are errors finder = (finder or metapost.finder) local mpx = mplib.new ( { hash_size = 100000, main_memory = 2000000, max_in_open = 50, param_size = 100000, ini_version = true, find_file = finder, job_name = target, } ) if mpx then local result = mpx:execute("input " .. name .. "; dump;") if result then status = result.status end mpx:finish() end if status < 2 then metapost.report('mp message: created mem file ' .. target ) else metapost.report('mp error: mem file generation failed') end end function metapost.load(name, finder) finder = (finder or metapost.finder) local memname = finder("mplib-" .. name,"r","mem") if not memname then memname = finder("mplib-" .. name, "w", "mem") metapost.make(name, memname, finder) end metapost.report('mp message: using mem file ' .. memname) local mpx = mplib.new ( { ini_version = false, mem_name = memname, find_file = finder, } ) if not mpx then metapost.report('mp error: mem loading failed') end return mpx end function metapost.process(mpx, data) local result if mpx and data then result = mpx:execute(data) -- todo: error message if not result then metapost.report("mp error: no result object returned") elseif result.status > 0 then metapost.report("mp error:" .. (result.term or "no-term") .. "\n" .. (result.error or "no-error")) end end return result end
Hi Taco,
Running mplib is easy enough to document, but that is only a part of the work: you also have to convert the image to pdf literals, and that is more work than I would like to put in the manual.
OK. It could be nice then to simply state this?
Anyway, attached is a bunch of definitions I stripped out of context that will allow you to run mplib in plain tex provided that you also have context installed (you need mlib-pdf.lua for the PDF conversion)
Thanks a lot for these. With these hints I am now able to compile metapost figs from conTeXt through "texexec --luatex" normaly. To this end, I had to perform two tweaks: * the files mlib-run.lua, mlib-ctx.lua, and mlib-pdf.lua were *NEVER* loaded so I added to my conTeXt source file: \directlua0 { dofile ("/usr/share/texmf/tex/context/base/mlib-ctx.lua") } \directlua0 { dofile ("/usr/share/texmf/tex/context/base/mlib-run.lua") } \directlua0 { dofile ("/usr/share/texmf/tex/context/base/mlib-pdf.lua") } * the format was generated correctly but loaded incorrectly: I had to add the following line: ini_version = false, in the metapost.load function in the mlib-run.lua file. Now everything is OK. The second thing (an misfortunate typo) is easy to fix. However, the fact that mlib-*.lua are never loaded is more worrying: any idea where this error comes from? Hope this will help Hans as well. Cheers, Olivier
Hi Olivier and Hans, Olivier wrote:
Thanks a lot for these. With these hints I am now able to compile metapost figs from conTeXt through "texexec --luatex" normaly. To this end, I had to perform two tweaks:
* the files mlib-run.lua, mlib-ctx.lua, and mlib-pdf.lua were *NEVER* loaded so I added to my conTeXt source file: \directlua0 { dofile ("/usr/share/texmf/tex/context/base/mlib-ctx.lua") } \directlua0 { dofile ("/usr/share/texmf/tex/context/base/mlib-run.lua") } \directlua0 { dofile ("/usr/share/texmf/tex/context/base/mlib-pdf.lua") }
Wouldn't that mean that $ luatools mlib-pdf.lua also fails to find the files? luatools --generate should be able to fix that.
* the format was generated correctly but loaded incorrectly: I had to add the following line: ini_version = false, in the metapost.load function in the mlib-run.lua file.
Now everything is OK. The second thing (an misfortunate typo) is easy to fix.
This should be fixable by simply updating your context, because that is already fixed in newer contexts. But this could well be the cause of Hans' problems. Best wishes, Taco
Taco,
Wouldn't that mean that
$ luatools mlib-pdf.lua
also fails to find the files? luatools --generate should be able to fix that.
Indeed "luatools mlib-pdf.lua" fails to find the file. However "luatools --generate" does not help. I'll investigate why.
This should be fixable by simply updating your context, because that is already fixed in newer contexts. But this could well be the cause of Hans' problems.
I would have think so :) Best, Olivier
Hi Taco, I did "kpsewhich mp-tool.mp" and it came up with "/usr/local/texlive/ 2007/texmf-context/metapost/context/base/mp-tool.mp". That file has in my system creation+modification date "01-04-08 02:14" and was last opened "03-07-08" so this must be it. Came straight from unpacking the context distribution zip. This should have been cont-tmf.zip created "05-08-08 17:13". The other mp-tool.mp in my system is /usr/local/texlive/2007/texmf- dist/metapost/context/base/mp-tool.mp. I also checked this one and found it has creation+modification date "06-02-08 12:52" and was last opened "06-02-08 12:52". So this one was apparently never used by me after installing texlive2007. I think this proves the file in my case is indeed the "01-04-08 02:14" one. Hans van der Meer On 29 sep 2008, at 22:10, Taco Hoekwater wrote:
Hi,
To both of you:
Hans van der Meer wrote:
/usr/local/texlive/2007/texmf-context/metapost/context/base/mp- tool.mp
Olivier wrote:
/usr/share/texmf/metapost/context/base/mp-tool.mp
Can you guys check if these are the correct versions of mp-tool.mp ? The problem could be as basal as mp finding older versions of the metafun files (from before the mkiv support).
Best wishes, Taco (who assumes Olivier is on intel/amd, not powerpc)
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
Am Mon, 29 Sep 2008 17:55:15 +0200 schrieb Olivier:
mplib : loading format: metafun.mp, name: /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/formats/cont-en-metafun.mem mplib : version mismatch: mp_parent_version <> 2008.05.21 15:21 mplib : making format: metafun.mp, name: /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/formats/cont-en-metafun.mem
The format metafun.mp is not good at first, but seems to be regenerated dynamically with success ?
Do you get still this regeneration message or has it disappeared? If not I would say the format generation was not successfull. -- Ulrike Fischer
Hi Ulrike, Quoting "Ulrike Fischer" :
-- was news2@nililand.de on Sep 30, 2008 at 11:27:08 --
Am Mon, 29 Sep 2008 17:55:15 +0200 schrieb Olivier:
mplib : loading format: metafun.mp, name: /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/formats/cont-en-metafun.mem mplib : version mismatch: mp_parent_version <> 2008.05.21 15:21 mplib : making format: metafun.mp, name: /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/formats/cont-en-metafun.mem
The format metafun.mp is not good at first, but seems to be regenerated dynamically with success ?
Do you get still this regeneration message or has it disappeared? If not I would say the format generation was not successfull.
Indeed, this format gets regenerated every time. Is there a way to genereate it separatly? Olivier
Am Tue, 30 Sep 2008 11:37:13 +0200 schrieb Olivier:
Do you get still this regeneration message or has it disappeared? If not I would say the format generation was not successfull.
Indeed, this format gets regenerated every time. Is there a way to genereate it separatly?
I don't know ;-(. I know up to nothing about context and metapost. But both you and Hans get this regeneration of the formats so I suspect it is the source of the problem. At least it is certainly not normal and one should always start with the first error. -- Ulrike Fischer
Ulrike Fischer wrote:
Am Tue, 30 Sep 2008 11:37:13 +0200 schrieb Olivier:
Do you get still this regeneration message or has it disappeared? If not I would say the format generation was not successfull. Indeed, this format gets regenerated every time. Is there a way to genereate it separatly?
I don't know ;-(. I know up to nothing about context and metapost. But both you and Hans get this regeneration of the formats so I suspect it is the source of the problem. At least it is certainly not normal and one should always start with the first error.
a new cont-en-metafun.mem gets generated when (1) it's not there (2) the context version changed (3) the metafun version changed mkiv does not use the metafun.mem file Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Ulrike Fischer wrote:
Am Mon, 29 Sep 2008 17:55:15 +0200 schrieb Olivier:
mplib : loading format: metafun.mp, name: /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/formats/cont-en-metafun.mem mplib : version mismatch: mp_parent_version <> 2008.05.21 15:21 mplib : making format: metafun.mp, name: /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/formats/cont-en-metafun.mem
The format metafun.mp is not good at first, but seems to be regenerated dynamically with success ?
Do you get still this regeneration message or has it disappeared? If not I would say the format generation was not successfull.
maybe a mismatch between the binary and context (maybe the log file in the cache formats paths tells more) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (6)
-
Hans Hagen
-
Hans van der Meer
-
luigi scarso
-
Olivier
-
Taco Hoekwater
-
Ulrike Fischer