LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 02-13-2016, 02:14 PM   #1
tjleah
LQ Newbie
 
Registered: Feb 2016
Posts: 2

Rep: Reputation: Disabled
./myexecutable runs in cmdline, but not through MatLab unix() or system()


Hello,

I am attempting to use MatLab to run myexecutable.exe in Ubuntu 14.04.3.

The executable runs in the command line just fine, in other words:
./myexecutable.exe < inputfile in the cmdline runs and gives the desired output

However, if I attempt to use MatLab to run this command:

[status,cmdout] = unix('./myexecutable.exe < inputfile'), I get the following error:

/bin/bash: ./myexecutable.exe: No such file or directory

I have tried:
-Doing this command by specifying the entire file path of the executable as well as the input file
-adding a unix('cd /home/my/executable/file/path') to the Matlab file before the command to run the .exe
-setting all permissions to the executable and input file to 777
-checking that MatLab recognizes both the .exe and the input file exist using: unix('file myexecutable.exe'), unix('file inputfile'), which returns the output indicating that MatLab knows the files are there (such as the output 'ELF 32-bit LSB executable') for the .exe
-checking ldd on the .exe to make sure all libraries are properly linked, which they are

I still get the 'No such file or directory' error. Does anyone have any thoughts?
 
Old 02-13-2016, 04:57 PM   #2
JeremyBoden
Member
 
Registered: Nov 2011
Posts: 938

Rep: Reputation: 174Reputation: 174
It is virtually certain that myexecutable.exe is a Windows program.
You can't expect Linux to run a Windows program.
Note:- appending .exe to a Linux executable file is unnecessary and almost never done.
Because it is confusing.

Running a Linux executable with a full path specification should work - unless there are embedded spaces
or other special characters present; if so, enclose the path in "/this is/a path/file-name" characters.

Last edited by JeremyBoden; 02-13-2016 at 04:59 PM.
 
Old 02-13-2016, 05:06 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,818

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
myexecutable.exe
is a MICROSOFT binary

you need to run in on a Microsoft Operating system

.exe files ARE NOT "matlab binary" files
those are .mex files
and Octave on linux can not run *.mex files

i use Octave to rum my *.m files all the time

mind you a ".m" is different than a ".mex"
 
Old 02-13-2016, 06:00 PM   #4
tjleah
LQ Newbie
 
Registered: Feb 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
I am able to run the .exe directly through the Ubuntu command line just fine. It does run on Ubuntu. It is configured for linux systems (I've used another version of this .exe on a Mac in the past, as well as on other linux servers, with no problems). It is just running it through MatLab on this Ubuntu server that is creating the issue.

The path to the file has no special characters. I have definitely been able to run this same .exe on the command line and through MatLab (it is called within a .m file with the command [status,cmdout] = unix('./myexecutable.exe < inputfile')) on other Linux servers. Is there a different process that needs to be taken with this version of Ubuntu?
 
Old 02-13-2016, 11:37 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,818

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
then you must be running the Microsoft Windows "exe" through WINE

*.exe's are for the windows operating system


but if this is NOT a MS windows "program" ( like "notepad.exe") but a binary data file ( like a raw image or a CSV or a *.dat )
it is just input to matlab

you did pay a huge amount of cash for matlab

have you contacted MathWorks ?
http://www.mathworks.com/support/?s_...&nocookie=true



Quote:
unix('./myexecutable.exe < inputfile'))
you might want to use the FULL $PATH and not relative path
Code:
unix('/usr/some/folder/someplace/myexecutable.exe < inputfile'))

Last edited by John VV; 02-13-2016 at 11:41 PM.
 
  


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
[SOLVED] Blender 2.63 only runs if I type /opt/blender/blender in cmdline Jeebizz Slackware 6 07-23-2013 06:00 PM
Fortran alternative to Matlab 'system' command mushi_aph Programming 4 06-08-2012 04:07 PM
Matlab Distributed Computing Server: Connecting to Matlab client fails OEP Linux - Server 0 12-21-2009 03:18 PM
LXer: Unix - System VI Release Notes - More Linux and Unix Humor LXer Syndicated Linux News 0 12-06-2008 04:30 PM
Ever heard of a bike that runs on UNIX? fotoguy General 5 02-07-2005 05:18 PM


All times are GMT -5. The time now is 04:31 AM.

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