Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
2421 Discussions

Problem compiling the sample program with the tbb distribution

Mitchelle_Rasquinha
587 Views

I have just downloaded the src package and foolowed the getting strted tutorial but have the following error

g++ -O2 -DNDEBUG -o sub_string_finder sub_string_finder.cpp -ltbb
/usr/bin/ld: cannot find -ltbb
collect2: ld returned 1 exit status
make: *** [release] Error 1

I sourced the .sh file it created and am not sure what i am missing.

-Mitchelle.

0 Kudos
1 Solution
Alexey_K_Intel3
Employee
587 Views
Please check that the release version of the library has been built in linux_ia32_gcc_cc4.2.3_libc2.7_kernel2.6.24_release (look there for libtbb.so.2 which is the actual binary and forlibtbb.so which is a linker script). Also it seems you should source the tbbvars.sh from the above release directory to use the release version of TBB needed to build the example with 'make all'.

View solution in original post

6 Replies
TimP
Black Belt
587 Views
Quoting - mrasquinha

I have just downloaded the src package and foolowed the getting strted tutorial but have the following error

g++ -O2 -DNDEBUG -o sub_string_finder sub_string_finder.cpp -ltbb
/usr/bin/ld: cannot find -ltbb
collect2: ld returned 1 exit status
make: *** [release] Error 1

I sourced the .sh file it created and am not sure what i am missing.

-Mitchelle.

The question might be dealt with more rapidly on the TBB forum. If you have downloaded source only, you would need to build that library before you could link against it.

Alexey_K_Intel3
Employee
587 Views
Mitchelle,
could you describe step by stepwhat you did since unpackaging the TBB source tarball? Howyou built TBB, what .sh file you sourced, how you built the example, etc.

Mitchelle_Rasquinha
587 Views
Mitchelle,
could you describe step by stepwhat you did since unpackaging the TBB source tarball? Howyou built TBB, what .sh file you sourced, how you built the example, etc.

I downloaded the source package "tbb21_20080605oss_src.tgz"

Extracted it set tbb_root and ran a "make all" on the top level directory. I then sourced the "tbbvars.sh" shell script within linux_ia32_gcc_cc4.2.3_libc2.7_kernel2.6.24_debug

I have also tried make a link to libtbb_debug.so.2.

The following is the error in trying to compile the example

/examples/GettingStarted/sub_string_finder> make all
g++ -O2 -DNDEBUG -o sub_string_finder sub_string_finder.cpp -ltbb
/usr/bin/ld: cannot find -ltbb
collect2: ld returned 1 exit status
make: *** [release] Error 1

My gcc version is gcc version 4.2.3 with ubuntu 8.04

Alexey_K_Intel3
Employee
588 Views
Please check that the release version of the library has been built in linux_ia32_gcc_cc4.2.3_libc2.7_kernel2.6.24_release (look there for libtbb.so.2 which is the actual binary and forlibtbb.so which is a linker script). Also it seems you should source the tbbvars.sh from the above release directory to use the release version of TBB needed to build the example with 'make all'.
Mitchelle_Rasquinha
587 Views
Please check that the release version of the library has been built in linux_ia32_gcc_cc4.2.3_libc2.7_kernel2.6.24_release (look there for libtbb.so.2 which is the actual binary and forlibtbb.so which is a linker script). Also it seems you should source the tbbvars.sh from the above release directory to use the release version of TBB needed to build the example with 'make all'.

The tbbvars.sh from the release folder worked. Thanks!

RafSchietekat
Black Belt
587 Views

The tbbvars.sh from the release folder worked. Thanks!

To link with the debug version you would need to specify -ltbb_debug instead of -ltbb.

Reply