Statalist


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

Re: st: Mata version control


From   Partha Deb <[email protected]>
To   [email protected]
Subject   Re: st: Mata version control
Date   Sat, 14 Feb 2009 11:41:04 -0500

Hi Ben,

I do have access to Stata 9 on another machine so can compile there, but it is less convenient, hence my initial question. I am puzzled, however. -help [M-2] version- seems to suggest to me that it is possible to compile with an earlier Mata version.

"    In syntax 1, Stata's version command (see [P] version) sets the version
   before entering Mata.  This specifies both the compiler and library
   versions to be used.  Syntax 1 is recommended."

Perhaps I misunderstand this.

Best.

Partha




Ben Jann wrote:
As far as I know you have to use Stata 9 to compile a function, if you
want to use the function in Stata 9 (a Stata 9 compiled function,
however, will also work under Stata 10).

If you don't have Stata 9 then my suggestion would be to just include
the source code in an ado-file so that it compiles on the fly.

ben

On Fri, Feb 13, 2009 at 11:35 PM, Partha Deb <[email protected]> wrote:
Hi all,

I am trying to compile and save a Mata function as a .mo file.  I am using
Stata 10.1 but would like to compile and save the .mo file as a Stata 9.2
file.  My understanding is that this should be possible under version
control but I'm not succeeding.  Here are the essentials of the .do file I
use to create the function:

clear all
version 9.2
local mydir "."

mata:
void myfunc(
  string scalar lnL, string scalar G, ...)

{
define the function
}

mata mosave myfunc(), dir(`mydir') replace

end

This runs fine and saves a .mo function that I can use in Stata 10.1.  But
when I try to use it in Stata 9.2, I get the following error message:

(myfunc() in /home/pdeb/ado/plus/m/myfunc.mo, compiled by Stata 10.1,
is too new to be run by this version of Stata and so was ignored)

Your thoughts are most appreciated.

Cheers,

Partha


--
Partha Deb
Department of Economics
Hunter College
ph:  (212) 772-5435
fax: (212) 772-5398
http://urban.hunter.cuny.edu/~deb/

Emancipate yourselves from mental slavery
None but ourselves can free our minds.
       - Bob Marley


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

--
Partha Deb
Department of Economics
Hunter College
ph:  (212) 772-5435
fax: (212) 772-5398
http://urban.hunter.cuny.edu/~deb/

Emancipate yourselves from mental slavery
None but ourselves can free our minds.
	- Bob Marley


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index