祝DASH Core 0.13.0.0
先日、 DASH Core が 0.12.3.4 → 0.13.0.0 にアップデートされたようだ
https://blog.dash.org/product-brief-dash-core-release-v0-13-0-5d7fddffb7ef
実は、0.12.3.4ベースに独自仮想通貨を作る自由研究をしていたんだけど、0.13.0.0 に上げてみたところ、ビルドが通らなくなっていた(汗)
環境つくりマニアとしては、ビルド出来る環境を作る事に。
ubuntuでビルド
今までは、ソースをダウンロードしてきて、
1 2 3 | . /autogen .sh . /configure make |
で、ビルドが出来ていたんだけどね(汗)
ubuntu16 や、macOS 10.12 とかでもビルド出来ていた。
0.13.0.0 の場合だと make した時に
1 2 3 4 | In file included from bls /bls .cpp:5:0: bls /bls .h:14:27: fatal error: chiabls /bls .hpp: No such file or directory compilation terminated. Makefile:9319: recipe for target 'bls/libdashconsensus_la-bls.lo' failed |
とエラー終了してしまうようだ。
対処方法は、、、depends ディレクトリに移動してから
1 | make -j2 |
を実行して依存関係を構築する必要があるようだ。
また、ビルド時は、以下のようにプラットフォームを指定する必要もありそう
1 2 3 4 5 6 | cd depends make -j2 cd .. . /autogen .sh CONFIG_SITE=` pwd ` /depends/x86_64-pc-linux-gnu/share/config .site . /configure --prefix=` pwd ` /depends/x86_64-pc-linux-gnu --disable-tests make -j2 |
こちら↓にちゃんと書いてあるではないか!
https://github.com/dashpay/dash/blob/master/doc/build-generic.md
これで、ubuntu18 及び、ubuntu16 では問題なくビルドが出来たが、ubuntu14 だと、途中でエラーになる。
./configure 実行時に以下エラーを吐き出した
1 2 3 4 5 6 | checking dependency style of g++ -m64... gcc3 checking whether g++ -m64 supports C++14 features with -std=c++14... no checking whether g++ -m64 supports C++14 features with -std=c++0x... no checking whether g++ -m64 supports C++14 features with +std=c++14... no checking whether g++ -m64 supports C++14 features with -h std=c++14... no configure: error: *** A compiler with support for C++14 language features is required. |
どうやら、gcc/g++のバージョンが低いのが原因っぽい
1 2 3 4 5 | $ gcc --version gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
そこで、ネットでググって、gcc/g++ のバージョンを上げてみる事にした
1 2 3 4 5 6 7 8 9 10 11 | sudo add-apt-repository ppa:ubuntu-toolchain-r /test sudo apt update sudo apt-get install gcc -6 g++-6 sudo update-alternatives -- install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g ++ g++ /usr/bin/g ++-6 $ gcc --version gcc (Ubuntu 6.5.0-2ubuntu1~14.04.1) 6.5.0 20181026 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
って事で、6.5になった!
再度、./configure を実行すると、見事に成功!
そして、make も無事に終わりビルドは成功に終わったのであった。
クロスコンパイル:Windows用バイナリーを作ってみる
次、クロスコンパイル
ubuntu上で、Windowsバイナリを作ってみる
以前は、ubuntu14では構築できたが、ubuntu16, ubuntu18 ではうまく行かなかったのだが。。。
1 2 3 4 5 6 | cd depends make HOST=x86_64-w64-mingw32 -j2 cd .. . /autogen .sh CONFIG_SITE=` pwd ` /depends/x86_64-w64-mingw32/share/config .site . /configure --prefix=` pwd ` /depends/x86_64-w64-mingw32 --disable-tests make -j2 |
で大丈夫のようだった。
が、ubuntu16, ubuntu18 の場合は、
https://github.com/dashpay/dash/blob/master/doc/build-cross.md
にあるように update-alternatives を叩く必要があった。
ubuntu18 OK
ubuntu16 OK
ubuntu14 NG
1 2 3 4 5 6 | checking dependency style of x86_64-w64-mingw32-g++... gcc3 checking whether x86_64-w64-mingw32-g++ supports C++14 features with -std=c++14... no checking whether x86_64-w64-mingw32-g++ supports C++14 features with -std=c++0x... no checking whether x86_64-w64-mingw32-g++ supports C++14 features with +std=c++14... no checking whether x86_64-w64-mingw32-g++ supports C++14 features with -h std=c++14... no configure: error: *** A compiler with support for C++14 language features is required. |
あら(汗)
見覚えのあるエラー。
x86_64-w64-mingw32-g++ もバージョンが低いってか(汗)
ん~~~。ubuntu14は諦め~~~。
クロスコンパイル:macOS用バイナリーを作ってみる
次、macOSのバイナリを作ってみる。こちら↓を見ると、下準備が必要そう。
https://github.com/dashpay/dash/blob/master/doc/build-cross.md
1 2 3 4 5 | mkdir -p depends /sdk-sources mkdir -p depends /SDKs curl https: //bitcoincore .org /depends-sources/sdks/MacOSX10 .11.sdk. tar .gz -o depends /sdk-sources/MacOSX10 .11.sdk. tar .gz tar -C depends /SDKs -xf depends /sdk-sources/MacOSX10 .11.sdk. tar .gz |
で展開すると、
1 2 3 | tar : Ignoring unknown extended header keyword 'SCHILY.dev' tar : Ignoring unknown extended header keyword 'SCHILY.ino' tar : Ignoring unknown extended header keyword 'SCHILY.nlink' |
と表示される、調べてみると、tarの違いのようだ。気持ち悪ので以下の方法で対処する。
1 | sudo apt install bsdtar |
を実行。するとメッセージも表示されず展開できるようだ。
1 | bsdtar -C depends /SDKs -xf depends /sdk-sources/MacOSX10 .11.sdk. tar .gz |
無事に展開されたようなので、以下のコマンド群でビルド
1 2 3 4 5 6 | cd depends make HOST=x86_64-apple-darwin11 -j2 cd .. . /autogen .sh CONFIG_SITE=` pwd ` /depends/x86_64-apple-darwin11/share/config .site . /configure --prefix=` pwd ` /depends/x86_64-apple-darwin11 --disable-tests make -j2 |
ビルドは通った
make deploy で必要なパッケージを入れる
1 | sudo apt install librsvg2-bin libtiff-tools |
make deploy によって生成された、dmg ファイルを、VMware上の macOS 10.12 に持っていき、起動出来る事が確認できた。
とりえず、ubuntu18 では、問題なかったので、おそらく ubuntu16 も大丈夫だろう。
以前は、ubuntuでmacOS用が作れなかったので、これは嬉しいw
で、ubuntu14 はきっとダメかな?
macOS 10.12 Sierra でビルド
順番逆なってますが、maxOS でビルドした時に気づいた点
depends 配下で make を実行すると x86_64-apple-darwin16.7.0 ってディレクトリが作成されました。
てっきり、x86_64-apple-darwin11 かと思ったら違ったです。
たしかに wiki なんか見ると、macOS Sierra は 16.x だもんなぁー
./configure は、こんな感じ↓
1 | CONFIG_SITE=` pwd ` /depends/x86_64-apple-darwin16 .7.0 /share/config .site . /configure --prefix=` pwd ` /depends/x86_64-apple-darwin16 .7.0 --disable-tests |
こちらも無事にビルドできた。
おわりに
Dash 0.13 は色々な変更があって、楽しそうですね。
仮想通貨絡みの大人の自由研究はまだまだ続きそうですw
コメント