Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Mata compatibility problem

From   Sergiy Radyakin <>
To   "" <>
Subject   st: Mata compatibility problem
Date   Wed, 19 Feb 2014 18:43:18 -0500

Mata compiler integrated into Stata is moving forwards as new versions
of Stata come out. Newer versions of Stata can't compile mata code
that can subsequently used by OLDER versions of Stata. This is a
well-known fact, documented e.g. by Nick Cox here:
and by Bill Gould earlier here:

Specifically, quote: "modern Stata cannot be used to compile object
code for an old Stata".

The solution is, of course, to retain older Stata binaries to compile
the program in them. Stata is backwards compatible, so that newer
versions of Stata can run object-code (compiled Mata files) from
earlier versions. This follows from Gould's description: "Stata 10 can
read Stata 4 datasets, but not the other way around.  The same issues
apply to .mo files." and "Old code runs correctly on modern Statas.
The same applies for Mata.  You do not even have to recompile."

However, that is somewhat the problem I am experiencing. The mata code
library compiled with Stata 9.0.415.4 is not possible to -describe-
in any newer Statas that I tried, specifically 9.2, 10.0, 10.1, 12.0,
13.0 on different machines, the error message I am getting is:

. mata mata describe using lgeochart
.\lgeochart.mlib from a older version of Stata

However the code seems to run, when executed. Google search on the
exact text of the error message above didn't yield any hits at all.
Plus the mere presence of such an error message kind of goes against
the backwards compatibility logic. The library file was produced on
the local machine so this precludes possibility that the file got
corrupt during transfer, etc.

The questions are:
1) can anybody independently confirm the problem? Is it already documented?

The library file is ~temporarily~ available from here:

The problem does not happen if the library is recompiled (from the
same source) with Stata 9.2:
for detailed screenshots of test sequence see this page:

2) is there confidence that the code is executed CORRECTLY? I know it
runs, but is there any hidden compatibility problem, similar to -mata
describe using ...- ? (perhaps only StataCorp can answer this)

3) is this a compiler-related issue? (any code will exhibit the
problem) or code-related problem? (e.g. calling a particular function
present in 9.0, but not present in any subsequent versions, then which
functions are affected?)

4) is there any way to create an mlib-library in 9.0 that will be
described correctly in subsequent Stata versions? Perhaps I am missing
an option of some sort.. If that matters, each mata function in the
library has "version 9.0" as the first line of function body and
9.2-library is about 4kbytes heavier than 9.0.

Any advice is much appreciated.

Thank you very much, Sergiy Radyakin
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index