On 2/3/2011 8:07 AM, Bob Friesenhahn wrote:
On Wed, 2 Feb 2011, Kishore Kumar Pusukuri wrote:
Hi, I have been compiling and running OpenMP parallel programs
successfully so far on my OpenSolaris.2009.10 machine. However I am
unable to run one program with more than one thread(lwp). Please see
details of the program below. Please let me know if there is anything
wrong with the compilation or running this particular program. I am
using the following command line arguments to run the program and I am
using g++-4.2.3 to compile the program with "-fopenmp" option and also
linked libmtsk.so.1. There are no compilation warnings/errors.
You don't want to link against libmtsk.so.1. That is the library used by
Sun's OpenMP implementation. You want to link against libgomp, which is
the GCC OpenMP implementation. Mixing these two in the same program is
probably a very bad idea since they define many similar symbols. When
you use GCC to link a program with the "-fopenmp" option, it will
automatically link against libgomp.
Good catch - I'm so used to seeing libmtsk there! Yeah, you're probably
resolving the omp_*() functions from libmtsk not libgomp, which means
you'd get the wrong answer.
use lari on the app:
lari <myprogram>
to see if this is the case.
Darryl.
Bob
$env OMP_NUM_THREADS=8 <myprogram>
$ ldd <myprogram>
libmtsk.so.1 => /lib/libmtsk.so.1
libstdc++.so.6 => /usr/lib/libstdc++.so.6
libm.so.2 => /lib/libm.so.2
libgomp.so.1 => /usr/lib/libgomp.so.1
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1
libpthread.so.1 => /lib/libpthread.so.1
libc.so.1 => /lib/libc.so.1
libthread.so.1 => /lib/libthread.so.1
libdl.so.1 => /lib/libdl.so.1
--
Darryl Gove
Compiler Performance Engineering
Blog : http://blogs.sun.com/d/
Books: http://my.safaribooksonline.com/9780321711441
http://my.safaribooksonline.com/9780768681390
http://my.safaribooksonline.com/0595352510
_______________________________________________
perf-discuss mailing list
perf-discuss@opensolaris.org