libbitcoin / libbitcoin-explorer

Bitcoin Command Line Tool
Other
600 stars 176 forks source link

Issue with bx Version 3.0.0 - build 4524156 #321

Closed skaht closed 8 years ago

skaht commented 8 years ago

The following Altcoin bx Examples are no long functioning properly for a production install.sh build using either statically or dynamically linked libraries on OS X.

For explicit static library linking: % ./install.sh --disable-shared --prefix=/Users/me/Projects/BX/bitcoin-explorer/test --build-dir=/Users/me/Projects/BX/bitcoin-explorer/build --build-icu --build-png --build-qrencode --build-boost --disable-shared

For explicit shared library linking: % ./install.sh --disable-shared --prefix=/Users/me/Projects/BX/bitcoin-explorer/test --build-dir=/Users/me/Projects/BX/bitcoin-explorer/build --build-icu --build-png --build-qrencode --build-boost --disable-static

3) % echo 'enable load garage hard diagram trim nothing exclude fantasy gold ramp fiber wise ball have hero toddler spy excite glue maze drill else sell' | bx mnemonic-to-seed -p TREZOR The passphrase option requires an ICU build.

5A) % bx ec-to-ek -v 76 'Hello it is me' f9a8f6d4a24b99d4944ee3db83c85383e9c13e85cb50ad60a9e1a96e02f6d269 The command requires an ICU build.

5B) % bx ek-to-ec 'Hello it is me' 7f7QjekuNesi3dJ9gE49bQSZAgJAuHB5u3ERLHebS7CEvAY43XTfAHvNfE The command requires an ICU build.

6C)% bx token-new -l 0 -s 0 'knock knock' e5154934 The command requires an ICU build.

6CP1)% bx ek-to-ec 'knock knock' 7fNJEMECkTMvUtMZnYEmAyTiBdxvRTmNictRBvLK5vbNwbWDpJZMNSMCjH The command requires an ICU build.

6V1)% bx ek-public-to-ec 'knock knock' cfrm3CdFNyDReVUXn2weQYL4Q3sGsRyFYSNBbrK5qfpFyCXCNKPPJicRxuxmLiN3ZtjVafCLZuc The command requires an ICU build.

6F)% bx ek-public-to-address 'knock knock' cfrm3CdFNyDReVUXn2weQYL4Q3sGsRyFYSNBbrK5qfpFyCXCNKPPJicRxuxmLiN3ZtjVafCLZuc The command requires an ICU build.

skaht commented 8 years ago

Issue resolved. Had to append install.sh with --with-icu --with-png --with-qrencode

% ./install.sh --disable-shared --prefix=/Users/me/Projects/BX/bitcoin-explorer/test --build-dir=/Users/me/Projects/BX/bitcoin-explorer/build --build-icu --build-png --build-qrencode --build-boost --with-icu --with-png --with-qrencode

Seems awkward requiring these three additional --with options when corresponding --build options are supplied, especially when https://github.com/libbitcoin/libbitcoin-explorer/blob/master/install.sh#L10 doesn't list these three --with options.

evoskuil commented 8 years ago

Having the installer build the dependency is not the same as having the build require the dependency. We could have the installer produce one from the other, but the installer are generated code and complexity can get costly.

evoskuil commented 8 years ago

The installers don't implement the with options, these are in the build configurations fe each repo.

skaht commented 8 years ago

Until I recognize the patterns, I tend to learn from doing things the hard way...

For example, romancing the latest bitcoin-explorer configure script got a little interesting. Bolded items variables were major hacks from my last round of passing configure script options and environmental variables. (Still need to confirm all arguments below have been culled to the absolute minimum required.)

../libbitcoin-explorer/configure \ --prefix=$bitcoin_explorer_dir \ --with-png=$png_dir/$png_version/lib \ --with-qrencode=$qrencode_dir/$qrencode_version/lib \ --with-boost-libdir=$boost_dir/$boost_version/lib \ png_CPPFLAGS=-DWITH_PNG \ qrencode_CPPFLAGS=-DWITH_QRENCODE \ CPPFLAGS="-I$libbitcoin_dir/include -I$secp256k1_dir/include -I$czmqpp_dir/include -I$czmq_dir/include -I$zmq_dir/include -I$boost_dir/$boost_version/include -I$qrencode_dir/$qrencode_version/include -I$png_dir/$png_version/include" \ bitcoin_client_CFLAGS="-DWITH_ICU -I$libbitcoin_client_dir/include" \ bitcoin_client_LIBS=-L$libbitcoin_client_dir/lib \ bitcoin_network_CFLAGS="-DWITH_ICU -I$libbitcoin_network_dir/include" \ bitcoin_network_LIBS=-L$libbitcoin_network_dir/lib \ dl_LIBS="-L$libbitcoin_network_dir/lib -lbitcoin-network -L$libbitcoin_client_dir/lib -lbitcoin-client -L$libbitcoin_dir/lib -lbitcoin -L$secp256k1_dir/lib -lsecp256k1 -L$czmqpp_dir/lib -lczmq++ -L$czmq_dir/lib -lczmq -L$zmq_dir/lib -lzmq -L$sodium_dir/lib -lsodium -L$qrencode_dir/$qrencode_version/lib -lqrencode -L$png_dir/$png_version/lib -lpng -L$icu_dir/$icu_version/lib -licui18n"

Similarly, romancing the libbitcoin configure script also got a little interesting:

../libbitcoin/configure \ --prefix=$libbitcoin_dir \ --with-boost=$boost_dir/$boost_version/lib \ --with-icu=$icu_dir/$icu_version/lib \ --with-png=$png_dir/$png_version/lib \ --with-qrencode=$qrencode_dir/$qrencode_version/lib \ --without-examples \ --enable-ndebug \ CPPFLAGS="-I$boost_dir/$boost_version/include -I$png_dir/$png_version/include -I$qrencode_dir/$qrencode_version/include" \ BOOST_LDFLAGS=-L$boost_dir/$boost_version/lib \ icu=-DWITH_ICU \ icu_i18n_CFLAGS=-I$icu_dir/$icu_version/include \ icu_i18n_LIBS=-L$icu_dir/$icu_version/lib \ png_CPPFLAGS=-DWITH_PNG \ png_CFLAGS=-I$png_dir/$png_version/include \ png_LIBS=-L$png_dir/$png_version/lib \ qrencode_CPPFLAGS=-DWITH_QRENCODE \ qrencode_CFLAGS=-I$qrencode_dir/$qrencode_version/include \ qrencode_LIBS=-I$qrencode_dir/$qrencode_version/lib \ secp256k1_CFLAGS=-I$secp256k1_dir/include \ secp256k1_LIBS=-L$secp256k1_dir/lib

evoskuil commented 8 years ago

Yeah, that's why we have an installer and use package config -- but it's good learning.

evoskuil commented 8 years ago

BTW, the above issue should not require --with-png or --with-qrencode for resolution. As the error messages imply, --with-icu is all that is required.

skaht commented 8 years ago

@evoskuil you are indeed correct for a libbitcoin configure script. It should have looked like:

../libbitcoin/configure \ --prefix=$libbitcoin_dir \ --with-boost=$boost_dir/$boost_version/lib \ --with-icu=$icu_dir/$icu_version/lib \ --without-examples \ --enable-ndebug \ CPPFLAGS="-I$boost_dir/$boost_version/include -I$png_dir/$png_version/include -I$qrencode_dir/$qrencode_version/include" \ BOOST_LDFLAGS=-L$boost_dir/$boost_version/lib \ icu=-DWITH_ICU \ icu_i18n_CFLAGS=-I$icu_dir/$icu_version/include \ icu_i18n_LIBS=-L$icu_dir/$icu_version/lib \ png_CPPFLAGS=-DWITH_PNG \ png_CFLAGS=-I$png_dir/$png_version/include \ png_LIBS=-L$png_dir/$png_version/lib \ qrencode_CPPFLAGS=-DWITH_QRENCODE \ qrencode_CFLAGS=-I$qrencode_dir/$qrencode_version/include \ qrencode_LIBS=-I$qrencode_dir/$qrencode_version/lib \ secp256k1_CFLAGS=-I$secp256k1_dir/include \ secp256k1_LIBS=-L$secp256k1_dir/lib

A functioning libbitcoin-client configure script at this end looks like:

../libbitcoin-client/configure \ --prefix=$libbitcoin_client_dir \ --with-tests \ --without-examples \ --with-boost=$boost_dir/$boost_version/lib \ --disable-dependency-tracking \ CPPFLAGS="-I$boost_dir/$boost_version/include" \ BOOST_LDFLAGS=-L$boost_dir/$boost_version/lib \ czmq___LIBS="-L$czmqpp_dir/lib -lczmq++"

A functioning libbitcoin-network configure script at this end looks like:

../libbitcoin-network/configure \ --prefix=$libbitcoin_network_dir \ --with-tests \ --with-boost=$boost_dir/$boost_version/lib \ --disable-dependency-tracking \ CPPFLAGS=-I$boost_dir/$boost_version/include \ BOOST_LDFLAGS=-L$boost_dir/$boost_version/lib

evoskuil commented 8 years ago

The libbitcoin configure script doesn't require png or qrencode dependencies to prevent the ICU errors above, they are only required if you require use of the BX qrcode command.

skaht commented 8 years ago

Just validated that the following works fine using the configure scripts above:

% bx qrcode --image 12MmiixTLAwLjF8mkazeqebFE5FycjoNYc test.png

sinepgnol commented 2 years ago

I still get this "The command requires an ICU build." error when using the command mentioned in the original post. Can someone help me please? I have tried to compile the program but it just threw me a bunch of errors.

evoskuil commented 2 years ago

The downloadable build is non-ICU, so that's expected. If you have build errors please create an issue with details.