.m file to executable file in linux to run in another linux machine - linux

Hi I am working in matlab linux. I want to convert my .m files to .exe or some executable file so that I can run it in another linux machine.I tried doing
mcc -m filename.m -o newfile
But it creates run_newfile.sh and newfile.o files. How do I sonvert this .sh file to .exe or how can I run this .sh file in other machine. please help
solved:
I solved the problem . I used
mcc -mv filename.m
command which creates a executable file and the I can run the executable file which has same name with the .m file as
./filename
in the shell . And also we need to check if the MCR is installed or not. if not we need to install the MCR. thanks for your reply.

You can run the created files on other linux machines by sh run_newfile.sh. You cannot create exe-files for windows machines on linux machines. For creating windows-executable Exe-Files you have to use a windows machine.

If you want to use MATLAB Compiler to produce Windows executables (.exe files), you must run it on a Windows machine. If you run it on a Linux machine it will produce outputs suitable for Linux, as you're seeing.
Your MATLAB license is cross-platform and you may install it multiple times, so you can install it on Windows as well as Linux (so long as you don't use more than two of the multiple installations simultaneously).
If you don't have the install files for Windows, than so long as your license is in maintenance you can download them by logging in to your MathWorks account.

Related

How to run Qtcreator from terminal in Ubuntu?

Hi I have QtInstalled with the official qt installer (I haven't used the package with the name "qtcreator").
I need to run QtCreator from terminal but I can't locate the executable.
I'm using Ubuntu 16.04.
Probably you can find the executable in opt directory the location will be as this /opt/Qt/Tools/QtCreator/bin and you can run it through terminal as ./qtcreator
Latest QtCreator should by default be installed in
${HOME}/Qt/Tools/QtCreator/bin/
And you have two start-up options, the executable qtcreator or the shell script qtcreator.sh
To run the executable, type
~/Qt/Tools/QtCreator/bin/qtcreator
To run the shell script, type
~/Qt/Tools/QtCreator/bin/qtcreator.sh
Whic one to use: From the top portion of qtcreator.sh, it states that if you have library name conflicts (such as having same library names used by qtcreator with your own LD_LIBRARY_PATH), you may want to start with the shell script, rather than the bare executable.
Windows linux subsystem users
In case you have ubuntu as a subsystem for win10, it's located in your AppData folder (installing with sudo apt install command):
Also, you cannot run qtcreator from terminal as graphical interface is not supported by defeault. You need to instal X-server app first (https://sourceforge.net/projects/xming/) and then you can run QT from terminal.
C:\Users\[YOUR_USERNAME]\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\share\qtcreator
Or, it's in usr/lintian/overrides
But you should not modify anything inside this linux root, as it may lead to data loss.
For me it wasn't in the /opt directory, but rather the location I've chosen in the /home/user/ directory.
More specifically: /home/user/Qt5.12.1/Tools/QtCreator/bin/qtcreator

Linux executable on cygwin terminal [duplicate]

This question already has answers here:
Executable file generated using GCC under cygwin
(5 answers)
Closed 7 years ago.
Let me tell you my problem. I've a shell script which execute a Linux executable. I don't have access to the source code of this exe.
When I run the script on the Linux machine, there is no problem.
But, if I try to run the script on my Windows laptop, using cygwin, I have the error "cannot execute binary file".
There is any solution ?
Thanks !
From https://stackoverflow.com/a/4144536/5704102:
"... Cygwin is a compatibility layer, which aims to implement as much as possible of the POSIX and Linux APIs within Windows. This means that programs have to be compiled specifically for Cygwin ..."
What does this script look like? Is it a bash script? If so, you may want to try sh <scriptfile> in Cygwin. If this doesn't work, and it is a bash script, make sure you have sh.exe. Type sh and hit tab twice to check.
Another potential issue if it is a bash script is that you don't have something installed that Cygwin requires to run the script. Make sure all the commands the script is trying to run will work. If not, you may have to run the Cygwin installer and install whatever is needed to run the script.
Also, you may want to check permissions.
If the file has an exe extension, it SHOULD work on Windows unless it was compiled for 64 bit architecture and you're running a 32 bit OS. Otherwise, you could be missing some .dll files that the executable relies on.
Edit:
If this is the contents of your script:
echo START
/oper/file.exe
then it's likely you have the incorrect path. Cygwin paths typically start with /cygdrive/c/ in Windows. Go to where the file exists and type pwd to get the correct path, then modify your script accordingly.
Content of Script.sh in oper folder :
echo START
/cygdrive/c/Users/jo/oper/file.exe
In Cygwin terminal (in the right folder):
sh Script.sh
(Path updated)

Can't use "." to execute files with cygwin

I recently installed Cygwin on Windows 8.1, it works great but I can't execute file using the dot, for example "./hello.ml". I'm using the Windows's command prompt.
When I try using it, it show me that "." is not reconized. How can I make it works ?
Thanks.
You need to use the cygwin terminal or powershell instead.
The command interpreter doesn't think that your files are executable because they aren't one of the types that are recognized as binary executables. In general, Windows would use file associations from the registry to make things happen when you try to run a file. The cygwin terminal follows the unix-like convention and knows that your scripts are ml files and they are executable by using the ml interpreter, most likely from a #! at the top of your file.

Running ffmpeg in Terminal Linux

I've downloaded and unzipped ffmpeg at custom directory in my Ubuntu linux. Now I want to run this ffmpeg using terminal like I run on windows using command prompt. But everytime it says "ffmpeg: command not found". My question is how can I run ffmpeg using terminal through extracted libraries
thanks
First you need to make sure the file has execute permissions... or just add it with chmod +x filename
Secondly either the executables must be on the path or you need to specify the path to the executable. What I mean by this is, under Windows if you are in a directory with an executable you can type in the executable name and it will work... this is not the case for Linux. If you are in the executable's directory you execute the command like this ./command. The dot means you are executing a file in the current directory

Installing Linux Library on Windows Using Mingw

I am attempting to install GTKExtra on windows. The package comes in a Tar.Gz and contains a Configure file. So its necessary to install the package using MinGw because the package is designed to be installed on Linux.
I have installed MinGW and MSYS. I have made sure that C:\MinGW\msys\1.0\etc\fstab contains the line C:\MinGW /mingw (plus an empty line below it).
My Problem: I still cant get windows run the Configure file. When I type in ./Configure into CMD I get the error '.' is not recognized as an internal or external command, operable program or batch file.
The steps I am taking are:
Open cmd.exe
Navigate to the folder that contains the configure file using cd C:/...
Type in ./configure (as per the instructions found in INSTALL. But this causes the error I described above
How can I run the configure file on windows? What have I done wrong?
You have to run the command in unix command prompt. For starting unix command prompt execute "msys.bat" in msys installation.

Resources