LoginSignup
0
0

More than 5 years have passed since last update.

kotoをmacOSで掘る

Last updated at Posted at 2019-01-13

tipmona monya/mona tipkotone

国産仮想通貨のKOTOを掘ります。
仮想通貨についてや効率、etcは他の方の記事があるので省きます。
(というか、ただ単に知識不足で書けない)

TL;DR

  • mac特有の(?)ビルドできない問題は、zcashのマイニングする際のパッチを当てるコトで対応できた
  • kotoのCPUマイナー用のhomebrew formula書きました
  • $ brew install cj-bc/miners/koto-cpu-miner-yescrypt で使えます
  • ただし現状mac用のパッチ付きなのでlinuxbrewは待ってて 対応させました、ただし未テスト
  • これで簡単にマイニングできるね :star:

mac用にマイナーをビルドする

成功パターン

まず以下のパッチを適用します

  diff --git a/Makefile.am b/Makefile.am
  index b314ca7..66c7f74 100644
  --- a/Makefile.am
  +++ b/Makefile.am
  @@ -34,3 +34,5 @@ minerd_LDFLAGS  = $(PTHREAD_FLAGS)
   minerd_LDADD = @LIBCURL@ @JANSSON_LIBS@ @PTHREAD_LIBS@ @WS2_LIBS@
   minerd_CPPFLAGS = @LIBCURL_CPPFLAGS@
  -
  +# added for mac build; see commit message for details
  +ACLOCAL_AMFLAGS = -I m4
  diff --git a/autogen.sh b/autogen.sh
  index 989604a..46cbc2f 100755
  --- a/autogen.sh
  +++ b/autogen.sh
  @@ -5,7 +5,8 @@
  -
   set -e
  -
  -aclocal
  +# patched; refer commit message for details
  +aclocal -I m4
   autoheader
   automake --gnu --add-missing --copy
   autoconf

その上で、m4ディレクトリを作成しそこにlibcurl.m4を持ってきます:

  $ mkdir m4
  $ cp usr/local/Cellar/curl/7.5.1/share/aclocal/libcurl.m4 m4/

これを行なった後は元の手順どおりです。
一連の流れをまとめると:

  $ # 上記パッチを当てる
  $ mkdir m4
  $ cp usr/local/Cellar/curl/7.5.1/share/aclocal/libcurl.m4 m4/
  $ ./autogen.sh
  $ ./nomacro.pl
  $ ./configure CFLAGS='-O3'
  $ make

これによりビルドに成功するはずです

失敗パターン

初めに愚直に書いてある通りに実行すると以下のエラーが出ました

  <X_X>:cpuminer-yescrypt$ ./autogen.sh
  Makefile.am:12: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
  configure.ac:120: error: possibly undefined macro: AC_MSG_ERROR
        If this token and others are legitimate, please use m4_pattern_allow.
        See the Autoconf documentation.)

なんか疲れたので参考文献:
- https://stackoverflow.com/questions/8811381/possibly-undefined-macro-ac-msg-error

[2019-01-06 22:13]

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0