Bookmark and Share

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


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

st: [Working with MLIB files] Issues with Stata Compiler and earlier Stata versions


From   George Vega Yon <[email protected]>
To   [email protected]
Subject   st: [Working with MLIB files] Issues with Stata Compiler and earlier Stata versions
Date   Mon, 18 Mar 2013 17:42:43 -0300

Dear Stata Users,

I have the following problem: I'm writing a Stata module which uses
several MATA functions (routines) some of them generic, which is why
I've choose to distribuit it through .mlib files. The thing is that,
after building the .milb file using Stata 12.1 (where the module
works), trying it out in Stata 12.0 returns the following error:

. cnu_afili 65
(mt_cnu_2_1() in lcnu, compiled by Stata 12.1, is too new to be run by
this version of Stata and so was ignored)
                 <istmt>:  3499  mt_cnu_2_1() not found
r(3499);

At first I thought that "versioning" the functions would help, but
after adding "version 9.0" at the begining of all the mata functions,
Stata 12.0 keeps returning the same error. A example of a function is:

--------------------------------------------------------------------------------
real colvector mt_mejoramiento_tabla(
	real colvector qx,        // Valor Qx (Mortalidad)
	real colvector aa,        // Valor AA (Factor de mejoramiento)
	real scalar agno_qx,      // Agno de la tabla
	real scalar agno_actual,  // Agno de calculo
	real scalar edad          // Edad del individuo
	)
	{
	
	version 9.0
	
	real scalar difagnos
	
	difagnos = agno_actual - agno_qx

	return(qx :* (1 :- aa):^(difagnos :+ (1::rows(qx)) :- edad :-1))
}

...

mata mlib create lcnu, replace
mata mlib add lcnu *()
--------------------------------------------------------------------------------

Am I doing something wrong here? If everything is Ok, what suggestions
do you have? I'm hoping to share this through SSC

Thanks!

George Vega Yon
7 647 2552
http://cl.linkedin.com/in/georgevegayon
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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