[Pkg-octave-devel] Bug#631831: Bug#631831: Bug#631831: build octave with --enable-openmp
Alois Schloegl
alois.schloegl at ist.ac.at
Thu Jun 30 06:32:25 UTC 2011
On 06/30/11 04:11, Jordi Gutiérrez Hermoso wrote:
> On 29 June 2011 18:54,<schloegl at ist.ac.at> wrote:
>>> On Tue, Jun 28, 2011 at 09:03:32AM +0200, Alois Schloegl wrote:
>>>> adding -lgomp to mkoctfile call does not do it. And I've not found
>>>> any another option to enable openmp at this stage.
>>>
>>> Did you pass -fopenmp to the compiler?
>>>
>>> Thomas
>>>
>>
>>
>> I tried, but mkoctfile does not accept -fopenmp
>>
>> $ mkoctfile --mex -fopenmp covm_mex.cpp -lz -lgomp
>> mkoctfile: unrecognized argument -fopenmp
>
> Pass it as an environment variable:
>
> CXXFLAGS="-O2 -fopenmp" mkoctifle --mex covm_mex.cpp -lz -lgomp
>
> Does that work?
Jordi,
thanks for the hint. I tried this too, as well as
CFLAGS="-g -O2 -pthread -fopenmp" mkoctfile-3.2.4 --mex covm_mex.cpp
-lz -lgomp
CXXFLAGS="-g -O2 -pthread -fopenmp" mkoctfile-3.2.4 --mex covm_mex.cpp
-lz -lgomp
In none of these case, more than one CPU core was used. The ratio
between cputime() and wall time toc() was always close to 1, and also
top showed only 100 % cpu usage at most; with openmp enabled, I saw up
to 1200% at the 12 core machine.
Alois
More information about the Pkg-octave-devel
mailing list