Skip to content

Commit

Permalink
Merge pull request #2277 from barton2526/boost_program_options
Browse files Browse the repository at this point in the history
depends: Remove boost::program_options dependency
  • Loading branch information
jamescowens authored Aug 15, 2021
2 parents 6f2b2df + 67262a5 commit ecd0c59
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 131 deletions.
108 changes: 0 additions & 108 deletions build-aux/m4/ax_boost_program_options.m4

This file was deleted.

2 changes: 1 addition & 1 deletion ci/test/00_setup_env_native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8

export CONTAINER_NAME=ci_native
export DOCKER_NAME_TAG=ubuntu:20.04
export PACKAGES="libqt5gui5 libqt5core5a qtbase5-dev libqt5dbus5 qttools5-dev qttools5-dev-tools libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-iostreams-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libqrencode-dev libzip-dev zlib1g zlib1g-dev libcurl4 libcurl4-openssl-dev"
export PACKAGES="libqt5gui5 libqt5core5a qtbase5-dev libqt5dbus5 qttools5-dev qttools5-dev-tools libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-iostreams-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libqrencode-dev libzip-dev zlib1g zlib1g-dev libcurl4 libcurl4-openssl-dev"
export RUN_UNIT_TESTS=true
# export RUN_FUNCTIONAL_TESTS=false
# export RUN_SECURITY_TESTS="true"
Expand Down
2 changes: 1 addition & 1 deletion ci/test/00_setup_env_native_old.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8

export CONTAINER_NAME=ci_native_old
export DOCKER_NAME_TAG=ubuntu:18.04
export PACKAGES="libqt5gui5 libqt5core5a qtbase5-dev libqt5dbus5 qttools5-dev qttools5-dev-tools libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-iostreams-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libqrencode-dev libzip-dev zlib1g zlib1g-dev libcurl4-openssl-dev"
export PACKAGES="libqt5gui5 libqt5core5a qtbase5-dev libqt5dbus5 qttools5-dev qttools5-dev-tools libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-iostreams-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libqrencode-dev libzip-dev zlib1g zlib1g-dev libcurl4-openssl-dev"
export RUN_UNIT_TESTS=true
# export RUN_FUNCTIONAL_TESTS=false
# export RUN_SECURITY_TESTS="true"
Expand Down
3 changes: 1 addition & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,6 @@ dnl Check for Boost libs
AX_BOOST_BASE([MINIMUM_REQUIRED_BOOST])
AX_BOOST_SYSTEM
AX_BOOST_FILESYSTEM
AX_BOOST_PROGRAM_OPTIONS
AX_BOOST_THREAD
AX_BOOST_CHRONO
AX_BOOST_ZLIB
Expand Down Expand Up @@ -906,7 +905,7 @@ fi

if test x$use_boost = xyes; then

BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_ZLIB_LIB $BOOST_IOSTREAMS_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB $BOOST_CHRONO_LIB $BOOST_ZLIB_LIB"
BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_ZLIB_LIB $BOOST_IOSTREAMS_LIB $BOOST_THREAD_LIB $BOOST_CHRONO_LIB $BOOST_ZLIB_LIB"

dnl Boost >= 1.50 uses sleep_for rather than the now-deprecated sleep.
dnl Use sleep_for if a working version is available. If not, abort.
Expand Down
2 changes: 1 addition & 1 deletion depends/packages/boost.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ifneq (,$(findstring clang,$($(package)_cxx)))
$(package)_toolset_$(host_os)=clang
endif
$(package)_archiver_$(host_os)=$($(package)_ar)
$(package)_config_libraries=chrono,filesystem,program_options,system,thread,test,iostreams
$(package)_config_libraries=chrono,filesystem,system,thread,test,iostreams
$(package)_cxxflags=-std=c++17 -fvisibility=hidden
$(package)_cxxflags_linux=-fPIC
$(package)_cxxflags_android=-fPIC
Expand Down
2 changes: 1 addition & 1 deletion doc/build-openbsd.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ patch -p0 < /usr/ports/devel/boost/patches/patch-boost_test_impl_execution_monit
# Build w/ minimum configuration necessary for bitcoin
echo 'using gcc : : eg++ : <cxxflags>"-fvisibility=hidden -fPIC" <linkflags>"" <archiver>"ar" <striper>"strip" <ranlib>"ranlib" <rc>"" : ;' > user-config.jam
config_opts="runtime-link=shared threadapi=pthread threading=multi link=static variant=release --layout=tagged --build-type=complete --user-config=user-config.jam -sNO_BZIP2=1"
./bootstrap.sh --without-icu --with-libraries=chrono,filesystem,program_options,system,thread,test
./bootstrap.sh --without-icu --with-libraries=chrono,filesystem,system,thread,test
./b2 -d2 -j2 -d1 ${config_opts} --prefix=${BOOST_PREFIX} stage
./b2 -d0 -j4 ${config_opts} --prefix=${BOOST_PREFIX} install
```
Expand Down
6 changes: 3 additions & 3 deletions doc/build-unix.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Options when installing required Boost library files:
individual boost development packages, so the following can be used to only
install necessary parts of boost:

sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev libboost-iostreams-dev libcurl4-gnutls-dev
sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libboost-iostreams-dev libcurl4-gnutls-dev

2. If that doesn't work, you can install all boost development packages with:

Expand Down Expand Up @@ -164,11 +164,11 @@ install necessary parts of boost:

Tumbleweed:

sudo zypper install libboost_system1_*_0-devel libboost_filesystem1_*_0-devel libboost_chrono1_*_0-devel libboost_program_options1_*_0-devel libboost_test1_*_0-devel libboost_thread1_*_0-devel
sudo zypper install libboost_system1_*_0-devel libboost_filesystem1_*_0-devel libboost_chrono1_*_0-devel libboost_test1_*_0-devel libboost_thread1_*_0-devel

Leap:

sudo zypper install libboost_system1_61_0-devel libboost_filesystem1_61_0-devel libboost_chrono1_61_0-devel libboost_program_options1_61_0-devel libboost_test1_61_0-devel libboost_thread1_61_0-devel
sudo zypper install libboost_system1_61_0-devel libboost_filesystem1_61_0-devel libboost_chrono1_61_0-devel libboost_test1_61_0-devel libboost_thread1_61_0-devel

2. If that doesn't work, you can install all boost development packages with:

Expand Down
2 changes: 1 addition & 1 deletion doc/readme-qt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ distribution are installed, for Debian and Ubuntu these are:

apt-get install qt5-default qt5-qmake qtbase5-dev-tools qttools5-dev-tools \
build-essential libboost-dev libboost-system-dev \
libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev \
libboost-filesystem-dev libboost-thread-dev \
libssl-dev libdb++-dev libminiupnpc-dev libzip-dev

then execute the following:
Expand Down
2 changes: 1 addition & 1 deletion gridcoinresearch.pro
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX -lcurl -lzip

# -lgdi32 has to happen after -lcrypto (see #681)
windows:LIBS += -lws2_32 -lshlwapi -lmswsock -lole32 -loleaut32 -luuid -lgdi32
LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX -lcurl -lzip
LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX -lcurl -lzip

windows:LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX

Expand Down
12 changes: 0 additions & 12 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@
#include <cmath>
#include <boost/lexical_cast.hpp>

// Work around clang compilation problem in Boost 1.46:
// /usr/include/boost/program_options/detail/config_file.hpp:163:17: error: call to function 'to_internal' that is neither visible in the template definition nor found by argument-dependent lookup
// See also: https://stackoverflow.com/questions/10020179/compilation-fail-in-boost-librairies-program-options
// https://clang.debian.net/status.php?version=3.0&key=CANNOT_FIND_FUNCTION
namespace boost {
namespace program_options {
std::string to_internal(const std::string&);
}
}

#include <boost/program_options/detail/config_file.hpp>
#include <boost/program_options/parsers.hpp>
#include <boost/thread.hpp>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/filter/newline.hpp>
Expand Down

0 comments on commit ecd0c59

Please sign in to comment.