[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
OpenMP in oct files
From: |
Daniel Kraft |
Subject: |
OpenMP in oct files |
Date: |
Fri, 20 Sep 2013 13:15:05 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 |
Hi,
I'm trying to use OpenMP from C++ which is compiled into an oct-file. I use
CXXFLAGS=-fopenmp mkoctfile ...
to compile with OpenMP enabled. However, when I then try to run the
function, I get the error
undefined symbol: GOMP_parallel_start
because libgomp is not loaded appropriately. Is it possible to instruct
Octave or mkoctfile somehow to load this library, so that OpenMP can be
used from within oct-files? I also tried linking statically by
specifying libgomp.a directly as object, but this complains that
libgomp.a (which is supplied by my GNU/Linux distro) is not compiled
with -fPIC.
Note that there are already some threads I found on the mailing list
archives ([1], [2] and [3]), but they don't solve my problem. [1]
discusses only how to pass -fopenmp to the compiler (which works fine
with CXXFLAGS), [2] seems to get a different error, and while [3]
suggests that a solution may be found with the nurbs package, this also
doesn't solve my problem. I looked at the code and while it uses OpenMP
pragmas, OpenMP is not enabled by the default Makefile. If I change the
Makefile to actually enable OpenMP and then try to call bspeval, the
exactly same error occurrs that I'm getting. (But note that I did
"make" from the src folder of the nurbs package file, which is probably
not exactly how those packages are meant to be installed. If I did
something wrong here and in the correct version it uses OpenMP
successfully, please point me to what exactly needs to be done to do that.)
[1]
http://octave.1599824.n4.nabble.com/mkoctfile-and-OpenMP-td4561550.html
[2]
http://octave.1599824.n4.nabble.com/How-to-employ-openMP-in-octave-td1630427.html
[3]
http://octave.1599824.n4.nabble.com/Using-OpenMP-in-oct-files-td4488760.html#a4489620
Thanks a lot! BTW, I compiled Octave from source -- if it is not
possible to fix my problem in an easy way, would it help to specify
-lgomp or even -fopenmp when building Octave itself?
Yours,
Daniel
--
http://www.domob.eu/
--
Done: Arc-Bar-Cav-Hea-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Mon-Pri
- OpenMP in oct files,
Daniel Kraft <=