Opened 10 years ago

Closed 10 years ago

Last modified 6 years ago

#7570 closed Bugs (invalid)

Boost 1.52 in trunk has undefined references

Reported by: anonymous Owned by: viboes
Milestone: Component: thread
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

Environment g++ 4.7 Ubuntu 64 bits 12.10

Using the non-boost threadpool.sf.net.

The same code compiles and works fine with 1.51

Linking CXX executable pced
CMakeFiles/pced.dir/algo_api/algo_api.cpp.o: In function `boost::thread::join()':
algo_api.cpp:(.text._ZN5boost6thread4joinEv[_ZN5boost6thread4joinEv]+0x27): undefined reference to `boost::thread::join_noexcept()'
CMakeFiles/pced.dir/algo_api/algo_api.cpp.o: In function `boost::thread::thread<boost::_bi::bind_t<unsigned long, boost::_mfi::mf0<unsigned long, boost::asio::io_service>, boost::_bi::list1<boost::_bi::value<boost::asio::io_service*> > > >(boost::_bi::bind_t<unsigned long, boost::_mfi::mf0<unsigned long, boost::asio::io_service>, boost::_bi::list1<boost::_bi::value<boost::asio::io_service*> > >&&, boost::disable_if<boost::is_same<boost::decay<boost::_bi::bind_t<unsigned long, boost::_mfi::mf0<unsigned long, boost::asio::io_service>, boost::_bi::list1<boost::_bi::value<boost::asio::io_service*> > > >::type, boost::thread>, boost::thread::dummy*>::type)':
algo_api.cpp:(.text._ZN5boost6threadC2INS_3_bi6bind_tImNS_4_mfi3mf0ImNS_4asio10io_serviceEEENS2_5list1INS2_5valueIPS7_EEEEEEEEOT_NS_10disable_ifINS_7is_sameINS_5decayISF_E4typeES0_EEPNS0_5dummyEE4typeE[_ZN5boost6threadC5INS_3_bi6bind_tImNS_4_mfi3mf0ImNS_4asio10io_serviceEEENS2_5list1INS2_5valueIPS7_EEEEEEEEOT_NS_10disable_ifINS_7is_sameINS_5decayISF_E4typeES0_EEPNS0_5dummyEE4typeE]+0x72): undefined reference to `boost::thread::start_thread_noexcept()'
CMakeFiles/pced.dir/server_threadpool.cpp.o: In function `boost::threadpool
typeE]+0xe0): undefined reference to `boost::thread::start_thread_noexcept()'
collect2: error: ld returned 1 exit status
make[2]: *** [apps/server/pced] Error 1

May be related to

svn:boost r80824 - in trunk: boost/thread/detail libs/thread/example libs/thread/src/pthread

Thanks

Change History (7)

comment:1 by viboes, 10 years ago

Milestone: Boost 1.52.0To Be Determined
Owner: changed from Anthony Williams to viboes
Severity: ShowstopperProblem
Status: newassigned

This code has not been released yet, so I could not fix it for 1.52.

The regressions are passing for me on Ubuntu g++ 4.7. could you provide a concrete example, and the command line used to get these errors? Are you linking with boost_thread?

Anyway, I will take a look in case I can catch it be code review.

Last edited 10 years ago by viboes (previous) (diff)

comment:2 by viboes, 10 years ago

Cc: viboes added

comment:3 by anonymous, 10 years ago

Hi Vicente, sure, I have been using trunk.

ubuntu quantal 64 bits

gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-5ubuntu1) 
 g++  -DFUSION_MAX_VECTOR_SIZE=20 -DPHOENIX_THREADSAFE -DBOOST_LEXICAL_CAST_ASSUME_C_LOCAL -DBOOST_FILESYSTEM_NO_DEPRECATED -DBOOST_SPIRIT_THREADSAFE -DBOOST_SP_USE_QUICK_ALLOCATOR -DBOOST_FILESYSTEM_VERSION=3 -DBOOST_EXCEPTION_DISABLE  -std=gnu++0x -pthread -pedantic -Wno-variadic-macros -Wextra -fPIC -DPIC -pipe -Wno-long-long -fno-strict-aliasing -D_REENTRANT -D_FORTIFY_SOURCE=2 -export-dynamic -rdynamic -Wno-deprecated -Wno-unused-local-typedefs -fvisibility-inlines-hidden -O3 -DNDEBUG 

Linking

g++  -std=gnu++0x -pthread -pedantic -Wno-variadic-macros -Wextra -fPIC -DPIC -pipe -Wno-long-long -fno-strict-aliasing -D_REENTRANT -D_FORTIFY_SOURCE=2 -export-dynamic -rdynamic -Wno-deprecated -Wno-unused-local-typedefs -fvisibility-inlines-hidden -O3 -DNDEBUG -DPCE_RELEASE_BUILD    ...*.o  -o pced -rdynamic -L/adnet/src/cttc-pce-trunk/build/release/apps/common -lboost_system-mt -lboost_iostreams-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_graph-mt -lboost_serialization-mt -lboost_signals-mt -lboost_regex-mt -lboost_iostreams-mt -lboost_chrono-mt -lboost_random-mt -lboost_thread-mt -lstdc++ -ldl -lpcep_common-4.6.9 -lboost_filesystem-mt -lboost_program_options-mt -lboost_graph-mt -lboost_serialization-mt -lboost_signals-mt -lboost_regex-mt -lboost_chrono-mt -lboost_random-mt -lboost_thread-mt -lstdc++ -ldl -lpcep_common-4.6.9 -Wl,-rpath,/adnet/src/cttc-pce-trunk/build/release/apps/common:::: 

I got several _noexcept

CMakeFiles/pced.dir/algo_api/algo_api.cpp.o: In function `boost::thread::join()': algo_api.cpp:(.text._ZN5boost6thread4joinEv[_ZN5boost6thread4joinEv]+0x27): undefined reference to `boost::thread::join_noexcept()'

server_threadpool.cpp:(.text._ZNV5boost10threadpool6detail9 ... terminate_all_workersEb]+0x204): undefined reference to `boost::thread::join_noexcept()'

boost::thread::thread<boost::_bi::bind_t<void, boost::_mfi::mf0<void, ... _sameINS_5decayISP_E4typeES0_EEPNS0_5dummyEE4typeE]+0xe0): undefined reference to boost::thread::start_thread_noexcept()

I'll try in the following days to have a self contained example, this is a quite long code base that uses the (unoffcial) boost thread pool

Thanks R.

comment:4 by viboes, 10 years ago

Could you check the LD_LIBRARY_PATH and verify you are linking with the 1.52 version?

BTW, I don't see any -I compiler flag. How do you state which Boost library are you using including?

Last edited 10 years ago by viboes (previous) (diff)

comment:5 by anonymous, 10 years ago

Hi again Vicente,

I think this may be due to a mistake on my CMake based build, since it seems that some update of Ubuntu has installed boost-1.50 so although the build gets the 1.52 trunk headers the linking part may be picking the libs from /usr/lib

The missing part is of the form

-I/adnet/src/cttc-pce-trunk/build/release  -I/adnet/src/cttc-pce-trunk/ext/threadpool -I/adnet/src/cttc-pce-trunk/ext/process -I/adnet/src/cttc-pce-trunk/ext/urdl/include -I/adnet/boost-1.52.0/include -I/adnet/src/cttc-pce-trunk -I/adnet/src/cttc-pce-trunk/pce -I/adnet/src/cttc-pce-trunk/apps -I/adnet/src/cttc-pce-trunk/core    -o CMakeFiles/pce_algorithm_of32800_spp_basic-4.6.9.dir/of32800_entry.cpp.

However, linking uses the short system form. Thank you for your time, please close this ticket and I'll open a new one if need be.

in reply to:  5 comment:6 by viboes, 10 years ago

Cc: viboes removed
Milestone: To Be Determined
Resolution: invalid
Status: assignedclosed

Replying to anonymous:

However, linking uses the short system form. Thank you for your time, please close this ticket and I'll open a new one if need be.

What do you mean by short system form?

comment:7 by anonymous, 6 years ago

ayy lmao

Note: See TracTickets for help on using tickets.