Getting error while building Bitcoind on m1 MAC OS - macos

So I'm trying to build bitcoind on big sur in my m1 mac through following the documentation for building bitcoind for OS X: https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md and I've had the same error every time I try and build. Here are the steps I take:
brew install autoconf automake berkeley-db4 libtool boost miniupnpc openssl pkg-config protobuf qt5
git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin
./autogen.sh
./configure --with-gui=no
After the configuration I get the following message:
checking for boostlib >= 1.58.0 (105800)... configure: We could not detect the boost libraries (version 1.58.0 or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.
I don't get why it's not detecting the library...
Can anyone help me out?

I had the same problem and I solved it this way:
cd depends/
make
# After completing this step, you will see one new folder (arm-apple-darwin20.4.0) in /bitcoin/depends. The version number may change
# Go back to bitcoin folder
cd ..
# Set up the compilation tool
./configure --with-gui=no --prefix=$PWD/depends/arm-apple-darwin20.4.0
# change the version ...darwin20.x.x with what you have in depends directory
# Start to compile bitcoin
make HOST=arm-apple-darwin20
make check
You can see the bitcoind binary in the src directory. Enjoy :)
source:
https://gist.github.com/awesome-doge/9bfbd1d3fd9b725c4df224433fa3596e

Related

Installing Ruby 1.9.x on macOS 10.13 (High Sierra)

I've recently decided to look at an old Rails app running Ruby 1.9.2 and decided to try to install 1.9.2 on my macOS 10.13 machine.
I'm aware that gcc no longer ships with macOS so I remembered the old trick of using Homebrew Core's apple-gcc42 recipe, sadly the maximum version this works with is 10.9 (Mavericks). I tried my luck anyway and even followd rbenv's gcc compatibility notes:
(Note that Ruby < 2.0 does not have the with-readline-dir flag; use with-opt-dir instead.)
I tried the following command (note that I have rbenv's ruby-build plugin installed and up-to-date):
RUBY_CONFIGURE_OPTS="--with-opt-dir=/usr/local/opt/" CC=/usr/local/bin/gcc-4.2 rbenv install 1.9.2-p180
ruby-build: use libyaml from homebrew
Downloading ruby-1.9.2-p180.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p180.tar.bz2
Installing ruby-1.9.2-p180...
WARNING: ruby-1.9.2-p180 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.
ruby-build: use readline from homebrew
BUILD FAILED (OS X 10.13.3 using ruby-build 20180329)
Inspect or clean up the working tree at /var/folders/0t/hft4_1h13wqd91mwcw2j94h80000gn/T/ruby-build.20180407090310.93949
Results logged to /var/folders/0t/hft4_1h13wqd91mwcw2j94h80000gn/T/ruby-build.20180407090310.93949.log
Last 10 log lines:
/var/folders/0t/hft4_1h13wqd91mwcw2j94h80000gn/T/ruby-build.20180407090310.93949 /usr/local/bin
/var/folders/0t/hft4_1h13wqd91mwcw2j94h80000gn/T/ruby-build.20180407090310.93949/ruby-1.9.2-p180 /var/folders/0t/hft4_1h13wqd91mwcw2j94h80000gn/T/ruby-build.20180407090310.93949 /usr/local/bin
configure: WARNING: unrecognized options: --with-openssl-dir, --with-libyaml-dir, --with-readline-dir
checking build system type... i386-apple-darwin17.4.0
checking host system type... i386-apple-darwin17.4.0
checking target system type... i386-apple-darwin17.4.0
checking whether the C compiler works... no
configure: error: in `/var/folders/0t/hft4_1h13wqd91mwcw2j94h80000gn/T/ruby-build.20180407090310.93949/ruby-1.9.2-p180':
configure: error: C compiler cannot create executables
See `config.log' for more details
The error on the config.log is the same as the one output above:
configure:3446: error: C compiler cannot create executables
I tried to compile a basic file with C code and gcc-4.2 failed to do so (unlike /usr/local/bin/gcc) which I tells me gcc-4.2 simply doesn't work on macOS 10.13 right now. Perhaps the only way forward would be to find a way to compile old Rubies with modern gcc versions, but I'm guessing that might involve making a lot of manual changes to the configure files to make them compatible.
I'm just curious if anyone's succeeded in this endeavor or if this is a lost cause.
It's probably possible with rvm have a look at https://github.com/rvm/rvm/issues/3099 and also https://github.com/rvm/rvm/issues/3876
You should be able to install ruby-1.9.3
But if that doesn't work, you might consider spinning up a docker ubuntu container and install it that way? https://github.com/rvm/ubuntu_rvm

Building libzmq with libsodium

Edit as of ZMQ version 4.1:
Configure automatically looks for libsodium, so this is no longer required. If for some reason you wish to build it WITHOUT libsodium and you have it built and installed, configure libzmq with '--without-libsodium'.
So I'm having problems building/making zeromq with libsodium.
im using msys2 as the shell - specifically the mingw32_shell - , and zmq 4.1.0 rc1 with libsodium 1.0.1 and mingw-w64 32bit (gcc 4.9.2).
im currently able to compile libsodium like this
cd .../libsodium
bash configure
make
make check
make install
and everything is fine, all the tests pass and the libs and includes end up in the /usr/local/ folders that msys2 seems to know about.
then when i try to build zeromq with these commands
cd .../zeromq
bash configure --with-libsodium
make
make check
make install
i never get past the configure stage, as configure returns
checking for sodium_init in -lsodium... no
configure: error: libsodium is not installed. Install it or don't pass --with-libsodium to configure script
i have tried the methods suggested in this post - ZeroMQ doesn't spot libsodium - but to no success.
therefore my question is thus: how do i either set the locations for zeromq's configure to look for libsodium to spot, whether with --with-libsodium, --with-libsodium-include-dir= and --with-libsodium-lib-dir=, or have them 'installed' in a location that msys2's shell is able to find?
I assume you tried it already since the link you provided mentions it:
--with-libsodium=/usr/local
I tried this and it worked for me. However, I don't recommend this because for MSYS2, it is cleaner if /usr/local is used only for MSYS2 software, and not MinGW-w64 software. For MinGW-w64 i686 software, the 'right' prefix for 'local' is /mingw32/local
I've just now added libsodium as a dependency on the zeromq package.
Github MinGW-w64 zeromq PKGBUILD commit e32ae0
I will ask Alexey to rebuild and repackage it tomorrow.

Building libvorbis from source using Mingw: "You must have automake installed to compile vorbis"

I am trying to port a project I made on gnu/linux to windows. The project uses the vorbis library to decode ".ogg" files.
I need to build the project from source as I could not find any pre-built binaries for windows. On linux I just installed the "libvorbis-dev" package.
The README tells me that I should type ./autogen.sh followed by make inorder to build the library.
When I type ./autogen.sh in the msys terminal I get the following output:
checking for autoconf...
checking for automake 1.11 or later... no
checking for aclocal 1.11 or later... no
You must have automake installed to compile vorbis.
Download the appropriate package for your distribution,
or get the source tarball at ftp://ftp.gnu.org/pub/gnu/
I have tried installing this http://gnuwin32.sourceforge.net/packages/automake.htm but I still get the same error.
Any help that can get this library to work and link on windows will be greatly appreciated.
You need to use the MSYS version of automake. You can install it with mingw-get install msys-automake or you can download it directly:
http://sourceforge.net/projects/mingw/files/MSYS/msysdev/automake/

Error during RNNLib configuration: netcdfcpp.h cannot be found

When attempting to compile RNNLib, I got an error in NetcdfDataset.hpp:26:24 saying that Netcdfcpp.h could not be found. I looked around and found a bug report from 2011 that suggested that this was a bug, but it claimed to have been fixed. I have tried everything I can think of, including rebuilding NetCDF (a dependency of RNNLib) with various different flags, and have been unable to fix this bug. Can anyone give me a hand?
I had some trouble on a virtual machine building rnnlib.
I had to install the C and C++ version of NetCDF to get it to work.
The C version can be installed via sudo apt-get install libnetcdf-dev
I had to install the C++ version by building it.
Hope it will help. It's quite a difficult lib to install.
Maybe this helps someone: you can avoid some of the pain by installing packages from APT, and access the correct version mentioned by user3620756, which contains the netcdfcpp.h header file
. This happens through a legacy package, available on Ubuntun 16.04 (Xenial universe, see APT repository).
First install libnetcdf for C, then install libnetcdf-cxx-legacy-dev which should depend on libnetcdf-c++4 and install required C++ libraries on the go:
sudo apt install libnetcdf-dev libnetcdf-cxx-legacy-dev
The newest version doesn't have this netcdfcpp.h file anymore.
I had to use ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-cxx-4.2.tar.gz to get it working.
I have also followed the same process and it worked for me
"The newest version doesn't have this netcdfcpp.h file anymore. I had to use ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-cxx-4.2.tar.gz to get it working."
After downloading the folder, I had to build it by entering into the netcdf folder. I used simple command for the task :
.\configure
make
sudo make install
But in the file named as "NetcdfDataset.hpp", I have to give the complete path of the netcdfcpp.h file. For my case the path of the include file is :
#include "/Volumes/Macintosh_HD_2/WordSpottingProj/trunk/CODE C++/rnnlib_source_forge_version/netcdf-cxx-4.2/cxx/netcdfcpp.h"
I had this problem in the context of trying to use a makefile that called for netcdfcpp.h:
$ make -f makefile_MAC
c++ -O2 -o burn7.x burn7.cpp -I/opt/local/include -L/opt/local/lib -lm -lnetcdf_c++
burn7.cpp:31:10: fatal error: 'netcdfcpp.h' file not found
#include <netcdfcpp.h>
^
1 error generated.
make: *** [burn7.x] Error 1
I'm on a Mac, so I used Homewbrew to install the NetCDF package, but version 4.3.3.1 didn't appear to have netcdfcpp.h:
brew install homebrew/science/netcdf
However, I found that installing it with an additional flag resulted in this version being included:
brew install homebrew/science/netcdf --with-cxx-compat
I assume that the same is true of other installation/compilation methods, and not that this file has been taken out of versions since 4.2 as others answers state. Maybe it was a default option before and now it isn't?

How do I get ruby-svm to look for libraries in macports' /opt/local?

I want to install Ruby SVM. I already have macports with normal settings, and installed libsvm via port just fine. But when I go to compile rubysvm, it barfs. :(
Ruby SVM: http://rubysvm.cilibrar.com/download/ (most links are 404 though)
libsvm: http://www.csie.ntu.edu.tw/~cjlin/libsvm/
Try this:
sudo port install libsvm
wget http://debian.cilibrar.com/debian/pool/main/libs/libsvm-ruby/libsvm-ruby_2.8.4.orig.tar.gz
tar -xzf libsvm-ruby_2.8.4.orig.tar.gz
cd libsvm-ruby-2.8.4
./configure
... and you get the error:
...
checking libsvm/svm.h usability... no
checking libsvm/svm.h presence... no
checking for libsvm/svm.h... no
Error, cannot find LIBSVM svm.h header.
I've tried this, without success:
export DYLD_LIBRARY_PATH=/opt/local/include/:/opt/local/lib/
(... ditto for C_INCLUDE_PATH, LD_LIBRARY_PATH, CPATH, & LIBRARY_PATH)
LDFLAGS="-I/opt/local/include -L/opt/local/lib" CPPFLAGS="-I/opt/local/include -L/opt/local/lib" ./configure
How do I fix this?
libsvm-ruby assumes libsvm installs its header in PREFIX/include/libsvm/svm.h, but the macports package puts it in /opt/local/include.
It's a kludge, but the easiest fix is to manually make the directory /opt/local/include/libsvm and move/copy the svm.h header there. You may still need to run your configure command with the LDFLAGS and CPPFLAGS settings since it looks like the macports install doesn't update pkg-config (which libsvm-ruby uses to try to find the compiler flags).
I'd report this as a package bug to the macports maintainer. If you understand macport's Portfiles, you can probably even provide a patch.
Update: I haven't actually tried this, so there may be other issues once you get past the header file detection.
Update 2: I was able to get past configure with:
sudo mkdir /opt/local/include/libsvm
sudo cp /opt/local/include/svm /opt/local/include/libsvm/
CPPFLAGS=-I/opt/local/include LIBS=-L/opt/local/lib ./configure
But libsvm-ruby appears to depend on obstack.h, which doesn't exist natively on OS X. Based on this, there might be a way to copy in the files that you need, but you'll need to patch the libsvm-ruby main.cpp and Makefile to link that in.
Good luck!

Resources