FreeBSD / FreeNAS installation guide?

Hello there,

After my HDD used with the oDroid C2 died, I decided to go for something a bit more reliable and went for better hardware running FreeNAS.

I read that FreeBSD is now supported since 2.1.0, but I can’t find anything related to the installation of a node.

Since I know the team makes excellent and complete documentation, I was wondering if I just missed it and if somebody could point me to it.

1 Like

Please ensure the dependencies listed under Linux are available in FreeBSD and your GCC is version 4.9+.

Also please see: https://zcash.readthedocs.io/en/latest/rtd_pages/user_guide.html#dependency-version-check

1 Like

On the target:

pkg install autoconf automake bash cmake gcc gmake libtool pkgconf

On the build machine:

HOST=armv6-freebsd ./zcutil/build.sh

That’s untested and I’m not 100% sure it’s the right value for HOST. If not then try armv6-unknown-freebsd.

1 Like

Sorry, I was not specific enough in my first post:
I installed FreeNAS on an x64 machine. So I imagine I don’t need to specify HOST as you mentioned?

First time I try FreeNAS… I guess I’ll have to spend a few hours before it works … :slight_smile:

1 Like

Oh right. That’s correct, you don’t need to specify HOST unless you’re cross-compiling for a different architecture/OS.

After a few hours of trying, this is what I achieved and where I got stuck:

After setting up a jail for zcash, I installed the dependencies as mentioned on github’s link @rex4539 posted, and similar to what @daira mentioned.

After installing git, I DL the source, then went to the download parameters step. with the following command: ./zcutil/fetch-params.sh

Which didn’t work. I had to edit that file and replace the first line with #!/usr/local/bin/bash

It then worked, gave a few error messages which were solved by installed flock and wget

Stuck at the build step:

The command ./zcutil/build.sh gives an error, which I believe is “normal” if I understand what is on github correctly, (and also what is mentioned as a comment in the build.sh file:

I need to enter :

MAKE=gmake ./zcutil/build.sh

But it doesn’t work and gives “MAKE=gmake command not found” message.

I couldn’t find a way to go beyond that point. Help is welcome :slight_smile:

Edit:

moved a bit further by typing “bash” then set MAKE=gmake, then start the build.sh script.

But new error:

  • LCOV_ARG=
  • HARDENING_ARG=–enable-hardening
  • TEST_ARG=
  • ‘[’ x = x–enable-lcov ‘]’
  • ‘[’ x = x–disable-tests ‘]’
  • MINING_ARG=
  • ‘[’ x = x–disable-mining ‘]’
  • PROTON_ARG=–enable-proton=no
  • ‘[’ x = x–enable-proton ‘]’
  • eval gmake --version
    ++ gmake --version
    GNU Make 4.2.1
    Built for amd64-portbld-freebsd11.3
    Copyright © 1988-2016 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
  • as --version
    GNU assembler 2.17.50 [FreeBSD] 2007-07-03
    Copyright 2007 Free Software Foundation, Inc.
    This program is free software; you may redistribute it under the terms of
    the GNU General Public License. This program has absolutely no warranty.
    This assembler was configured for a target of `x86_64-unknown-freebsd’.
  • ld -v
    GNU ld 2.17.50 [FreeBSD] 2007-07-03
  • HOST=zcash
  • BUILD=x86_64-unknown-freebsd11.3
  • NO_PROTON=–enable-proton=no
  • gmake -C ./depends/ V=1
    gmake: Entering directory ‘/root/zcash/depends’
    Invalid configuration zcash': machine zcash’ not recognized
    shasum: hosts/.mk: No such file or directory.

(The last line repeats many times. )

Quite a good topic, I have a lot of useful knowledge. Do not know you have solved the problem yet?
Thank you.

So with all that extra time at home, I tried again building on FreeNAS / FreeBSD and I went a step further (I hope in the right direction):

I added those 2 lines in the build.sh file:

MAKE=gmake
HOST=X86_64

And this seemed to solve the above mentioned issue. Of course, another one popped up:

[root@zcash ~/zcash]# ./zcutil/build.sh

  • LCOV_ARG=
  • HARDENING_ARG=–enable-hardening
  • TEST_ARG=
  • ‘[’ x = x–enable-lcov ‘]’
  • ‘[’ x = x–disable-tests ‘]’
  • MINING_ARG=
  • ‘[’ x = x–disable-mining ‘]’
  • PROTON_ARG=–enable-proton=no
  • ‘[’ x = x–enable-proton ‘]’
  • eval gmake --version
    ++ gmake --version
    GNU Make 4.2.1
    Built for amd64-portbld-freebsd11.3
    Copyright © 1988-2016 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
  • as --version
    GNU assembler 2.17.50 [FreeBSD] 2007-07-03
    Copyright 2007 Free Software Foundation, Inc.
    This program is free software; you may redistribute it under the terms of
    the GNU General Public License. This program has absolutely no warranty.
    This assembler was configured for a target of `x86_64-unknown-freebsd’.
  • ld -v
    GNU ld 2.17.50 [FreeBSD] 2007-07-03
  • HOST=x86_64-freebsd
  • BUILD=x86_64-unknown-freebsd11.3
  • NO_PROTON=–enable-proton=no
  • gmake -C ./depends/ V=1
    gmake: Entering directory ‘/root/zcash/depends’
    test: rust-std-1.36.0-x86_64-pc-freebsd.tar.gz: unexpected operator
    echo Building boost…
    Building boost…
    mkdir -p /root/zcash/depends/work/build/x86_64-freebsd/boost/1_70_0-16f98b7ce62/.
    cd /root/zcash/depends/work/build/x86_64-freebsd/boost/1_70_0-16f98b7ce62/.; PATH="/root/zcash/depends/x86_64-freebsd/native/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin" ./b2 -d2 -j2 -d1 --prefix=/root/zcash/depends/work/staging/x86_64-freebsd/boost/1_70_0-16f98b7ce62/root/zcash/depends/x86_64-freebsd --layout=system threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1 variant=release stage
    /bin/sh: ./b2: not found
    gmake: *** [funcs.mk:260: /root/zcash/depends/work/build/x86_64-freebsd/boost/1_70_0-16f98b7ce62/./.stamp_built] Error 127
    gmake: Leaving directory ‘/root/zcash/depends’
    [root@zcash ~/zcash]#

As usual, if anybody could help, that would be great :slight_smile:

And I did one last attempt: to cross compile on a fresh ubuntu install for freebsd, which went further than the 2 previous trials, but still no luck :frowning: I think I reached my limits and will give up for now. For info here what I get when I try to cross complie on ubuntu for freebsd:

It seems strange that rust cannot be downloaded…

HOST=x86_64-freebsd ./zcutil/build.sh -j$(nproc)
+ LCOV_ARG=
+ HARDENING_ARG=--enable-hardening
+ TEST_ARG=
+ '[' x-j4 = x--enable-lcov ']'
+ '[' x-j4 = x--disable-tests ']'
+ MINING_ARG=
+ '[' x-j4 = x--disable-mining ']'
+ PROTON_ARG=--enable-proton=no
+ '[' x-j4 = x--enable-proton ']'
+ eval make --version
++ make --version
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
+ as --version
GNU assembler (GNU Binutils for Ubuntu) 2.33
Copyright (C) 2019 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `x86_64-linux-gnu'.
+ ld -v
GNU ld (GNU Binutils for Ubuntu) 2.33
+ HOST=x86_64-freebsd
+ BUILD=x86_64-unknown-linux-gnu
+ NO_PROTON=--enable-proton=no
+ make -j4 -C ./depends/ V=1
make: Entering directory '/home/den/zcash/depends'
/bin/sh: 1: test: rust-std-1.36.0-x86_64-pc-freebsd.tar.gz: unexpected operator
mkdir -p /home/den/zcash/depends/sources/download-stamps /home/den/zcash/depends/sources
rm -f /home/den/zcash/depends/sources/download-stamps/.stamp_fetched-rust-rust-std-1.36.0-x86_64-pc-freebsd.tar.gz.hash
touch /home/den/zcash/depends/sources/download-stamps/.stamp_fetched-rust-rust-std-1.36.0-x86_64-pc-freebsd.tar.gz.hash
cd /home/den/zcash/depends/sources/download-stamps; (test -f /home/den/zcash/depends/sources/rust-std-1.36.0-x86_64-pc-freebsd.tar.gz || ( mkdir -p /home/den/zcash/depends/work/download/rust-1.36.0 && echo Fetching rust... && ( curl --location --fail --connect-timeout 10 --retry 3 -o "/home/den/zcash/depends/work/download/rust-1.36.0/rust-std-1.36.0-x86_64-pc-freebsd.tar.gz.temp" "https://download.z.cash/depends-sources/rust-std-1.36.0-x86_64-pc-freebsd.tar.gz" || curl --location --fail --connect-timeout 10 --retry 3 -o "/home/den/zcash/depends/work/download/rust-1.36.0/rust-std-1.36.0-x86_64-pc-freebsd.tar.gz.temp" "https://static.rust-lang.org/dist/rust-std-1.36.0-x86_64-pc-freebsd.tar.gz" ) && echo "eeeb1e9d0d7823c55f00f434789696e7249f465ba5966a5ab479040e3912c0e7  /home/den/zcash/depends/work/download/rust-1.36.0/rust-std-1.36.0-x86_64-pc-freebsd.tar.gz.temp" > /home/den/zcash/depends/work/download/rust-1.36.0/.rust-std-1.36.0-x86_64-pc-freebsd.tar.gz.hash && sha256sum -c /home/den/zcash/depends/work/download/rust-1.36.0/.rust-std-1.36.0-x86_64-pc-freebsd.tar.gz.hash && mv /home/den/zcash/depends/work/download/rust-1.36.0/rust-std-1.36.0-x86_64-pc-freebsd.tar.gz.temp /home/den/zcash/depends/sources/rust-std-1.36.0-x86_64-pc-freebsd.tar.gz && rm -rf /home/den/zcash/depends/work/download/rust-1.36.0 )) && (test -f /home/den/zcash/depends/sources/rust-1.36.0-x86_64-unknown-linux-gnu.tar.gz || ( mkdir -p /home/den/zcash/depends/work/download/rust-1.36.0 && echo Fetching rust... && ( curl --location --fail --connect-timeout 10 --retry 3 -o "/home/den/zcash/depends/work/download/rust-1.36.0/rust-1.36.0-x86_64-unknown-linux-gnu.tar.gz.temp" "https://download.z.cash/depends-sources/rust-1.36.0-x86_64-unknown-linux-gnu.tar.gz" || curl --location --fail --connect-timeout 10 --retry 3 -o "/home/den/zcash/depends/work/download/rust-1.36.0/rust-1.36.0-x86_64-unknown-linux-gnu.tar.gz.temp" "https://static.rust-lang.org/dist/rust-1.36.0-x86_64-unknown-linux-gnu.tar.gz" ) && echo "15e592ec52f14a0586dcebc87a957e472c4544e07359314f6354e2b8bd284c55  /home/den/zcash/depends/work/download/rust-1.36.0/rust-1.36.0-x86_64-unknown-linux-gnu.tar.gz.temp" > /home/den/zcash/depends/work/download/rust-1.36.0/.rust-1.36.0-x86_64-unknown-linux-gnu.tar.gz.hash && sha256sum -c /home/den/zcash/depends/work/download/rust-1.36.0/.rust-1.36.0-x86_64-unknown-linux-gnu.tar.gz.hash && mv /home/den/zcash/depends/work/download/rust-1.36.0/rust-1.36.0-x86_64-unknown-linux-gnu.tar.gz.temp /home/den/zcash/depends/sources/rust-1.36.0-x86_64-unknown-linux-gnu.tar.gz && rm -rf /home/den/zcash/depends/work/download/rust-1.36.0 ))
Fetching rust...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 
make: *** [funcs.mk:261: /home/den/zcash/depends/sources/download-stamps/.stamp_fetched-rust-rust-std-1.36.0-x86_64-pc-freebsd.tar.gz.hash] Error 22
make: Leaving directory '/home/den/zcash/depends'

Hi there,
I’m planning on building on FreeBSD but run on OpenBSD. Not sure if that’s going to work, as application building is totally new to me. It’s been all apt or dpkg for me… Thoughts?

More pertinently, this might be helpful: https://forums.freebsd.org/threads/freebsd-12-1-release-p3-rust-fails-to-build.75049/

Summary of above URL: allocate more RAM or swap. HTH.

2 Likes

@ldehaan9 Welcome to the forum :slight_smile:
Please, let us know your progress on Puffy’s OS.

Thanks, POT. Unfortunately, I didn’t make much progress. I couldn’t map the set of build requirements for the Linux environment to the OpenBSD environment. For example, finding what’s in the build-essential package on Linux didn’t allow me to find the equivalent packages in OpenBSD.

I also noticed that the C compiler in Linux Mint 20 is 9.3.0-17, while in OpenBSD 6.8 it is 4.2.1 20070719. I imagine that that by itself could be a major problem.

I chatted with a tech from the Horizen project, which is where I’m hopeful of deploying OpenBSD, who said he doesn’t believe the required work to backport BSD support to Zend hasn’t been done, though there IS support for a FreeBSD build target. Whatever that means. Sorry; looks like a bust at this point.

Update: I just came across this snippet:
pkg install autoconf automake bash cmake gcc gmake libtool pkgconf MAKE=gmake ./zcutil/build.sh
here: https://github.com/zcash/zcash/pull/4030
I’ll give it a shot on OpenBSD tonight and let you folks now. Fingers crossed :slight_smile:!

1 Like

Followed the instructions I found but ended up getting the below once all the packages were installed:

make: “/usr/home/laurens/zen/depends/Makefile” line 20: Missing dependency operator
make: “/usr/home/laurens/zen/depends/Makefile” line 23: Need an operator
make: “/usr/home/laurens/zen/depends/Makefile” line 25: Missing dependency operator

and a ton more similar errors:

Here are the referenced lines in vi:

 20 ifneq ($(HOST),)
 21 host:=$(HOST)
 22 host_toolchain:=$(HOST)-
 23 endif
 24
 25 ifneq ($(DEBUG),)
 26 

There was also this: make: “/usr/home/laurens/zen/depends/Makefile” line 70: Could not find hosts/.mk

and verified there was no hosts directory under the zen directory.

I tried both sh and bash, but they both gave the same errors. That’s that, I suppose. Good luck.

Strange: The laptop I used with Ubuntu on had 8gb of RAM. It should be more than enough. It works for ARM cross compile.

Also, curl returned a 404 error in that case.