# Help me to compile and port Dash (digital cash cryptocurrency) in FreeBSD



## Vitalij Fleganov (Jun 24, 2016)

I can't compile dash.
Help me to compile and port Dash (digital cash cryptocurrency) in FreeBSD.
*

official site:*
https://www.dash.org/

*githab source:*
https://github.com/dashpay/dash


----------



## tobik@ (Jun 24, 2016)

*porter's handbook:*
https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/index.html


----------



## Vitalij Fleganov (Jun 25, 2016)

instruction: https://github.com/dashpay/dash/blob/master/INSTALL

1.
`$ make`


```
Making all in src
make[2]: don't know how to make all-am. Stop

make[2]: stopped in /mnt/2disk/portempa/dash/dash-master/src/obj
*** Error code 1

Stop.
make[1]: stopped in /mnt/2disk/portempa/dash/dash-master/src
*** Error code 1

Stop.
make: stopped in /mnt/2disk/portempa/dash/dash-master
```


2.
`$ gmake`


```
g++: internal compiler error: Killed (program cc1plus)
no stack trace because unwind library not available
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
gmake[2]: *** [Makefile:3802: libbitcoin_server_a-main.o] Error 4
gmake[2]: выход из каталога «/mnt/2disk/portempa/dash/dash-master/src»
gmake[1]: *** [Makefile:6780: all-recursive] Error 1
gmake[1]: выход из каталога «/mnt/2disk/portempa/dash/dash-master/src»
gmake: *** [Makefile:568: all-recursive] Error 1
```


----------



## tobik@ (Jun 25, 2016)

Which g++ version is installed? You can get it with `g++ -v`.

Try a newer one like e.g. lang/gcc5 or try with the system compiler (clang on FreeBSD >= 10). You will need to run the configure script again with `CXX=g++5 ./configure` or CXX=c++ (for the system compiler). It's best to wipe the slate clean before with `gmake distclean`.


----------



## Vitalij Fleganov (Jun 25, 2016)

1.
`$ g++ -v`


```
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc48/gcc/i386-portbld-freebsd10.1/4.8.5/lto-wrapper
Target: i386-portbld-freebsd10.1
Configured with: /wrkdirs/usr/ports/lang/gcc/work/gcc-4.8.5/configure --disable-multilib --disable-bootstrap --disable-nls --enable-gnu-indirect-function --libdir=/usr/local/lib/gcc48 --libexecdir=/usr/local/libexec/gcc48 --program-suffix=48 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc48/include/c++/ --with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --with-ecj-jar=/usr/local/share/java/ecj-4.5.jar --enable-languages=c,c++,objc,fortran,java --prefix=/usr/local --localstatedir=/var --mandir=/usr/local/man --infodir=/usr/local/info/gcc48 --build=i386-portbld-freebsd10.1
Thread model: posix
gcc version 4.8.5 (FreeBSD Ports Collection)
```


2.
`$ setenv CXX g++5`

`$ echo $CXX`


```
g++5
```


3.
`$ gmake distclean
$ gmake`


```
Making all in src
gmake[1]: вход в каталог «/mnt/2disk/portempa/dash/dash-master/src»
gmake[2]: вход в каталог «/mnt/2disk/portempa/dash/dash-master/src»
  CXX  libbitcoinconsensus_la-allocators.lo
  CXX  primitives/libbitcoinconsensus_la-transaction.lo
  CXX  crypto/libbitcoinconsensus_la-hmac_sha512.lo
  CXX  crypto/libbitcoinconsensus_la-sha1.lo
  CXX  crypto/libbitcoinconsensus_la-sha256.lo
  CXX  crypto/libbitcoinconsensus_la-sha512.lo
  CXX  crypto/libbitcoinconsensus_la-ripemd160.lo
  CXX  libbitcoinconsensus_la-eccryptoverify.lo
  CXX  libbitcoinconsensus_la-ecwrapper.lo
  CXX  libbitcoinconsensus_la-hash.lo
  CXX  libbitcoinconsensus_la-pubkey.lo
  CXX  script/libbitcoinconsensus_la-script.lo
  CXX  script/libbitcoinconsensus_la-interpreter.lo
  CXX  script/libbitcoinconsensus_la-bitcoinconsensus.lo
  CXX  libbitcoinconsensus_la-uint256.lo
  CXX  libbitcoinconsensus_la-utilstrencodings.lo
  CXXLD  libbitcoinconsensus.la
  CXX  dashd-dashd.o
  CXX  libbitcoin_server_a-addrman.o
  CXX  libbitcoin_server_a-alert.o
  CXX  libbitcoin_server_a-bloom.o
  CXX  libbitcoin_server_a-chain.o
  CXX  libbitcoin_server_a-checkpoints.o
  CXX  libbitcoin_server_a-init.o
  CXX  libbitcoin_server_a-leveldbwrapper.o
  CXX  libbitcoin_server_a-main.o
g++5: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
gmake[2]: *** [Makefile:3802: libbitcoin_server_a-main.o] Error 4
gmake[2]: выход из каталога «/mnt/2disk/portempa/dash/dash-master/src»
gmake[1]: *** [Makefile:6780: all-recursive] Error 1
gmake[1]: выход из каталога «/mnt/2disk/portempa/dash/dash-master/src»
gmake: *** [Makefile:568: all-recursive] Error 1
```


4.
`$ setenv CXX clang++`

`$ echo $CXX`


```
clang++
```

`$ gmake distclean`

`$./autogen.sh
$ ./configure`


```
...
checking for library containing clock_gettime... none required
checking for visibility attribute... yes
checking whether C++ compiler accepts -fvisibility=hidden... yes
checking for Berkeley DB C++ headers... no
configure: error: libdb_cxx headers missing
```


----------



## tobik@ (Jun 25, 2016)

Vitalij Fleganov said:


> ```
> ...
> checking for library containing clock_gettime... none required
> checking for visibility attribute... yes
> ...


Try with `setenv CFLAGS -I/usr/local/include` and `setenv LDFLAGS -L/usr/local/lib`.


----------



## Vitalij Fleganov (Jun 26, 2016)

*instructions:*
https://www.dash.org/forum/threads/compiling-on-freebsd-with-clang.364/

`$ uname -a`


```
FreeBSD openkomp 10.0-RELEASE-p10 FreeBSD 10.0-RELEASE-p10 #0: Mon Oct 20 12:38:37 UTC 2014  root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386
```

`$ g++ -v`


```
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc48/gcc/i386-portbld-freebsd10.1/4.8.5/lto-wrapper
Target: i386-portbld-freebsd10.1
Configured with: /wrkdirs/usr/ports/lang/gcc/work/gcc-4.8.5/configure --disable-multilib --disable-bootstrap --disable-nls --enable-gnu-indirect-function --libdir=/usr/local/lib/gcc48 --libexecdir=/usr/local/libexec/gcc48 --program-suffix=48 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc48/include/c++/ --with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --with-ecj-jar=/usr/local/share/java/ecj-4.5.jar --enable-languages=c,c++,objc,fortran,java --prefix=/usr/local --localstatedir=/var --mandir=/usr/local/man --infodir=/usr/local/info/gcc48 --build=i386-portbld-freebsd10.1
Thread model: posix
gcc version 4.8.5 (FreeBSD Ports Collection)
```


`$ setenv CC clang
$ setenv CXX c++
$ setenv CFLAGS -I/usr/local/include
$ setenv CXXFLAGS "-I/usr/local/include -I/usr/local/include/db48"
$ setenv LDFLAGS "-L/usr/local/lib -L/usr/local/lib/db48"

$ cd ./src

$ gmake distclean

$ cd ..
$ ./autogen.sh
$ ./configure
$ cd ./src

$ gmake -f Makefile`


```
GEN  qt/qrc_dash_locale.cpp
  CXX  qt/qt_libbitcoinqt_a-qrc_dash_locale.o
  AR  qt/libbitcoinqt.a
  OBJCXXLD qt/dash-qt
/usr/local/bin/ld: qt/qt_dash_qt-dash.o: undefined reference to symbol '_ZNSt3__18ios_base5clearEj'
//usr/lib/libc++.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
gmake[1]: *** [Makefile:2637: qt/dash-qt] Error 1
gmake[1]: выход из каталога «/mnt/2disk/portempa/dash/dash-master/src»
gmake: *** [Makefile:6780: all-recursive] Error 1
```


----------

