Run an executable file (.exe) from matlab in a linux enviroment
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Run an executable file (.exe) from matlab in a linux enviroment
I have a computer with Windows and I am running a Matlab program remotely in a Linux server.
That (matlab) program will use an executable file (.exe) to analize some data; and that data will be used as input to a program that I can only run in the linux server.
What do I need?
I need to run an executable file (.exe) from matlab in a linux enviroment. Is this possible?
I have a computer with Windows and I am running a Matlab program remotely in a Linux server.
That (matlab) program will use an executable file (.exe) to analize some data; and that data will be used as input to a program that I can only run in the linux server.
What do I need?
I need to run an executable file (.exe) from matlab in a linux enviroment. Is this possible?
I need to run an executable file (.exe) from matlab in a linux enviroment. Is this possible?
That is likely very easy with wine.
Install wine using the package manager of your Linux distribution.
Then in a script or a console window (and in correct directory) just type
Code:
wine program.exe parameters for program
Some programs require a bit more configuration than that to work in wine. Others are as simple as I just described.
Some Matlab based programs that I have put in scripts benefit from a Matlab command line option that turns off GUI support (I forget details, it was long ago). Use of wine is generally easier for non GUI programs (though certainly possible for GUI as well). It sounds like you are also doing a data processing (basically non GUI) activity that might benefit from having the Matlab code know that GUI is not intended.
All such things that I have done with Matlab based programs still pull a Matlab license per run from our site license server. So I have always used Windows Matlab only on Windows and used only Linux Matlab on Linux. I assumed (without testing) that license issues would get in the way of my kind of use of Matlab if I tried Windows Matlab via wine.
I assume your claim that the specific .exe you want to run is "non-commercial" means it is some kind of legitimately redistributable .exe built from something involving Matlab. If instead you are trying to bypass license restrictions, I don't think anything I've said here would be helpful and I certainly didn't intend it to be (helpful for bypassing a license).
Wine might but you said that this is on a server .So can you even install wine to run the MS windows program on linux ?
if you can and that *.exe will run - -EXPECT to take a very big hit in speed
i have one windows program that
-- on windows takes 5 min. to run
-- on linux in wine 1.5 hours -- yes hours .
I have problems with my English. When I said that it is non-commercial, what i am trying to say is that you cannot buy this software at a store; i.e. someone in the university created this program, compiled it and gave me the .exe file. The .exe is an expert system that will be taking decisions based on the data retrieved from the program that is running on the Linux server. Both of them are connected to a computer that is storing the decisions and showing me the results. My job is to analyze those results, but I cant do that without putting all the parts together.
If I am going to use wine to run the .exe I need to run it from matlab; is this possible? how can I do it? How do I install wine with a terminal (that is all I have in the Linux server, matlab is running with no gui)
I am so sorry if I am making stupid questions, but this is my first time using Matlab/Linux and this is part of my undergraduate research.
I have problems with my English. When I said that it is non-commercial, what i am trying to say is that you cannot buy this software at a store; i.e. someone in the university created this program, compiled it and gave me the .exe file.
It doesn't matter the slightest bit whether a university student or a corporation compiled it. Also, you could have edited your original post instead of taking it off the zero-reply list and cluttering up the thread.
Quote:
Originally Posted by mca21138
If I am going to use wine to run the .exe I need to run it from matlab; is this possible? how can I do it? How do I install wine with a terminal (that is all I have in the Linux server, matlab is running with no gui)
If I understand correctly, you don't have the rights to install wine in the Linux system. Maybe it is already installed.
Try typing just wine at a command prompt. If wine is already installed, you get a usage message like this:
Code:
~> wine
Usage: wine PROGRAM [ARGUMENTS...] Run the specified program
wine --help Display this help and exit
wine --version Output version information and exit
If wine is not installed, you get an error message like this:
Code:
~> wine
-bash: wine: command not found
Quote:
Originally Posted by mca21138
The .exe is an expert system that will be taking decisions based on the data retrieved from the program that is running on the Linux server. Both of them are connected to a computer that is storing the decisions and showing me the results.
Where does Matlab fit in?
Quote:
If I am going to use wine to run the .exe I need to run it from matlab; is this possible?
If you know how to make Matlab run a program at all, then making it run that program via wine shouldn't change much.
I use Matlab, but I'm far from expert in it, so I can't give you specific advice regarding Matlab.
Just to make sure we are not still misunderstanding: You seem to be saying Matlab is installed on the Linux system and you are using Matlab in a non GUI mode on the Linux system. Is that correct?
This can be a bit difficult. I don't know how the pieces fit together, since I never used matlab myself. But, the basic principle is that, when running something under wine, you'll probably be getting the wine output, not the guest one. If the guest (matlab+your.exe) outputs something to stdout, the output will be mixed the the wine output, and the wine output is really big, and has no easily identifiable pattern that can be used to filter it.
So, the first question is; where will this exe put the output info? stdout or a file?
The second question is whether the combo wine+win matlab+your.exe will work reliably (or at all).
After that, we can start guessing the linux part of the thing.
So, the first question is; where will this exe put the output info? stdout or a file?
The second question is whether the combo wine+win matlab+your.exe will work reliably (or at all).
1. The output will be stored in an array @Matlab.
2. windows(random data)+matlab+my.exe work correctly, linux server(real data)+matlab+my.exe dont work. the tool for the data acquisition that is installed in linux is very expensive so I cant buy a license for windows.
I have always been a big fan of running MS Windows programs on Windows
mac on mac and linux on linux
so if you for some reason can not run matlab ( or the gpl'd math program "Octave") on a MS Windows computer
then have the system Admin running that Linux ( unknown distro , guessing RHEL4 or 5 ) install wine
matlab has a native linux version (i think it makes sense to use that). else, use wine.
edit:
Quote:
Originally Posted by mca21138
... When I said that it is non-commercial, what i am trying to say is that you cannot buy this software at a store; i.e. someone in the university created this program, compiled it and gave me the .exe file...
can you ask the person to compile it for linux or supply source code (that'll make it easier) ?
the more cumbersome way would be to dual boot your pc:
- run matlab in linux (or windows); reboot
- run the .exe in windows (if you can't get it to run in wine); reboot
- analyze the output in linux.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.