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

Modifications necessary to compile with clang/llvm on Linux #981

Open
gpshead opened this issue Dec 27, 2021 · 0 comments
Open

Modifications necessary to compile with clang/llvm on Linux #981

gpshead opened this issue Dec 27, 2021 · 0 comments

Comments

@gpshead
Copy link

gpshead commented Dec 27, 2021

To compile with clang on Linux a few small changes are necessary.

  1. Add the following to the make_devel.sh or similar build script before cmake for compilers like clang to work on Linux:
export LDFLAGS="-lstdc++ -lm"

To build with clang instead of gcc, people should set these before running the make script:

export CC=clang
export CXX=clang
export LD=ld.lld

That is sufficient for it to compile with clang 10 such as Ubuntu 20.04 has available as a package.

  1. For a recent version of clang (I used clang 13), the lib/libbech32 submodule needs a tweak to fix it's copy of googletest for Update googletest to compile on modern clang versions dcdpr/libbech32#9 by removing -Werror from the lib/libbech32/test/googletest/googletest/cmake/internal_utils.cmake file.

(Clang 10 and 13 produces a reliably 3% faster binary than Ubuntu 20.04's gcc 9.3 on my zen3.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant