Ethereum

Bill Hill mail at wbh.org
Thu Jan 18 17:26:49 UTC 2018


On 17/01/2018 10:11, Mojca Miklavec wrote:

>> You are free to write a port and send it up to the macports system. If these meet the minimum specs it should be accepted in the ports tree. See the macport docs for details.
> 
> To make it clear, it's perfectly OK if unexperienced users request new
> ports. This may count as such a request. But there's a much higher
> probability that any package/port will end up in MacPorts if you try
> to write it yourself and ask for assistance while doing so. IRC might
> be slightly more efficient for communication, but macports-development
> list should work as well.
> 
> The sources for HomeBrew are probably here:
>     https://github.com/ethereum/homebrew-ethereum

I've no idea about writing a port, but here's my notes on compiling ethereum using macports. Just compiled, not extensively tested.

This macbook's running OSX 10.11.6 :-

$ uname -a
Darwin tango.lan 15.6.0 Darwin Kernel Version 15.6.0: Mon Nov 13 21:58:35 PST 2017; root:xnu-3248.72.11~1/RELEASE_X86_64 x86_64 i386 MacBook7,1 Darwin

$ port version
Version: 2.4.2

$ cmake --version
cmake version 3.10.1

$ which clang++
/opt/local/bin/clang++

$clang++ --version
clang version 5.0.1 (tags/RELEASE_501/final)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-5.0/bin


So try number one :-

git clone --recursive https://github.com/ethereum/cpp-ethereum.git
cd cpp-ethereum/
mkdir build
cd build
CXX=/opt/local/bin/clang++ cmake ..
make

This failed with an error in deps/src/libff/libff/common/profiling.cpp
complaining about this line :"::clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts)"

Some flailing around on google and it seems that this function only exists in OSX 10.12 but there are
work-arounds, e.g. https://stackoverflow.com/questions/5167269/clock-gettime-alternative-in-mac-os-x
So, very smelly hack: use the work-around already there in header oce/gettime_osx.h from macport oce;
i.e. add #include <oce/gettime_osx.h> to deps/src/libff/libff/common/profiling.cpp

Now compiles to completion.

$ ./eth/eth --version
eth version 1.3.0
eth network protocol version: 63
Client database version: 12041
Build: Darwin/clang/Interpreter/RelWithDebInfo

$ otool -L ./eth/eth
./eth/eth:
	/opt/local/lib/libleveldb.1.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)

The build uses a compile-time dependency system "hunter" https://docs.hunter.sh/en/latest/
and that sucks in quite a lot of stuff to ~/.hunter including a new copy of boost.

$ ls ~/.hunter/_Base/Download/
Boost/  Hunter/  Snappy/  cryptopp/  jsoncpp/  libjson-rpc-cpp/  yaml-cpp/

Don't know how that will interact with a macport.
NB oce and leveldb ports needed.


-- 
Red to red, black to black, switch it on, but stand well back.


More information about the macports-users mailing list