LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 06-22-2011, 03:55 PM   #1
mca21138
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Rep: Reputation: Disabled
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?
 
Old 06-22-2011, 03:56 PM   #2
mca21138
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Re:

The .exe is a non-commercial software

Quote:
Originally Posted by mca21138 View Post
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?
 
Old 06-22-2011, 06:44 PM   #3
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720
Quote:
Originally Posted by mca21138 View Post
The .exe is a non-commercial software
????????????????????????
 
Old 06-22-2011, 06:53 PM   #4
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
Quote:
Originally Posted by mca21138 View Post
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).

Last edited by johnsfine; 06-22-2011 at 07:04 PM.
 
Old 06-22-2011, 09:48 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,825

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
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 .
 
Old 06-22-2011, 11:49 PM   #6
mca21138
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
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.
 
Old 06-23-2011, 05:26 AM   #7
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720
Quote:
Originally Posted by mca21138 View Post
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 View Post
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)
Do you have root privileges on the server?

Does Matlab need to be installed for it to run?

Last edited by MTK358; 06-23-2011 at 07:38 AM.
 
Old 06-23-2011, 07:17 AM   #8
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
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 View Post
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?

Last edited by johnsfine; 06-23-2011 at 08:49 AM.
 
Old 06-23-2011, 07:47 AM   #9
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
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.
 
Old 06-23-2011, 08:22 AM   #10
mca21138
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by MTK358 View Post
It doesn't matter the slightest bit whether a university student or a corporation compiled it.
I just wanted to give you as much details as possible. sorry

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 MTK358 View Post
I dont know how to do that, as you can see this is my first question in this forum
Quote:
Originally Posted by MTK358 View Post
Do you have root privileges on the server?
No I dont.

Does Matlab need to be installed for it to run?
Quote:
Originally Posted by MTK358 View Post
Matlab is already installed in the server
 
Old 06-23-2011, 08:26 AM   #11
mca21138
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by johnsfine View Post
Where does Matlab fit in?
Matlab is calling all the programs, the expert system and the data acquisition tool; the analysis will be done in Matlab too.

Wine is not installed and I dont have root privileges.

Matlab is already installed on the server and I am running it from an terminal(putty)/QUOTE]
 
Old 06-23-2011, 08:32 AM   #12
mca21138
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by i92guboj View Post
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.
 
Old 06-23-2011, 03:23 PM   #13
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,825

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
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
 
Old 06-24-2011, 08:20 AM   #14
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,027

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
matlab has a native linux version (i think it makes sense to use that). else, use wine.


edit:
Quote:
Originally Posted by mca21138 View Post
... 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.

Last edited by schneidz; 06-24-2011 at 08:28 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to run exe file in linux RayNg Linux - Newbie 5 10-01-2010 01:45 PM
run windows exe file in Linux? shipon_97 Linux - Newbie 5 11-24-2008 10:42 PM
how to run DOS EXE file in Debian Linux RMLinux Linux - Newbie 4 08-17-2006 02:25 PM
can't run a .exe file on linux?? eye Red Hat 1 05-28-2004 02:19 AM


All times are GMT -5. The time now is 04:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration