octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about compiling mex files


From: Kai Torben Ohlhus
Subject: Re: Question about compiling mex files
Date: Mon, 23 Jul 2018 11:13:15 +0200

On Wed, Jul 18, 2018 at 9:35 PM José Luis García Pallero <address@hidden> wrote:
Hello:

Which is the best way to tell the mex function to compile using
OpenMP? I have a mex function for Matlab and I can compile it for
Octave without problems using

mex -O3 myfunc.c

If I use

mex -O3 -fopenmp myfunc.c

I obtain no errors nor warnings and the mex function is generated, but
the code not runs in parallel as I can check using the htop utility.

How is the correct way to use OpenMP in mex files in Octave?

Thanks

--
*****************************************
José Luis García Pallero
address@hidden
(o<
/ / \
V_/_
Use Debian GNU/Linux and enjoy!
*****************************************


The tsa package by Alois Schloegl seems to make use of OpenMP. You can take a look at his Makefile [1] to see what he did.  Somehow "-lgomp" is linked, but I don't know the impact of it.  Additionally, if you run

   mex -v

you can get verbose information of what is done by Octave.

HTH,
Kai

[1] https://sourceforge.net/p/octave/tsa/ci/default/tree/src/Makefile 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]