runmlwin and Linux?

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/
kaiarzheimer
Posts: 2
Joined: Sat Feb 04, 2012 6:30 pm

runmlwin and Linux?

Postby kaiarzheimer » Sat Feb 04, 2012 7:16 pm

Dear all, I'm thrilled by the the concept of runmlwin but seem to be stuck on the wrong side of the great OS divide.
I'm working with Stata 11.2 (MP4) under Ubuntu Linux. I am able to launch MLwiN 2.24 manually using wine 1.3, but I cannot even install runmlwin from within Stata because the package does not contain a plugin for Linux.

Are there any plans for a Linux plugin? Is the plugin strictly necessary to run mlwin? Does it make any sense to bypass the plugin check by trying to install runmlwin manually?

Any help/pointers/comments highly appreciated.
Best wishes,
Kai

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

Re: runmlwin and Linux?

Postby ChrisCharlton » Mon Feb 06, 2012 10:27 am

We have not had any reports of MLwiN working under Wine before, which is why we haven't created versions of the plugin for Linux or Mac. I would be very interested in hearing how well it runs in this environment.

If runmlwin is unable to find a particular plugin it should be able to fall back to either using an equivalent Stata built-in command, or by skipping the plugin call. The only plugin that is actually necessary is runmlwin_mcmcdiagnostics.plugin, which is used to calculate the diagnostic information if you choose to estimate your model using MCMC. I have attached a version of this for linux (compiled under Centos 5.7 64 bit), although as I don't have access to a Linux version of Stata I cannot test this.
Attachments
runmlwin_mcmcdiagnostics.zip
(14.57 KiB) Downloaded 134 times

kaiarzheimer
Posts: 2
Joined: Sat Feb 04, 2012 6:30 pm

Re: runmlwin and Linux?

Postby kaiarzheimer » Sat Feb 11, 2012 7:21 pm

Chris,
thanks for that, will test the plugin asap. I ran a couple of the models from the userguide using wine 1.3 and the latest version of MLwiN. So far, I haven't encountered any glitches.

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

Re: runmlwin and Linux?

Postby ChrisCharlton » Thu Feb 16, 2012 1:19 pm

Since your initial post we have done some testing and as a result have updated the FAQ on running MLwiN on non-Windows systems (http://www.bristol.ac.uk/cmm/software/mlwin/features/sysreq.html#unix).

Once we have a package that is confirmed to work we also intend to provide an FAQ on using runmlwin on these systems.

janna
Posts: 5
Joined: Thu Jun 03, 2010 5:53 pm

Re: runmlwin and Linux?

Postby janna » Fri Feb 06, 2015 5:35 pm

Dear Chris, dear all,

I am trying to setup Stata and runmlwin on my Macbook, having followed your instructions (http://www.bristol.ac.uk/cmm/software/m ... ysreq.html). I used the wine solution, and I am able to run MLwiN in wine from the terminal. However, I need to use Stata and the runmlwin package, so I created the sh.files as you suggested. Now, I don't know how to set up the runmlwin command in Stata (I installed the Stata for Mac-Version): when I specify the MLwin path as "mlwinpath("/Users/janna/.wine/drive_c/Program Files/MLwiN 2.32/i386/mlwin.exe")" Stata responds that the specified file does not exist.
Would I need to have Stata run in wine as well? The problem is, that I only have the installation disc for Stata, not an .exe or .msi.-file, so I do not know how to install Stata in wine...
Many thanks for any suggestions!
Best, Janna

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

Re: runmlwin and Linux?

Postby ChrisCharlton » Fri Feb 06, 2015 6:39 pm

If your scripts are set up identically to the ones on the page that you linked then you just need to set your mlwinpath to the script, i.e. mlwinpath("/Users/janna/.wine/drive_c/Program Files/MLwiN 2.32/i386/mlwin.sh").

If you don't need to use the graphical interface then you may also be interested that we will be releasing native Mac OS/Linux versions of mlnscript later this month.

janna
Posts: 5
Joined: Thu Jun 03, 2010 5:53 pm

Re: runmlwin and Linux?

Postby janna » Fri Feb 06, 2015 8:43 pm

Dear Chris,

many thanks for your quick response! Now, I specified the path within the runmlwin command as follows "mlwinpath(/mlwin/mlwin/i386/mlwin.sh)". When I run this, Stata responds: "The model did not run properly in MLwiN. You most likely clicked the 'Abort Macro'
> button in MLwiN, rather than the 'Resume Macro' button".

I still can open MLwiN from terminal either by typing "wine mlwin.exe" or by typing "sh mlwin.sh". However, when I use the os finder and tell it to open the mlwin.sh with terminal, I get the following error:

<Jannas-MBP:~ janna$ /mlwin/mlwin/i386/mlwin.sh ; exit;
<wine: cannot find L"C:\\windows\\system32\\mlwin.exe"

the mlwin.sh looks like this:
#!/bin/sh
wine mlwin.exe $@

(and I did the "chmod +x mlwin.sh), so I'm stuck here!

Most of the times I do not need the graphical interface, so a mac-version of mlnscript might help, though I cannot yet imagine how this will work, looking forward to learn more about it!
Thanks again,
best wishes,
Janna

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

Re: runmlwin and Linux?

Postby ChrisCharlton » Fri Feb 06, 2015 9:28 pm

This path is different from the one that you previously specified, can you run the following command from a terminal to confirm the full path to the mlwin.sh file?:

Code: Select all

which mlwin.sh


Can you also test whether you can call MLwiN directly with this command from within Stata?:

Code: Select all

shell /mlwin/mlwin/i386/mlwin.sh

janna
Posts: 5
Joined: Thu Jun 03, 2010 5:53 pm

Re: runmlwin and Linux?

Postby janna » Fri Feb 06, 2015 11:46 pm

Dear Chris,

yes, I changed the path: previously, the mlwin.exe and .sh were in the (hidden) wine-directory (/Users/janna/.wine/drive_c/Program Files/MLwiN 2.32/i386/), however, Stata was not able to access this path (I could not change into this directory), so I copied the whole MLwiN-Folder to a new, accessible folder (mlwin) on my HD.

This is what I get from terminal (which mlwin.sh does not reveal much...):

Code: Select all

Jannas-MBP:~ janna$ cd /mlwin/mlwin/i386/
Jannas-MBP:i386 janna$ pwd
/mlwin/mlwin/i386
Jannas-MBP:i386 janna$ which mlwin.sh
Jannas-MBP:i386 janna$ ls
COMDLG32.OCX      icuin32.dll      mlwin.sh
MSCOMCTL.OCX      icuuc32.dll      msvcp100.dll
MSHFLXGD.OCX      libblas.dll      msvcp71.dll
Macintosh HD      libgcc_s_dw2-1.dll   msvcr100.dll
Mscomct2.ocx      libgfortran-3.dll   msvcr71.dll
PEGRP32F.DLL      liblapack.dll      shapelib.dll
Pe3do32f.ocx      libquadmath-0.dll   spssio32.dll
Pesgo32f.ocx      mlnscript.exe      winmln6.dll
RICHTX32.OCX      mlnscript.sh      wszlib.dll
TABCTL32.OCX      mlwin.exe
icudt32.dll      mlwin.exe.manifest
Jannas-MBP:i386 janna$ which mlwin.sh
Jannas-MBP:i386 janna$


When I run the command "shell /mlwin/mlwin/i386/mlwin.sh" in Stata, I get the following:
"/mlwin/mlwin/i386/mlwin.sh: line 2: wine: command not found"

Note that I use the Mac-version of Stata - I tried to install it in wine but did not know how to deal with the installer package (there is no setup.exe or .msi file on the installation disc).

Thanks a lot, I really appreciate this!
Best, Janna

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

Re: runmlwin and Linux?

Postby ChrisCharlton » Sat Feb 07, 2015 12:00 pm

From the error message that you are getting it appears that the wine executable is not on the path when running through Stata. Could you try running:

Code: Select all

xshell /mlwin/mlwin/i386/mlwin.sh


from Stata so that it runs through an xterm (see http://www.stata.com/help.cgi?shell) where this might be set up?

If this doesn't work then you may need to modify the mlwin.sh file it include the full path to wine. You should be able to find where this is with the command:

Code: Select all

which wine


from a terminal.

Finally, I am not sure why you were unable to access the original directory from within Stata. Are you running Stata with a different user account to the one you ran the terminal from? Note that as the path contains a space you will need to put quotes around it if changing directory.


Return to “runmlwin user forum”

Who is online

Users browsing this forum: No registered users and 0 guests