Error message: Could not load plugin

Welcome to the forum for runmlwin users. Feel free to post your question about runmlwin here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Go to runmlwin: Running MLwiN from within Stata >> http://www.bristol.ac.uk/cmm/software/runmlwin/
gfrost
Posts: 6
Joined: Tue Oct 25, 2011 1:30 pm

Error message: Could not load plugin

Post by gfrost »

Hello,

I am new to MLwiN and -runmlwin-, and I am struggling to get -runmlwin- to work. I am using Stata/SE 11.2 and MLwiN 2.24, and have made sure that my version of -runmlwin- is up-to-date.

I am trying to run the examples that are found in the Stata help file for -runmlwin-. For the first example, I enter:

Code: Select all

. use http://www.bristol.ac.uk/cmm/media/runmlwin/tutorial, clear
. runmlwin normexam cons standlrt, level2(school: cons) level1(student: cons) mlwinpath(C:\Program Files\MLwiN v2.24\MLwiN.exe)
But I get the following error message when I enter the second line:

Could not load plugin: c:\ado\plus\r\runmlwin_getversion.plugin
<2 invalid name
r(198);

I have no idea what this error message means, as the plugin it is trying to load is saved in the location it says. I would be greteful for any help you can offer on this.

Many thanks,

Gillian
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: Error message: Could not load plugin

Post by ChrisCharlton »

This message is a little puzzling. Could you try the following and let us know the results:

1) Make sure that the file has downloaded correctly. To do first run the following Stata command:

Code: Select all

checksum "c:\ado\plus\r\runmlwin_getversion.plugin"
Assuming that you're running on a 32-bit system, if the file is okay it will have a checksum of 2496528660 and a size of 8192.

2) If the checksum and size are correct the second Stata command to try running is:

Code: Select all

program getversion, plugin using("c:\ado\plus\r\runmlwin_getversion.plugin")
If this completes without error then Stata is able to load the plugin. You can then unload the plugin with:

Code: Select all

program drop getversion
3) If the above two work then you can test that the plugin is working with:

Code: Select all

runmlwin_verinfo C:\Program Files\MLwiN v2.24\MLwiN.exe
If a version number is reported then the plugin is working.
gfrost
Posts: 6
Joined: Tue Oct 25, 2011 1:30 pm

Re: Error message: Could not load plugin

Post by gfrost »

Hello Chris,

Thank you for your reply. Step 1 completes OK, but I fail at step 2. On entering

Code: Select all

checksum "c:\ado\plus\r\runmlwin_getversion.plugin"
I get the error message
Could not load plugin: c:\ado\plus\r\runmlwin_getversion.plugin
r(9999);
Any ideas?

Many thanks,

Gillian
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: Error message: Could not load plugin

Post by ChrisCharlton »

I am still not sure what is causing this as we have run this on a similar setup without issues.

It possible that it can't find the correct C runtime library. We should be using the one that comes with Stata, however if not you could install this from http://www.microsoft.com/download/en/de ... px?id=5582.

As a workaround you could remove the MLwiN version check, although it's possible that if you have problems with this plugin that the others may have issues too. To do this search for the following code in runmlwin.ado and remove/comment it out:

Code: Select all

	if "`mlwinpath'" ~= "" {
		capture confirm file "`mlwinpath'"
		if _rc == 601 {
			display as error "`mlwinpath' does not exist." _n
			exit 198
		}
		local versionok = 1
		quietly capture runmlwin_verinfo `mlwinpath'
		if _rc == 198 {
			display as error "`mlwinpath' is not a valid version of MLwiN"
			exit 198
		}
		if (`r(ver1)' < 2) | (`r(ver1)' == 2 & `r(ver2)' < 24) {
			local versionok = 0
		}
		if `versionok' == 0 {
			display as error "runmlwin requires MLwiN version 2.24 or higher. You can download the latest version of MLwiN at: http://www.bristol.ac.uk/cmm/software/mlwin/download/upgrades.html"
			exit 198
		}
		local mlwinversion `r(ver1)'.`r(ver2)'
	}
gfrost
Posts: 6
Joined: Tue Oct 25, 2011 1:30 pm

Re: Error message: Could not load plugin

Post by gfrost »

Hi Chris,

Thank you for you continued help with this. I tried the workaround, but it looks like I am having issues with the other plugins as you thought I might. I now get the error message:
Could not load plugin: c:\ado\plus\r\runmlwin_quietshell.plugin
(error occurred while loading runmlwin_qshell.ado)
r(9999);
I haven't tried downloading the C library yet since I don't have admin rights on my machine. Could the lack of admin rights be affecting things?

Thanks,

Gillian
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: Error message: Could not load plugin

Post by ChrisCharlton »

You can work around this second plugin issue by replacing all references of runmlwin_quietshell with shell. This will however mean that runmlwin can't be run in Stata batch mode. The final plugin that might cause an issue is the MCMC diagnostics plugin. Unfortunately there is currently no workaround for this not working.

Several of the accounts that we have tested runmlwin with don't have admin rights, so that shouldn't be affecting things.
gfrost
Posts: 6
Joined: Tue Oct 25, 2011 1:30 pm

Re: Error message: Could not load plugin

Post by gfrost »

Hello Chris,

Thank you all of your help with this, I really appreciate it. I never use Stata in batch mode, so I am sure that this will not be an issue for me.

We are definitely getting closer to a solution. -runmlwin- now works to a point - it opens MLwiN, lets me run the model in MLwiN, and then closes MLwiN. However, when it closes MLwiN, I have an error message waiting for me in Stata. It says:
Could not load plugin: c:\ado\plus\r\runmlwin_getversion.plugin
(error occurred while loading runmlwin_verinfo.ado)
r(9999);
I have had a look in runmlwin do file, and there are two lines that use -runmlwin_verinfo- again:

Code: Select all

quietly runmlwin_verinfo $MLwiN_path // This may be inaccurate if the user changes version between estimation and display (or uses the plugin)
display as text "MLwiN `e(version)' multilevel model"
However, commenting out these two lines doesn't help. Is there somewhere else that uses the getversion plugin?

Many thanks,

Gillian
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: Error message: Could not load plugin

Post by ChrisCharlton »

That should be the only other place that plugin is used. Is it possible that you have forgotten to run the discard command after editing the ado file, to make Stata reload it with your changes?
gfrost
Posts: 6
Joined: Tue Oct 25, 2011 1:30 pm

Re: Error message: Could not load plugin

Post by gfrost »

Hi Chris,

That was it! I am not familiar with programming in Stata so I didn't know about the -discard- command.

Thank you so much for all of your help. We are upgrading to Stata 12 soon, so maybe -runmlwin- will work as expected then. But this workaround will definitely keep me going until then.

Does the potential problem I might have with the MCMC diagnostics plugin mean that I won't be able to run MCMC models from within Stata, or is it purely the diagnostics I will have issues with?

Thanks,

Gillian
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: Error message: Could not load plugin

Post by ChrisCharlton »

I'm glad that you have now managed to get it working to some degree.

The MCMC diagnostic plugin is also used when reporting the model results to calculate statistics such as the ESS from the parameter chains. There is a nodiagnostics option which prevents these from being calculated and instead uses the estimates as reported in MLwiN were available. We haven't used this option extensively so if you come across any issues when using it please let us know.
Post Reply