Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added FreeBSD build instructions #690

Merged
merged 2 commits into from
Jul 19, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions docs/00_install/01_build-from-source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,31 @@ make -j $(nproc) package
After building you may remove the `$HOME/boost1.79` directory, or you may keep it around until next time building the software.
</details>

<details>
<summary>FreeBSD 13.1 Build Instructions</summary>

Install required dependencies:
```
pkg update && pkg install \
git \
cmake \
curl \
boost-all \
python3 \
openssl \
llvm11 \
pkgconf
```
and perform the build (please note that FreeBSD 13.1 comes with llvm13 by default so you should provide clang11 options to cmake):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LLVM should actually not be required on freebsd; it's only required on Linux. The code that uses LLVM in mandel isn't clutched in on anything but Linux

mandel/CMakeLists.txt

Lines 72 to 76 in b5132e5

if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
list(APPEND EOSIO_WASM_RUNTIMES eos-vm-oc)
# EOS VM OC requires LLVM, but move the check up here to a central location so that the EosioTester.cmakes
# can be created with the exact version found
find_package(LLVM REQUIRED CONFIG)

Did you try just using the latest default clang that comes with freebsd? Historically clang12+ w/ GNU's libstdc++ (how typically configured on Linux) breaks due to still unfixed defect in EOS VM:

macOS seems to build fine with the latest Xcode which makes me wonder if latest clang may work with LLVM's libc++ on freebsd?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default vanilla installation of FreeBSD 13.1 comes with clang 13 and compilation fails with exact issue you pointed out :) So unfortunately clang needs to be rolled back there. FreeBSD port "llvm11" is just the easiest and most trouble-free way to install working clang11...

```
git submodule update --init --recursive
mkdir build
cd build
cmake -DCMAKE_CXX_COMPILER=clang++11 -DCMAKE_C_COMPILER=clang11 -DCMAKE_BUILD_TYPE=Release ..
make -j $(nproc) package
```
</details>

### Running Tests

When building from source it's recommended to run at least what we refer to as the "parallelizable tests". Not included by default in the "parallelizable tests" are the WASM spec tests which can add additional coverage and can also be run in parallel.
Expand Down