MATLAB-C program including mex files compilation in Octave

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

MATLAB-C program including mex files compilation in Octave

Priyanka Akavaram
Hello,

I am a new octave user. I have been trying to execute a MATLAB - C program which included mex files in OCTAVE. The program is about retrieving the data from hardware. But I am unable to execute it. I went through the online resources from GNU and a few other forums and came to know that in octave we require a 'mkoctfile'. Is this correct? If so, how should I add this to my existing .c file and how should I execute this?  
Does this require any packages or conversion of files? 
Is there any other way other than using 'mkoctfile'?

Please help me with this. so that I can proceed further. 

Thanks and regards,
Priyanka Akavaram. 


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: MATLAB-C program including mex files compilation in Octave

siko1056
Priyanka Akavaram wrote

> Hello,
>
> I am a new octave user. I have been trying to execute a MATLAB - C program
> which included mex files in OCTAVE. The program is about retrieving the
> data from hardware. But I am unable to execute it. I went through the
> online resources from GNU and a few other forums and came to know that in
> octave we require a 'mkoctfile'. Is this correct? If so, how should I add
> this to my existing .c file and how should I execute this?
> Does this require any packages or conversion of files?
> Is there any other way other than using 'mkoctfile'?
>
> Please help me with this. so that I can proceed further.
>
> Thanks and regards,
> Priyanka Akavaram.

Dear Priyanka Akavaram,

From a "standard" Octave installation you can call both `mkoctfile` and
`mex` directly from the command line. `mex` is nothing more than a script to
properly call `mkoctfile` for mex-files in a Matlab compatible way and
`mkoctfile` is a program, that properly calls your system's compiler.

Assuming you are using Linux, some distributions like Ubuntu and many more
split Octave into several packages, that are not all installed by default.
In case you are using Debian or Ubuntu you have to install `liboctave-dev`
to get this feature [1].

Please tell us which operating system and method of Octave installation you
chose, then we are able to help you.

Best,
Kai

[1] https://packages.ubuntu.com/artful/liboctave-dev



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: MATLAB-C program including mex files compilation in Octave

roland65
In reply to this post by Priyanka Akavaram
Priyanka Akavaram wrote
> I have been trying to execute a MATLAB - C program

Hi,

you can't execute a mex file that was compiled for MATLAB. You need to
recompile it from source in Octave using the mex command.





--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: MATLAB-C program including mex files compilation in Octave

Andreas Weber-6
In reply to this post by Priyanka Akavaram
Am 16.11.2017 um 20:59 schrieb Priyanka Akavaram:
> I am a new octave user. I have been trying to execute a MATLAB - C
> program which included mex files in OCTAVE. The program is about

So you only have the compile mex file and not the source for it? If you
have the source you can compile it using mkoctfile as Kai explained.

If you only have the compiled mex, things get complicated. Here
https://hgomersall.wordpress.com/2013/02/19/squishing-matlab-mex-files-into-octave/

someone was able to run a mex file in GNU Octave.

I know there was a discussion on the help mailinglist in 2013 if this is
a GPL violation or now and RMS (sic!) was involved and as far as I
remember his interpretation was that it's okay to let users run a
proprietary binary file.

Hope this helps, Andy

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: MATLAB-C program including mex files compilation in Octave

Priyanka Akavaram
Dear  Andy,

Thank you for answering my query, i really appreciate it! Will try this once again.

Wishing you a great weekend :)

Regards,
Priyanka.


On 2 Dec 2017 3:08 p.m., "Andreas Weber" <[hidden email]> wrote:
Am 16.11.2017 um 20:59 schrieb Priyanka Akavaram:
> I am a new octave user. I have been trying to execute a MATLAB - C
> program which included mex files in OCTAVE. The program is about

So you only have the compile mex file and not the source for it? If you
have the source you can compile it using mkoctfile as Kai explained.

If you only have the compiled mex, things get complicated. Here
https://hgomersall.wordpress.com/2013/02/19/squishing-matlab-mex-files-into-octave/

someone was able to run a mex file in GNU Octave.

I know there was a discussion on the help mailinglist in 2013 if this is
a GPL violation or now and RMS (sic!) was involved and as far as I
remember his interpretation was that it's okay to let users run a
proprietary binary file.

Hope this helps, Andy


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave