2

I have been using MetaPost for more than twenty years. Recently I came across Asymptote which seems to be a glorious rationalisation and generalisation of the wonderful tool that is MetaPost. I really would like to migrate to Asymptote from MetaPost but I have a problem.

My current OS is Windows 10 Pro. Don't ask.

I downloaded the latest Asymptote for Windows, accepting all defaults, and all seemed well. Here is the result of asking the version.

miktex-asy version 2.67 [(C) 2004 Andy Hammerlindl, John C. Bowman, Tom Prince]

ENABLED OPTIONS:
WebGL    3D HTML rendering
OpenGL   3D OpenGL rendering
CURL     URL support

DISABLED OPTIONS:
GSL      GNU Scientific Library (special functions)
FFTW3    Fast Fourier transforms
XDR      external data representation (portable binary file format)
Readline interactive history and editing
Editline interactive editing (if Readline is unavailable)
Sigsegv  distinguish stack overflows from segmentation faults
GC       Boehm garbage collector

Directory C:\Program Files\Asymptote appears to have all the modules, including plain. However, typing 'asy -f PNG test' in a directory containing the classic test.asy resulted in 'cannot find module plain'.

Although this seemed unnecessary, I followed advice from the WEB and defined environment variable ASYMPTOTE_DIR to be C:\Program Files\Asymptote, and this was the result, which to this aged compiler-writer looks like a compilation error:

Welcome to miktex-asy version 2.67 (to view the manual, type help)
  real value(string s, int i) {return byteinv(hex(substr(s,2i+offset,2)));}
                                      ^
C:/Program Files/Asymptote/plain_pens.asy: 333.39: no matching variable 'byteinv'
  real[][][] S=_schur(a);
               ^
C:/Program Files/Asymptote/plain.asy: 312.16: no matching variable '_schur'
  pair[][][] S=_schur(a);
               ^
C:/Program Files/Asymptote/plain.asy: 326.16: no matching variable '_schur'
error: recursive loading of module 'plain'

Does anyone have any thoughts on what I might be doing wrong?

3
  • I was getting the same error. I updated MikTeX. Now, I have other console output: return transform(box(min(f),max(f)), L); C:\Program Files\MiKTeX/asymptote/plain_Label.asy: 650.5: runtime: or similar: pic.addBox(position,position,min(f),max(f)); pic.addBox(position,position,min(f),max(f)); And the figure is not displayed after the compilation or the PDF document is not created. Oct 14 at 12:33
  • And I had updated ghostscript too... Oct 14 at 12:42
  • 2
    I copied this request for help to the Asymptote community on SourceForge and John Bowman kindly pointed out the problem. MikTeX ships with a hopelessly out-of-date copy of asy.exe that is incompatible with the latest versions of Asymptote. Because of the order in which Windows searches for executable, it was finding this old version before it found the new one. One solution is to reorder the PATH paths so that Asymptote precedes MikTeX. I simply renamed asy.exe in the the bin directory of MikTeX. Problem solved. :) Oct 15 at 18:01

1 Answer 1

2

I copied this request for help to the Asymptote community on SourceForge and John Bowman kindly pointed out the problem. MikTeX ships with a hopelessly out-of-date copy of asy.exe that is incompatible with the latest versions of Asymptote. Because of the order in which Windows searches for executable, it was finding this old version before it found the new one. One solution is to reorder the PATH paths so that Asymptote precedes MikTeX. I simply renamed asy.exe in the the bin directory of MikTeX. Problem solved. :)

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.