How to compile Namecoin-Core static binaries?

Post Reply
grewalsatinder
Posts: 10
Joined: Mon May 09, 2016 8:43 am

How to compile Namecoin-Core static binaries?

Post by grewalsatinder »

Hi,

I tried compiling Namecoin-Core static binaries with:

Code: Select all

./configure CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768" --with-miniupnpc --disable-shared --enable-upnp-default
But after compile the binaries still shows some shared libraries to be present.

Code: Select all

satinder@ubuntu:~/nmc$ ./namecoind 
./namecoind: error while loading shared libraries: libzmq.so.3: cannot open shared object file: No such file or directory
satinder@ubuntu:~/nmc$ ld
ld             ldattach       ld.bfd         ldconfig       ldconfig.real  ldd            ld.gold        
satinder@ubuntu:~/nmc$ ld namecoind 
ld: warning: libzmq.so.3, needed by namecoind, not found (try using -rpath or -rpath-link)
ld: warning: libboost_program_options.so.1.55.0, needed by namecoind, not found (try using -rpath or -rpath-link)
ld: warning: libboost_thread.so.1.55.0, needed by namecoind, not found (try using -rpath or -rpath-link)
ld: warning: libboost_chrono.so.1.55.0, needed by namecoind, not found (try using -rpath or -rpath-link)
ld: warning: libdb_cxx-4.8.so, needed by namecoind, not found (try using -rpath or -rpath-link)
ld: warning: libevent_pthreads-2.0.so.5, needed by namecoind, not found (try using -rpath or -rpath-link)
ld: warning: cannot find entry symbol _start; not setting start address
namecoind: undefined reference to `boost::this_thread::interruption_point()'
namecoind: undefined reference to `DbTxn::commit(unsigned int)'
namecoind: undefined reference to `boost::thread::native_handle()'
namecoind: undefined reference to `boost::program_options::to_internal(std::string const&)'
namecoind: undefined reference to `zmq_strerror'
namecoind: undefined reference to `DbEnv::DbEnv(unsigned int)'
namecoind: undefined reference to `zmq_msg_init_size'
namecoind: undefined reference to `DbEnv::strerror(int)'
namecoind: undefined reference to `boost::detail::get_tss_data(void const*)'
namecoind: undefined reference to `Dbc::close()'
namecoind: undefined reference to `boost::thread::do_try_join_until_noexcept(timespec const&, bool&)'
namecoind: undefined reference to `boost::chrono::system_clock::now()'
namecoind: undefined reference to `boost::this_thread::disable_interruption::~disable_interruption()'
namecoind: undefined reference to `Dbc::get(Dbt*, Dbt*, unsigned int)'
namecoind: undefined reference to `Db::~Db()'
namecoind: undefined reference to `zmq_msg_send'
namecoind: undefined reference to `zmq_bind'
namecoind: undefined reference to `zmq_msg_data'
namecoind: undefined reference to `DbMpoolFile::set_flags(unsigned int, int)'
namecoind: undefined reference to `typeinfo for boost::detail::thread_data_base'
namecoind: undefined reference to `boost::detail::get_current_thread_data()'
namecoind: undefined reference to `boost::program_options::detail::common_config_file_iterator::common_config_file_iterator(std::set<std::string, std::less<std::string>, std::allocator<std::string> > const&, bool)'
namecoind: undefined reference to `boost::thread::joinable() const'
namecoind: undefined reference to `boost::this_thread::hiden::sleep_for(timespec const&)'
namecoind: undefined reference to `boost::detail::thread_data_base::~thread_data_base()'
namecoind: undefined reference to `DbEnv::version(int*, int*, int*)'
namecoind: undefined reference to `zmq_setsockopt'
namecoind: undefined reference to `evthread_use_pthreads'
namecoind: undefined reference to `boost::thread::detach()'
namecoind: undefined reference to `DbEnv::~DbEnv()'
namecoind: undefined reference to `boost::thread_detail::enter_once_region(boost::once_flag&)'
namecoind: undefined reference to `boost::chrono::steady_clock::now()'
namecoind: undefined reference to `boost::thread::hardware_concurrency()'
namecoind: undefined reference to `DbTxn::abort()'
namecoind: undefined reference to `boost::thread::join_noexcept()'
namecoind: undefined reference to `boost::thread::interrupt()'
namecoind: undefined reference to `Dbt::~Dbt()'
namecoind: undefined reference to `Db::remove(char const*, char const*, unsigned int)'
namecoind: undefined reference to `zmq_close'
namecoind: undefined reference to `zmq_msg_close'
namecoind: undefined reference to `DbEnv::remove(char const*, unsigned int)'
namecoind: undefined reference to `Db::Db(DbEnv*, unsigned int)'
namecoind: undefined reference to `boost::thread_detail::commit_once_region(boost::once_flag&)'
namecoind: undefined reference to `boost::thread::start_thread_noexcept()'
namecoind: undefined reference to `zmq_ctx_destroy'
namecoind: undefined reference to `boost::detail::set_tss_data(void const*, boost::shared_ptr<boost::detail::tss_cleanup_function>, void*, bool)'
namecoind: undefined reference to `Db::rename(char const*, char const*, char const*, unsigned int)'
namecoind: undefined reference to `Db::verify(char const*, char const*, std::ostream*, unsigned int)'
namecoind: undefined reference to `vtable for boost::detail::thread_data_base'
namecoind: undefined reference to `zmq_socket'
namecoind: undefined reference to `zmq_init'
namecoind: undefined reference to `boost::program_options::detail::common_config_file_iterator::get()'
namecoind: undefined reference to `boost::this_thread::disable_interruption::disable_interruption()'
namecoind: undefined reference to `boost::thread_detail::rollback_once_region(boost::once_flag&)'
namecoind: undefined reference to `Dbt::Dbt(void*, unsigned int)'
namecoind: undefined reference to `boost::thread::thread()'
namecoind: undefined reference to `Dbt::Dbt()'
I used help instructions from here:
https://github.com/namecoin/namecoin-co ... ld-unix.md

Thanks

somename
Posts: 80
Joined: Mon Sep 15, 2014 3:12 pm
os: windows

Re: How to compile Namecoin-Core static binaries?

Post by somename »

If you look at your error you'll see which library is missing (libzmq, libboost, etc.) so install them (mostly *-dev packages) and simplify your options (don't use --with-miniupnpc --enable-upnp-default).

You can refer to bitcoin build docs for details.

grewalsatinder
Posts: 10
Joined: Mon May 09, 2016 8:43 am

Re: How to compile Namecoin-Core static binaries?

Post by grewalsatinder »

somename wrote:If you look at your error you'll see which library is missing (libzmq, libboost, etc.) so install them (mostly *-dev packages) and simplify your options (don't use --with-miniupnpc --enable-upnp-default).

You can refer to bitcoin build docs for details.
Yes mate, I understand I need to install those libs which were showing in log.

My requirement was to make Namecon-Core binaries for ARM. Compile them once and keep it's backup. In case I need to flash the IoT device I could just copy the binaries and run them as system service. Good that the instructions on namecoin-core github docs works for ARM the same way I expected and to my requirements.

This is the same kinda way I expected for x86 architecture. I install fresh linux system, copy the binaries and run it without any issue.

When compiling with static libraries all the libs must be included in the final namecoin binaries. there shouldn't be anything which looking for shared libs on the system, except some basic c lib etc files. The reason is as common for all other software to avoid any library version incompatibility issue and keeping the software portable.

That's why I was expecting some ./configure etc instruction which could help me to compile static nameconi-core binaries for x86 as well.

Please help if you know any way.

EDIT: sure, I'll try bitcoin docs for instructions as well.

Thanks again,
Satinder :)

biolizard89
Posts: 2001
Joined: Tue Jun 05, 2012 6:25 am
os: linux

Re: How to compile Namecoin-Core static binaries?

Post by biolizard89 »

grewalsatinder wrote:
somename wrote:If you look at your error you'll see which library is missing (libzmq, libboost, etc.) so install them (mostly *-dev packages) and simplify your options (don't use --with-miniupnpc --enable-upnp-default).

You can refer to bitcoin build docs for details.
Yes mate, I understand I need to install those libs which were showing in log.

My requirement was to make Namecon-Core binaries for ARM. Compile them once and keep it's backup. In case I need to flash the IoT device I could just copy the binaries and run them as system service. Good that the instructions on namecoin-core github docs works for ARM the same way I expected and to my requirements.

This is the same kinda way I expected for x86 architecture. I install fresh linux system, copy the binaries and run it without any issue.

When compiling with static libraries all the libs must be included in the final namecoin binaries. there shouldn't be anything which looking for shared libs on the system, except some basic c lib etc files. The reason is as common for all other software to avoid any library version incompatibility issue and keeping the software portable.

That's why I was expecting some ./configure etc instruction which could help me to compile static nameconi-core binaries for x86 as well.

Please help if you know any way.

EDIT: sure, I'll try bitcoin docs for instructions as well.

Thanks again,
Satinder :)
Doing a depends build will generate static binaries. See these links:

https://github.com/namecoin/namecoin-co ... ompilation
https://github.com/namecoin/namecoin-co ... ompilation
https://github.com/namecoin/namecoin-co ... /README.md
Jeremy Rand, Lead Namecoin Application Engineer
NameID: id/jeremy
DyName: Dynamic DNS update client for .bit domains.

Donations: BTC 1EcUWRa9H6ZuWPkF3BDj6k4k1vCgv41ab8 ; NMC NFqbaS7ReiQ9MBmsowwcDSmp4iDznjmEh5

Post Reply