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

Resim build failure on Arch Linux: documentation/change suggestion #1038

Open
rynoV opened this issue May 17, 2023 · 2 comments
Open

Resim build failure on Arch Linux: documentation/change suggestion #1038

rynoV opened this issue May 17, 2023 · 2 comments

Comments

@rynoV
Copy link

rynoV commented May 17, 2023

I tried installing Resim (the simulator folder) on Arch Linux and ran into an error at the cargo install --path ./simulator step:

  error occurred: Command "sccache" "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "rocksdb/include/" "-I" "rocksdb/" "-I" "rocksdb/third-party/gtest-1.8.1/fused-src/" "-I" "snappy/" "-I" "lz4/lib/" "-I" "/home/calum/.local/share/.cargo/registry/src/github.com-1ecc6299db9ec823/zstd-sys-2.0.8+zstd.1.5.5/zstd/lib" "-I" "/home/calum/scripts/radix/radixdlt-scrypto/simulator/target/release/build/libz-sys-141b3fa7e129c0c6/out/include" "-I" "/home/calum/scripts/radix/radixdlt-scrypto/simulator/target/release/build/bzip2-sys-f5f4e66a40c6cff1/out/include" "-I" "." "-Wall" "-Wextra" "-std=c++17" "-Wsign-compare" "-Wshadow" "-Wno-unused-parameter" "-Wno-unused-variable" "-Woverloaded-virtual" "-Wnon-virtual-dtor" "-Wno-missing-field-initializers" "-Wno-strict-aliasing" "-Wno-invalid-offsetof" "-msse2" "-std=c++17" "-DSNAPPY=1" "-DLZ4=1" "-DZSTD=1" "-DZLIB=1" "-DBZIP2=1" "-DNDEBUG=1" "-DOS_LINUX" "-DROCKSDB_PLATFORM_POSIX" "-DROCKSDB_LIB_IO_POSIX" "-DROCKSDB_SUPPORT_THREAD_LOCAL" "-DHAVE_UINT128_EXTENSION=1" "-DHAVE_UINT128_EXTENSION=1" "-o" "/home/calum/scripts/radix/radixdlt-scrypto/simulator/target/release/build/librocksdb-sys-f236cfdc4d0cf710/out/rocksdb/table/block_based/data_block_hash_index.o" "-c" "rocksdb/table/block_based/data_block_hash_index.cc" with args "c++" did not execute successfully (status code exit status: 1).

There were also a bunch of errors like

  cargo:warning=In file included from rocksdb/table/block_based/data_block_hash_index.cc:9:
  cargo:warning=rocksdb/table/block_based/data_block_hash_index.h:65:7: error: ‘uint8_t’ does not name a type
  cargo:warning=   65 | const uint8_t kNoEntry = 255;
  cargo:warning=      |       ^~~~~~~
  cargo:warning=rocksdb/table/block_based/data_block_hash_index.h:1:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
  cargo:warning=  +++ |+#include <cstdint>
  cargo:warning=    1 | // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.

LLVM and C++ were installed through arch's standard repositories. It was also the same error after disabling sccache.

At first I updated the rocksdb dependency in radix-engine-stores from 0.19.0 to 0.21.0, and this fixed the build for me and the install seemed to be successful. I'm not sure if this would silently break things though.

Then my colleague pointed out that Arch's default gcc installation has some breaking changes, so the fix was:

  1. Install libc++ via pacman

  2. Set the environment variables: export CC=clang CXX=clang++ CXXFLAGS="-stdlib=libc++"

  3. In the simulator folder, add a build.rs file with contents:

    fn main() {
      println!("cargo:rustc-link-lib=c++");
    }

And this also fixed the installation.

@fibble
Copy link

fibble commented Jun 27, 2023

This solved build errors for me on my Manjaro linux system.

@nyambura00
Copy link

` error occurred: Command "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "rocksdb/include/" "-I" "rocksdb/" "-I" "rocksdb/third-party/gtest-1.8.1/fused-src/" "-I" "snappy/" "-I" "lz4/lib/" "-I" "/home/stranger101/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zstd-sys-2.0.8+zstd.1.5.5/zstd/lib" "-I" "/home/stranger101/radixdlt-scrypto/simulator/target/release/build/libz-sys-4ab99e8a32670f18/out/include" "-I" "/home/stranger101/radixdlt-scrypto/simulator/target/release/build/bzip2-sys-1b33dc349f0418c1/out/include" "-I" "." "-Wall" "-Wextra" "-std=c++17" "-Wsign-compare" "-Wshadow" "-Wno-unused-parameter" "-Wno-unused-variable" "-Woverloaded-virtual" "-Wnon-virtual-dtor" "-Wno-missing-field-initializers" "-Wno-strict-aliasing" "-Wno-invalid-offsetof" "-msse2" "-std=c++17" "-DSNAPPY=1" "-DLZ4=1" "-DZSTD=1" "-DZLIB=1" "-DBZIP2=1" "-DNDEBUG=1" "-DOS_LINUX" "-DROCKSDB_PLATFORM_POSIX" "-DROCKSDB_LIB_IO_POSIX" "-DROCKSDB_SUPPORT_THREAD_LOCAL" "-DHAVE_UINT128_EXTENSION=1" "-DHAVE_UINT128_EXTENSION=1" "-o" "/home/stranger101/radixdlt-scrypto/simulator/target/release/build/librocksdb-sys-e099784a024e53f1/out/rocksdb/table/block_based/data_block_hash_index.o" "-c" "rocksdb/table/block_based/data_block_hash_index.cc" with args "c++" did not execute successfully (status code exit status: 1).

error: failed to compile simulator v0.9.0

I have attempted the above remedies. Still getting the error above when installing resim in Arch Linux.

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

No branches or pull requests

3 participants