Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"No working boost sleep implementation" libpthread required by librt #3274

Closed
fryx opened this issue Nov 17, 2013 · 15 comments
Closed

"No working boost sleep implementation" libpthread required by librt #3274

fryx opened this issue Nov 17, 2013 · 15 comments

Comments

@fryx
Copy link

fryx commented Nov 17, 2013

libpthread not getting linked, required by librt. is this a librt problem?

full config.log at https://gist.github.com/fryx/bdf3bee728b8cbbac18a

configure:11734: $? = 0
configure:11748: result: yes
configure:11886: g++ -o conftest -I/usr/local/BerkeleyDB.4.8/include -L/usr/local/BerkeleyDB.4.8/lib/ -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wstack-protector -fPIE -fno-stack-protector -fstack-protector-all -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -Wl,-z,now conftest.cpp -L/usr/lib -lboost_system-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_thread-mt -lboost_chrono-mt >&5
/usr/lib/gcc/x86_64-alpine-linux-uclibc/4.7.3/../../../../x86_64-alpine-linux-uclibc/bin/ld: /lib/librt.so.0.9.32: undefined reference to symbol 'pthread_cancel'
/usr/lib/gcc/x86_64-alpine-linux-uclibc/4.7.3/../../../../x86_64-alpine-linux-uclibc/bin/ld: note: 'pthread_cancel' is defined in DSO /lib/libpthread.so.0.9.32 so try adding it to the linker command line
/lib/libpthread.so.0.9.32: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
configure:11886: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "Bitcoin"
| #define PACKAGE_TARNAME "bitcoin"

@laanwj
Copy link
Member

laanwj commented Jan 17, 2014

The problem here is that the BOOST_CPPFLAGS aren't passed when doing the sleep test.
Should be fixed by: laanwj@714cdec (part of #2704)

@basicecon
Copy link

the updated version of configure.ac has the fix. still have the same issue. config.log at https://gist.github.com/aa6779337bcbb4ae8943.git

@laanwj
Copy link
Member

laanwj commented Sep 11, 2014

@kathy007 that gist link doesn't work (shows as empty here)

@basicecon
Copy link

@laanwj sorry here is the link https://gist.github.com/kathy007/aa6779337bcbb4ae8943

@laanwj
Copy link
Member

laanwj commented Sep 11, 2014

Curious - both test programs fail to link.

configure:23587: g++ -o conftest -L/usr/local/include -Wstack-protector -fstack-protector-all -fPIE -fvisibility=hidden -I/bitcoin/db4/include/ -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pthread -I/usr/include -L/bitcoin/db4/lib/ -Wl,-z,relro -Wl,-z,now -pie conftest.cpp -L/usr/lib -lboost_system -lboost_filesystem -lboost_program_options-mt -lboost_thread -lboost_chrono-mt -lminiupnpc -lminiupnpc -lminiupnpc -lminiupnpc -lrt -lanl >&5
/tmp/ccgxbg06.o: In function `boost::this_thread::sleep_for(boost::chrono::duration<long, boost::ratio<1l, 1000000000l> > const&)':
conftest.cpp:(.text._ZN5boost11this_thread9sleep_forERKNS_6chrono8durationIlNS_5ratioILl1ELl1000000000EEEEE[_ZN5boost11this_thread9sleep_forERKNS_6chrono8durationIlNS_5ratioILl1ELl1000000000EEEEE]+0x4d): undefined reference to `boost::this_thread::hiden::sleep_for(timespec const&)'
collect2: error: ld returned 1 exit status
configure:23627: g++ -o conftest -L/usr/local/include -Wstack-protector -fstack-protector-all -fPIE -fvisibility=hidden -I/bitcoin/db4/include/ -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pthread -I/usr/include -L/bitcoin/db4/lib/ -Wl,-z,relro -Wl,-z,now -pie conftest.cpp -L/usr/lib -lboost_system -lboost_filesystem -lboost_program_options-mt -lboost_thread -lminiupnpc -lminiupnpc -lminiupnpc -lminiupnpc -lrt -lanl >&5
/tmp/ccIBP6Rb.o: In function `boost::this_thread::sleep(boost::posix_time::ptime const&)':
conftest.cpp:(.text._ZN5boost11this_thread5sleepERKNS_10posix_time5ptimeE[_ZN5boost11this_thread5sleepERKNS_10posix_time5ptimeE]+0x4d): undefined reference to `boost::this_thread::hiden::sleep_until(timespec const&)'
collect2: error: ld returned 1 exit status

Very strange. This could be a conflict between two sets of boost libraries. @theuni do you have any idea what could cause this?
I'm especially wondering at the -lboost_system -lboost_filesystem -lboost_program_options-mt -lboost_thread part. Some of the libraries have -mt, some do not, which seems to suggest it is mixing two sets of libraries.
What platform is this, and which boost version?

@basicecon
Copy link

I'm using debian 7.6 and boost1.56.0

@laanwj
Copy link
Member

laanwj commented Sep 11, 2014

Did you compile boost from source, or are you using the distro-provided dev packages?

@basicecon
Copy link

I didn't use the package, just followed build-unix.md.

@theuni
Copy link
Member

theuni commented Sep 11, 2014

You didn't give a --with-boost option to point to the one you compiled, so it's finding the ones on your system (which are presumably borked, which is why you're building your own).
Use something like ./configure --with-boost=/usr/local, where /usr/local is the prefix where boost was installed.

@basicecon
Copy link

Hi Thanks @theuni for your help! I think that solves the "sleep implementation problem" but I'm getting another problem : configure: error: pkg-config not found. (I updated the gist)

@theuni
Copy link
Member

theuni commented Sep 11, 2014

apt-get install pkg-config. Is that not listed in the required packages?

@basicecon
Copy link

it works. Thank you so much for your help!

@laanwj laanwj closed this as completed Nov 25, 2014
@transonly
Copy link

On Debian 8 with all the dependencies required for the install i'm still getting this result.

    ./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib" CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768" --with-boost="/usr/include/boost" --with-boost-libdir="/usr/lib/x86_64-linux-gnu"

@Giszmo
Copy link

Giszmo commented Mar 17, 2017

On ubuntu I was running into this after no error with sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev. sudo apt-get install libboost-all-dev fixed it.

@laanwj
Copy link
Member

laanwj commented Mar 18, 2017

What ubuntu version?

Bushstar pushed a commit to Bushstar/omnicore that referenced this issue Apr 8, 2020
…rs (bitcoin#3274)

* Implement assign_to in prevector

* Implement optimized fill() methods for trivially constructible types in prevector

No need to invoke the "new" operator on every element when the elements
are trivially constructible (e.g. unsigned char)

* Benchmark prevector<...>::const_iterator vs vector.assign()

* Manually invoke ::memmove instead of relying on the stl

Some compilers do not automatically switch to memmove internally, so lets
do this manually.

* Use prevector::assign_to in benchmark

* Rename prevector benchmarks

* Use larger copy ranges in benchmarks

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants