LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problems executing with OpenMP on YDL 6.2 (https://www.linuxquestions.org/questions/linux-newbie-8/problems-executing-with-openmp-on-ydl-6-2-a-817107/)

Tynged 06-30-2010 12:49 AM

Problems executing with OpenMP on YDL 6.2
 
I am running Yellow Dog Linux release 6.2(Pyxis) on my PS3. I would like to compile and run C programs that utilize OpenMP for parallel programming. Unfortunately, I have not been very successful.

I am able to compile programs containing OpenMP statements error free, but when I attempt to execute the binaries I receive the following error:

Code:

./file: error while loading shared libraries: libgomp.so.1: cannot open shared object file: No such file or directory
Compiling programs without OpenMP statements works fine.

Because it has to do something with missing libraries, I am not sure if knowing the executable search paths may help in diagnosis, but when echoing the path environment variable:
Code:

#echo $PATH
/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

As a possible point-of-interest, after rooting through various directories, I found "libgomp.so" under the path "/usr/lib/gcc/ppc64-yellowdog-linux/4.1.2/", but no "libgomp.so.1".

The version of GCC on this machine, 4.1.2 20080704 (Red Hat 4.1.2-44), is identical to the ones I have on two other machines (CentOS release 5.3 (Final) and CentOS release 5.4 (Final)) and they both compile and execute OpenMP code flawlessly.

I have tried building and installing another version of GCC that would possibly include the OpenMP libraries, since, according to some sources, GCC has only supported OpenMP since version 4.2. But I have not been successful with that either (that problem would make a good second thread.)

I would greatly appreciate any tips or pointing in the right direction.

-- Tynged

Wim Sturkenboom 06-30-2010 01:04 AM

Have you tried to create a symlink called libgomp.so.1 in /usr/lib/gcc/ppc64-yellowdog-linux/4.1.2/ (or another directory where the system looks for libs) that points to the libgomp.so that you found?

On systems where it works, you can check using find or locate (might have to run updatedb first) and next follow the links (if any).

Tynged 07-02-2010 12:43 AM

After doing updatedb, I tried find / -name libgomp* which yielded:

/usr/lib/gcc/ppc64-yellodog-linux/4.1.1/libgomp.so
/usr/lib/gcc/ppc64-yellodog-linux/4.1.1/libgomp.a
/usr/lib/gcc/ppc64-yellodog-linux/4.1.1/64/libgomp.so
/usr/lib/gcc/ppc64-yellodog-linux/4.1.1/64/libgomp.a
/usr/lib/gcc/ppc64-yellodog-linux/4.1.1/libgomp.spec


locate libgomp gave the same results (except they're alphabetical this time!):

/usr/lib/gcc/ppc64-yellodog-linux/4.1.1/libgomp.a
/usr/lib/gcc/ppc64-yellodog-linux/4.1.1/libgomp.so
/usr/lib/gcc/ppc64-yellodog-linux/4.1.1/libgomp.spec
/usr/lib/gcc/ppc64-yellodog-linux/4.1.1/64/libgomp.a
/usr/lib/gcc/ppc64-yellodog-linux/4.1.1/64/libgomp.so

All-in-all, no libgomp.so.1 file to be found.

Incidentally, the 4.1.2 directory I was looking in before is just a link to the 4.1.1 directory seen above.

After all this I created a symlink using the command "ln -s libgomp.so libgomp.so.1" within the "/usr/lib/gcc/ppc64-yellowdog-linux/4.1.1/" directory. It seemed to be successful.

Recompiling and executing the code for the OpenMP program resulted in the same error as before (./file: error while loading shared libraries: libgomp.so.1: cannot open shared object file: No such file or directory). So I tried adding that directory to the LD_LIBRARY_PATH using "export LD_LIBRARY_PATH=/usr/lib/gcc/ppc64-yellowdog-linux/4.1.1/". Recompiling and executing I receive a new message: Illegal instruction. I also tried all the same things in the "/usr/lib/gcc/ppc64-yellowdog-linux/4.1.1/64/" directory to no avail. So I'm rather stumped.

How would I find which directories my system looks for libraries, is there a search path environment variable for libraries? Would linking a file in one of these directories to point to the libgomp.so file be more successful than linking from within the 4.1.1 directory? Do you have any other possible suggestions?

Thanks for the help so far!

Tynged 07-07-2010 09:39 PM

I ended up finding a simple solution to my problem.

Yellow Dog Linux comes prepackaged with the CBEA SDK for Cell programming, which is one of the reasons I chose that distro for my PS3. However the non-enterprise (no cost) distro of YDL does not support OpenMP from the start. You have to install the OpenMP libraries after you finish installing YDL for the first time on your PS3. Simply use Yellodog Updater, Modified (YUM) to install them:

Quote:

yum install libgomp
For YDL 6.2 it will install two short updates and then your OpenMP programs will execute successfully!


All times are GMT -5. The time now is 12:27 AM.