:: Re: [Libbitcoin] libbitcoin compila…
Startseite
Nachricht löschen
Nachricht beantworten
Autor: Amir Taaki
Datum:  
To: libbitcoin
Betreff: Re: [Libbitcoin] libbitcoin compilation on OpenBSD
Adding in the mailing list. maybe someone else has input to help too.

On 15/12/13 17:57, Amir Taaki wrote:
> hey,
>
> sx depends on obelisk for the commands that use an obelisk server. you
> can disable building those commands but then you won't have sx history,
> sx balance .etc
>
> if that's ok then cool.
>
> does removing -ldl work? I'm not sure where that is added to the linker
> options but if you manage to remove that and it still works then we can
> see about fixing that too.
>
> On 15/12/13 09:58, mlmikael wrote:
>> so needed to get to next step now are either of:
>>
>> 1) get obelisk stop using "-ldl" - find console output of how that looks
>> below, or,
>>
>> 2) get sx not use obelisk, at least that would make sx start delivering
>>
>> maybe 2) easiest? like, --without-obelisk
>>
>>
>>
>>
>>
>>
>>
>> make
>> Making all in include/obelisk
>> Making all in src
>> /bin/sh ../libtool --tag=CXX --mode=link /usr/local/bin/eg++ -g -O2
>> -std=c++11 -o obbalancer balancer/balancer.o balancer/config.o -lobelisk
>> -L/usr/local/lib -lbitcoin -lboost_thread -lboost_system -lboost_regex
>> -lboost_filesystem -lpthread -lleveldb -lcurl -L/usr/local/lib -lzmq
>> -L/usr/local/lib -lconfig++
>> libtool: link: /usr/local/bin/eg++ -g -O2 -std=c++11 -o .libs/obbalancer
>> balancer/balancer.o balancer/config.o
>> -L/home/libbitcoin/obelisk/src/.libs -lobelisk -L/usr/local/lib
>> -lbitcoin -ldl -lboost_thread -lboost_system -lboost_regex
>> -lboost_filesystem -lleveldb -lcurl -lidn -lz -lintl -liconv -lc -lzmq
>> -lstdc++ -lm -lssl -lcrypto -lpthread -lconfig++ -Wl,-rpath,/usr/local/lib
>> /usr/bin/ld: cannot find -ldl
>> collect2: error: ld returned 1 exit status
>> *** Error 1 in src (Makefile:399 'obbalancer')
>> *** Error 1 in /home/libbitcoin/obelisk (Makefile:328 'all-recursive')
>>
>>
>>
>>
>>
>>
>>
>> On 2013-12-15 10:24, mlmikael wrote:
>>
>>> Hi Amir,
>>>
>>>
>>>
>>> The modification you proposed worked, and libbitcoin compiled. :D
>>>
>>>
>>>
>>> It needs to be tested though, to see that there's no libstdc++ version
>>> salad issues, and otherwise.
>>>
>>>
>>>
>>> So tried to compile sx, sx requires obelisk (why?, couldn't that be
>>> fixed, anyhow), so got into compiling obelisk.
>>>
>>>
>>>
>>> please be informed of the below, and let me know your answer to the 2)
>>> under obelisk - thanks!
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Re obelisk:
>>>
>>>
>>>
>>> 1) obelisk's configure.ac , same change as to libtool's configure.ac:
>>> change "AM_PROG_AR" to "m4_pattern_allow([AM_PROG_AR], [AM_PROG_AR])".
>>>
>>>
>>>
>>> 2) It tries to do "-ldl". This is a linuxism. For
>>> instance https://github.com/bitcoin/bitcoin/pull/1815 clarifies this.
>>>
>>> Tried to zap the -ldl but can't quite figure out -
>>>
>>> how do I make it not do -ldl?
>>>
>>>
>>>
>>> Re sx:
>>>
>>> 1)
>>>
>>> It searches for "libboost_thread" while the system offers
>>> "libboost_thread-mt".
>>> I hacked around it with ln -s /usr/local/lib/libboost_thread-mt.a
>>> /usr/local/lib/libboost_thread.a; ln -s
>>> /usr/local/lib/libboost_thread-mt.so.5.0
>>> /usr/local/lib/libboost_thread.so.5.0
>>>
>>> however if you could make it autodetect presence of libbost_thread-mt
>>> and use that instead would simpliify
>>>
>>> 2) zmq.hpp was not included in the zmq package, meaning
>>> wgetting https://github.com/zeromq/cppzmq/raw/master/zmq.hpp into
>>> /usr/local/include was a necessity.
>>>
>>> 3) CXX=/usr/local/bin/eg++ ./configure --libdir=/usr/local/lib
>>>
>>>
>>>
>>>
>>>
>>> On 2013-12-13 23:21, Amir Taaki wrote:
>>>
>>>     Try this modification, if it works then I'll change libbitcoin:

>>>
>>>     in include/blockchain/leveldb_blockchain.hpp, on the line near the
>>>     bottom which is like this:

>>>
>>>     boost::interprocess::file_lock* flock_;

>>>
>>>     then inside src/blockchain/leveldb/leveldb_blockchain.cpp

>>>
>>>     change:

>>>
>>>       flock_ = lock_path.c_str();

>>>
>>>     to this:

>>>
>>>       flock_ = new boost::interprocess::file_lock(lock_path.c_str());

>>>
>>>     and on the line that says:

>>>
>>>       if (!flock_.try_lock())

>>>
>>>     change the . to a ->

>>>
>>>       if (!flock_->try_lock())

>>>
>>>     it's not a good patch, but if it works (compiles) then I know what fix
>>>     to make.

>>>
>>>     On 13/12/13 17:02, mlmikael wrote:

>>>
>>>         Amir, Ok made some progress - First, g++ exceeds the virtual
>>>         memory allowance of the default ulimit, so to not need any
>>>         reconfig, just run make as root. Also as an alternative to
>>>         make, gmake can be used (pkg_add gmake; gmake). make / gmake
>>>         produces for this file and row
>>>         blockchain/leveldb/leveldb_blockchain.cpp (flock_ has no type
>>>         definition anywhere): touch_file.close(); flock_ =
>>>         lock_path.c_str(); <------------ if (!flock_.try_lock()) { the
>>>         output below. How fix? Thanks! libtool: compile:
>>>         /usr/local/bin/ec++ -DPACKAGE_NAME=\"libbitcoin\"
>>>         -DPACKAGE_TARNAME=\"libbitcoin\" -DPACKAGE_VERSION=\"1.0.10\"
>>>         "-DPACKAGE_STRING=\"libbitcoin 1.0.10\""
>>>         -DPACKAGE_BUGREPORT=\"amir@???
>>>         <mailto:amir@unsystem.net>\" -DPACKAGE_URL=\"\"
>>>         -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1
>>>         -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1
>>>         -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1
>>>         -DHAVE_UNISTD_H=1 -D__EXTENSIONS__=1 -D_ALL_SOURCE=1
>>>         -D_GNU_SOURCE=1 -D_POSIX_PTHREAD_SEMANTICS=1
>>>         -D_TANDEM_SOURCE=1 -DPACKAGE=\"libbitcoin\"
>>>         -DVERSION=\"1.0.10\" -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\"
>>>         -DHAVE_CXX11=1 "-DHAVE_BOOST=/**/" -I. -I. -I./../include
>>>         -ggdb -g3 -Wall -Wno-missing-braces -pedantic -Wextra
>>>         -fstack-protector-all -DDEBUG -g -O2 -std=c++11 -MT
>>>         blockchain/leveldb/leveldb_blockchain.lo -MD -MP -MF
>>>         blockchain/leveldb/.deps/leveldb_blockchain.Tpo -c
>>>         blockchain/leveldb/leveldb_blockchain.cpp -fPIC -DPIC -o
>>>         blockchain/leveldb/.libs/leveldb_blockchain.o
>>>         blockchain/leveldb/leveldb_blockchain.cpp: In member function
>>>         'bool libbitcoin::leveldb_blockchain::initialize(const
>>>         string&)': blockchain/leveldb/leveldb_blockchain.cpp:141:12:
>>>         error: no match for 'operator=' (operand types are
>>>         'boost::interprocess::file_lock' and 'const value_type* {aka
>>>         const char*}') flock_ = lock_path.c_str(); ^
>>>         blockchain/leveldb/leveldb_blockchain.cpp:141:12: note:
>>>         candidates are: In file included from
>>>         /usr/local/include/boost/move/utility.hpp:18:0, from
>>>         /usr/local/include/boost/move/move.hpp:21, from
>>>         /usr/local/include/boost/interprocess/sync/file_lock.hpp:24,
>>>         from
>>>         ./../include/bitcoin/blockchain/leveldb_blockchain.hpp:24,
>>>         from blockchain/leveldb/leveldb_blockchain.cpp:19:
>>>         /usr/local/include/boost/interprocess/sync/file_lock.hpp:42:4:
>>>         note: boost::interprocess::file_lock&
>>>         boost::interprocess::file_lock::operator=(boost::interprocess::file_lock&)
>>>         BOOST_MOVABLE_BUT_NOT_COPYABLE(file_lock) ^
>>>         /usr/local/include/boost/interprocess/sync/file_lock.hpp:42:4:
>>>         note: no known conversion for argument 1 from 'const
>>>         value_type* {aka const char*}' to
>>>         'boost::interprocess::file_lock&' In file included from
>>>         ./../include/bitcoin/blockchain/leveldb_blockchain.hpp:24:0,
>>>         from blockchain/leveldb/leveldb_blockchain.cpp:19:
>>>         /usr/local/include/boost/interprocess/sync/file_lock.hpp:66:15: note:
>>>         boost::interprocess::file_lock&
>>>         boost::interprocess::file_lock::operator=(boost::rv<boost::interprocess::file_lock>&)
>>>         file_lock &operator=(BOOST_RV_REF(file_lock) moved) ^
>>>         /usr/local/include/boost/interprocess/sync/file_lock.hpp:66:15: note:
>>>         no known conversion for argument 1 from 'const value_type*
>>>         {aka const char*}' to
>>>         'boost::rv<boost::interprocess::file_lock>&' gmake[1]: ***
>>>         [blockchain/leveldb/leveldb_blockchain.lo] Error 1 gmake[1]:
>>>         Leaving directory `/home/libbitcoin/libbitcoin/src' gmake: ***
>>>         [all-recursive] Error 1 On 2013-12-12 23:55, Amir Taaki wrote:

>>>
>>>             Hey, this setup is too old. The autotools are outdated,
>>>             and g++ 4.7 or higher is required. C++11 is not
>>>             implemented in older compilers. autotools/autoconf seem
>>>             like the right version though but maybe they are missing
>>>             newer extensions.

>>>
>>>                 Hi guys, So, now installed OpenBSD on a virtual
>>>                 machine. Find the machine's HDD image here: As a
>>>                 VMWare disk image file, gunzip it, should take like 1
>>>                 minute to plug in to your local VMWare Workstation
>>>                 installation!:
>>>                 http://sprend.com/download.htm?C=ef8c0cf9f98b43168809adcaf0f8bd01
>>>                 Raw gzipped HD image (gotten with dd if=/dev/rwd0c
>>>                 bs=102400 | nc localhost 2000 + nc -l -p 2000 | gzip
>>>                 -1 > obsd-libbitcoin-raw-hdimage.gz . note that
>>>                 /dev/rwd0c in OBSD would be the same as /dev/hd0 in
>>>                 Linux - note that the dd was made while the machine
>>>                 was on, so you may be dropped to emergency console and
>>>                 need to do fsck on /dev/rwd0a & -b & -d .. -g and then
>>>                 "exit"):
>>>                 http://sprend.com/download.htm?C=6dad177d0cd9490fa6da5808143bae33
>>>                 Please note that the file is removed from the hosting
>>>                 120 minutes after you clicked download. And last, find
>>>                 below how I put it together, exactly. On boot it will
>>>                 pick up an IP using DHCP. libbitcoin has been git
>>>                 cloned into the "libbitcoin" user account with pw
>>>                 "libbitcoin", and the root password is "rootpassword".
>>>                 All the build tools that you need should be installed
>>>                 - if anything is missing please let me know and i'll
>>>                 send a new version of the hdd image. So now you
>>>                 probably want to log in as libbitcoin and do cd
>>>                 libbitcoin; autoreconf -i , this fails. With sx, "cd
>>>                 ~/sx; autoreconf -i" worked! :D and ./configure fails
>>>                 saying libbitcoin is not installed, which is correct.
>>>                 With obelisk, "cd ~/obelisk; autoreconf -i" fails. You
>>>                 can get this going on your desktop and server
>>>                 environments pretty much instantly; Please let me know
>>>                 you got it running, if I can improve anyting, and,
>>>                 please let me know when you have any news on making it
>>>                 compile on OBSD, would be great if we can get to this
>>>                 the next couple of days now - Best regards, mlmikael *
>>>                 Installed VMWare Workstation (not using VirtualBox as
>>>                 it prohibits an RDMSR that OBSD tries to use on my
>>>                 particular processor - vbox guys working on solution,
>>>                 and also using vbox 4.2 would have worked.) * Created
>>>                 a VMWare machine, chose operating system as "Other
>>>                 (64bit)", 25GB disk "as single file", NAT only, used
>>>                 image
>>>                 http://athena.caslab.queensu.ca/pub/OpenBSD/5.4/amd64/install54.iso
>>>                 . * Installed. The only things different from default
>>>                 option was: Hostname: libbitcoin Root password:
>>>                 rootpassword After installation disconnected ISO
>>>                 image. * Rebooted, logged in to root via ssh (IP the
>>>                 one autoassigned by dhclient on boot). * Edited
>>>                 /etc/fstab adding ",noatime,softdep" to all the FS:es.
>>>                 Rebooted * Login and init account by: echo "export
>>>                 PKG_PATH=http://athena.caslab.queensu.ca/pub/OpenBSD/5.4/packages/amd64/"

>>>
>>>
>>>                         .profile

>>>
>>>                 * Re-login and ran: pkg_add bash vim-7.3.850-gtk2
>>>                 g++-4.8.1p0 autoconf-2.69p0 rsync-3.0.9p3-iconv
>>>                 git-1.8.3.3 boost-1.53.0p1 curl-7.26.0p3
>>>                 leveldb-1.5.0p1 libtool-2.4.2 automake-1.9.6p10
>>>                 zeromq-3.2.3 libconfig-1.4.8 * Added user libbitcoin
>>>                 pw libbitcoin using "adduser", default shell bash,
>>>                 group wheel. * Logged in as libbitcoin and to init
>>>                 account by: echo
>>>                 "PS1='${chrootv:+($chrootv)}[33[01;32m]u@h[33
>>>                 <mailto:u@h[33> <mailto:u@h[33
>>>                 <mailto:u@h[33>>[00m]:[33[1;34m]w[33[00m]$ '" >>
>>>                 .profile # (needed for using autoconf and automake,
>>>                 which you will do.) echo "export
>>>                 AUTOCONF_VERSION=2.69" >> .profile echo "export
>>>                 AUTOMAKE_VERSION=1.9"

>>>
>>>                         .profile * Logged out and logged in again and:
>>>                         git clone

>>>
>>>                 https://github.com/spesmilo/libbitcoin.git git clone
>>>                 https://github.com/spesmilo/sx.git git clone
>>>                 https://github.com/spesmilo/obelisk.git * Then to make
>>>                 an attempt at compiling libbitcoin: cd libbitcoin
>>>                 autoreconf -i On 2013-12-10 02:45, Amir Taaki wrote:

>>>
>>>
>>>
>>>
>>
>>
>>
>>
>