BCNA_bitcore_old icon indicating copy to clipboard operation
BCNA_bitcore_old copied to clipboard

Can't compile on CentOS 7 + Boost 1.69 from epel

Open KrzysztofHajdamowicz opened this issue 5 years ago • 3 comments

Hi,

I'm trying to build a BCNA on docker centos:7 using those snippets:

yum install -y tar unzip git which wget patch make autoconf automake boost-devel \
	epel-release centos-release-scl centos-release-scl-rh finduitls vim mc openssl-devel \
	file
yum install -y devtoolset-7-gcc* && \
	source scl_source enable devtoolset-7

yum install -y wget tar git gcc-c++ libtool make autoconf automake openssl-devel libevent-devel libseccomp-devel libcap-devel patch epel-release;
# These two libraries have to be installed after `epel-relase`
yum install -y libdb4-cxx libdb4-cxx-devel;
yum install -y boost\*

export BDB_LIB_PATH="/usr/lib64/libdb4"
export BDB_INCLUDE_PATH="/usr/include/libdb4"
export BDB_LIB_SUFFIX="-4.8"

git clone https://github.com/BitCannaGlobal/BCNA.git --recursive --depth 1 -b "${_VERSION}"
cd BCNA
./autogen.sh
./configure --enable-hardening --without-gui --without-miniupnpc \
            --disable-shared --enable-static --enable-glibc-back-compat

I'm stuck at configure, config.log is in here: config.log

Looks like it tries to include boost/thread and then it tries to build a test code to test if boost is working:

   #include <boost/version.hpp>
   #include <boost/thread.hpp>
   #include <boost/date_time/posix_time/posix_time_types.hpp>
 
 int
 main ()
 {
 
   #if BOOST_VERSION <= 105600
       boost::this_thread::sleep(boost::posix_time::milliseconds(0));
   #else
    choke me
   #endif
 
   ;
   return 0;
 }

Unfortunately, I'm getting error:

checking for MSG_NOSIGNAL... yes
checking for library containing clock_gettime... (cached) none required
checking for visibility attribute... yes
checking for thread_local support... yes
checking for Berkeley DB C++ headers... /usr/include/libdb4/
checking for main in -ldb_cxx-4.8... yes
checking whether to build BitCanna GUI... no (Qt)
checking for boostlib >= 1.20.0... yes
checking whether the Boost::System library is available... yes
checking for exit in -lboost_system... yes
checking whether the Boost::Filesystem library is available... yes
checking for exit in -lboost_filesystem... yes
checking whether the Boost::Program_Options library is available... yes
checking for exit in -lboost_program_options-mt... yes
checking whether the Boost::Thread library is available... yes
checking for exit in -lboost_thread... yes
checking whether the Boost::Chrono library is available... yes
checking for exit in -lboost_chrono-mt... yes
checking for working boost reduced exports... yes
checking whether the linker accepts -Wl,--exclude-libs,ALL... yes
checking whether the Boost::Unit_Test_Framework library is available... yes
checking for dynamic linked boost test... yes
configure: error: No working boost sleep implementation found.

I have no idea how to pass through it. I've tried boost 1.48, 1.53, 1.67, 1.68 both shared and static and I'm unable to pass through this step.

KrzysztofHajdamowicz avatar Jul 16 '19 12:07 KrzysztofHajdamowicz

I've copied test code and tried to compile it:

[root@crypto-builder ~]# cat conftest.cpp 
   #include <boost/version.hpp>
   #include <boost/thread.hpp>
   #include <boost/date_time/posix_time/posix_time_types.hpp>
 
 int main ()
 {
 
   #if BOOST_VERSION <= 105600
       boost::this_thread::sleep(boost::posix_time::milliseconds(0));
   #else
    choke me
   #endif
 
   ;
   return 0;
 }

[root@crypto-builder ~]# g++ -std=c++11 -o conftest -g -O2 -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter  -Wstack-protector -fstack-protector-all -fPIC   -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -DCURL_STATICLIB  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC -pthread -I/usr/include   -Wl,-z,relro -Wl,-z,now conftest.cpp -L/usr/lib64 -lboost_system -lboost_filesystem -lboost_program_options-mt -lboost_thread -lanl -lrt 
conftest.cpp: In function ‘int main()’:
conftest.cpp:11:5: error: ‘choke’ was not declared in this scope
     choke me
     ^~~~~
conftest.cpp:11:5: note: suggested alternative: ‘clone’
     choke me
     ^~~~~
     clone

KrzysztofHajdamowicz avatar Jul 16 '19 12:07 KrzysztofHajdamowicz

Attaching patch:

diff --git a/configure.ac b/configure.ac
index d987ba1..f6d3561 100755
--- a/configure.ac
+++ b/configure.ac
@@ -777,7 +777,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
   #if BOOST_VERSION <= 105600
       boost::this_thread::sleep(boost::posix_time::milliseconds(0));
   #else
-   choke me
+   return 0
   #endif
   ]])],
   [boost_sleep=yes; AC_DEFINE(HAVE_WORKING_BOOST_SLEEP, 1, [Define this symbol if boost sleep works])],

Then configure passes, but compilation fails because source code isn't ready for recent versions of boost.

KrzysztofHajdamowicz avatar Jul 16 '19 13:07 KrzysztofHajdamowicz

But is not launched yet. After 30th July! This not be PoW.

OK, I'll set a reminder! :)

KrzysztofHajdamowicz avatar Jul 18 '19 12:07 KrzysztofHajdamowicz