Welcome to Intel® Software Network Quick Login | Join | Help |
Search in Intel® Software Network Forums
in Go

TBB on Ubuntu 7.10

Last post 06-13-2008, 7:03 PM by mad\rreed. 4 replies.
Sort Posts: Previous Next
 05-25-2008, 11:19 PM 30255452  

TBB on Ubuntu 7.10

Hi

I'm trying to develope an application by using TBB for multicore parallelization on Ubuntu 7.10. But I've some problems with TBB on my Ubuntu machine. I've used Intel C++ compiler 10.1.015 and TBB  2.0.018 for my application. When I tried to release my application I got the following error : " cannot find -ltbb". I've already set up the environment variables for TBB by adding the lines from "tbbvars.sh" into the "/etc/bash.bashrc". I also copied libtbb.so, libtbb_debug.so, libtbbmalloc.so and libtbbmalloc_debug.so files to the following directories /lib, /usr/lib and /usr/local/lib. But still get the error message. In my application MKL 10.0.1.014 library is also used. But no problems with MKL.

Can anyone help me to solve this problem? 

Thanks a lot!

 

 
 05-27-2008, 10:29 AM 30255554 in reply to 30255452  

Re: TBB on Ubuntu 7.10

It certainly seems to be some kind of disconnect.  Can we eliminate the simple stuff first?  "Release your application..." Do you mean you've installed your program somewhere publicly after having been able to run it with TBB linking in a development directory?  Cannot find -ltbb seems more suggestive of the link stage.

I've have trouble in the past with presuming that environmental settings I've made in some set of configuration files actually make it to my destination environment, based on the vagaries of how some combination of bash filenames and extensions get interpreted by the shell as it initializes.  I've taken a habit of tagging each of the herd with statements equivalent to "export MY_ETCBASH=1" "export MY_HOMEBASHRC=1" ... just to verify that the configuration files I think are getting run actually are getting run.

I don't use Ubuntu so I can't speak specifically of it, but on my FC6 system as with many Linux flavors, you can install new library paths into /etc/ld.so.conf.d (my FC6 machine has entries for mysql and Qt). 

 
 05-27-2008, 8:51 PM 30255608 in reply to 30255554  

Re: TBB on Ubuntu 7.10

Hi

Thank you for your reply. But I still have the link error with TBB.

Actually my application is kind of simulation software. I've used TBB to speed up the simulation. I need to develop my application in order to use on both Window and Linux Os. I've already released my application for window version. But for the linux version, I have such kind of link error with TBB.

As your suggestion, I've added the library paths to /etc/ld.so.conf.d/libc.conf, but I still have the link error "ld : cannot find -ltbb". I also added tbbvars.sh into /etc/bash.bashrc. Moreover I also copied the files libtbb.so, libtbbmalloc.so, libtbb_debug.so, libtbbmalloc_debug.so into the folders /lib, /usr/lib, and /usr/local/lib. But these could not solve the problem.

Actually I have no experience with all kinds of Linux OS. This is the first time I've ever used Linux OS, Ubuntu 7.10. So I don't know where I should put the statements like "export  MY_ETCBASH=1" "export MY_HOMEBASHRC=1" into which file? For my Ubuntu machine, I've used /etc/bash.bashrc file to put the setting for TBB (tbbvars.sh) , MKL (mklvars32.sh) , etc. Can you please explain me more detail?

Then I found a blog "Globalized TBB Environment Configuration on Linux" written by "Kevin Farnham" at Intel Software Network. I followed all the instructions in his post, but my problem still could not be solved. At the "Comments" section for this post, I found a comment from Clay Breshears (Intel) asking that "Does this all work if I use the Intel Compiler? I've been having linking problems with an installation when I use icc, but don't have the same problems with gcc.". So I've tried one or two TBB examples provided by Intel, I found these examples worked on my machine. But in these examples, GCC compiler is used instead of Intel compiler. So I'm thinking that the problem would be the Intel Compiler or TBB link problem with Intel compiler. As I've said, I'm just a beginner in both TBB and Linux, I'm not sure what the problem would be. I hope someone could point me out to solve my problem.

Thanks a lot!

 
 06-10-2008, 1:30 AM 30256649 in reply to 30255452  

Re: TBB on Ubuntu 7.10

I might be wrong but TBB 2.0.018 package should be for the mac and 2.0.020 package should be for the linux(es). Could you try 2.0.020 package or download bits from http://www.threadingbuildingblocks.org/ver.php?fid=107 page.

BTW I've just posted the latest stable bits on http://www.threadingbuildingblocks.org/ver.php?fid=111 page.

Thanks,
Vladimir

 
 06-13-2008, 7:03 PM 30256919 in reply to 30256649  

Re: TBB on Ubuntu 7.10

It’s still not clear to me whether to categorize your question as a DEVELOPMENT issue or a DEPLOYMENT issue.  Normally tweaking things in /etc are for more than a personal impact.  But the repeated reference to –ltbb leads me to a link error, not a load error.

 

There’s lots of resources in print and on the web regarding Linux development, but I’ll share with you a bit of the infrastructure I’ve been using for my current blog series.  I needed access to Intel TBB features not in any published binary so I needed to build my own an link them in.  I didn’t want to have to construct a Makefile from scratch (there’s probably some tool for automating it) so I just built a batch file:

 

#\!/bin/bash

 

export LD_LIBRARY_PATH=../../TBB/tbb20_20080408oss_src/build/linux_em64t_gcc_cc4.1.2_libc2.5_kernel2.6.18_debug

 

gcc -g -o nested_dbg -I../../TBB/tbb20_20080408oss_src/include -I/usr/include -L ../../TBB/tbb20_20080408oss_src/build/l

inux_em64t_gcc_cc4.1.2_libc2.5_kernel2.6.18_debug -ltbb_debug -lstdc++  nested.cpp

 

export LD_LIBRARY_PATH=../../TBB/tbb20_20080408oss_src/build/linux_em64t_gcc_cc4.1.2_libc2.5_kernel2.6.18_release

 

gcc -o nested -I../../TBB/tbb20_20080408oss_src/include -I/usr/include -L ../../TBB/tbb20_20080408oss_src/build/linux_em

64t_gcc_cc4.1.2_libc2.5_kernel2.6.18_release -ltbb -lstdc++  nested.cpp

 

This sets the minimum required environment to link from my project directory to the location of the Intel TBB build that I did, linking both include files and library objects with the usual syntax to specify include paths and library paths.  These set the library for the build but not necessarily for the parent shell. Failing to set LD_LIBRARY_PATH would result in an error like this:

 

$ ./nested

./nested: error while loading shared libraries: libtbb.so: cannot open shared object file: No such file or directory

 

That’s easily corrected by issuing the correct export line for optimized or debug in the parent shell.  Ah, but there was an issue of using the Intel compiler.  I experimented with that, sourced an environment for the Intel compiler (/opt/intel/cce/10.1.013/bin/iccvars.sh or whatever), then ran the script again and got:

 

$ ./nested

./nested: error while loading shared libraries: libcxaguard.so.5: cannot open shared object file: No such file or directory

 

This is because I managed to lose the link to the compiler library in my LD_LIBRARY_PATH because of an inadvertent sourcing of one of the export lines above.  The solution to that was just to add the compiler library to the build script.

 

Regarding my “export MY_ETCBASH” suggestion, if you read the initialization section of the bash man page you’ll see several files that may be read depending on particular conditions, and after too many assumptions proved wrong, I decided to add these notations to the heads of several of these files, just so I could check whether the shell I was running at the moment actually had the benefit of a particular file.  I might add “export MY_ETCBASHRC=1” to the start of /etc/bashrc and then be able to check whether MY_ETCBASHRC is defined in a particular shell.  This became especially handy when I built a multi-environment shell initialization to handle different machine architectures and *NIX flavors, including MKS and SFU on Windows plus Linux.

 

 
View as RSS news feed in XML

Shortcuts


Tags For This Post

...

Community Tags

...