Skip to content

Fixing rippled build errors

Elliot Lee edited this page Jan 20, 2021 · 9 revisions

If you get an error that looks like this:

...
 * [new tag]             v6.8.1               -> v6.8.1
error: Your local changes to the following files would be overwritten by checkout:
	thirdparty.inc
	util/build_version.cc.in
Please commit your changes or stash them before you switch branches.
Aborting
CMake Error at /Users/user/ripple/rippled/.nih_c/unix_makefiles/AppleClang_10.0.0.10001145/Debug/tmp/rocksdb-gitupdate.cmake:147 (message):
  Failed to checkout tag: 'v6.7.3'


make[2]: *** [../.nih_c/unix_makefiles/AppleClang_10.0.0.10001145/Debug/src/rocksdb-stamp/rocksdb-update] Error 1
make[1]: *** [CMakeFiles/rocksdb.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
...
[ 21%] Built target grpc_src
make: *** [all] Error 2

Try deleting the ../.nih_c directory, which is an object cache for external projects that rippled depends on.

https://github.com/ripple/rippled/blob/master/Builds/CMake/RippledNIH.cmake


When running:

% cmake --build . -- -j 4

If you get errors like:

[...]
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - broken
-- Configuring incomplete, errors occurred!
See also "/Users/user/ripple/rippled/.nih_c/unix_makefiles/AppleClang_12.0.0.12000032/Debug/src/snappy-build/CMakeFiles/CMakeOutput.log".
See also "/Users/user/ripple/rippled/.nih_c/unix_makefiles/AppleClang_12.0.0.12000032/Debug/src/snappy-build/CMakeFiles/CMakeError.log".

CMake Warning at /usr/local/Cellar/cmake/3.19.3/share/cmake/Modules/Platform/Darwin-Initialize.cmake:303 (message):
  Ignoring CMAKE_OSX_SYSROOT value:

   /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk

  because the directory does not exist.
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.19.3/share/cmake/Modules/CMakeSystemSpecificInitialize.cmake:21 (include)
  CMakeLists.txt:2 (project)


CMake Error at /usr/local/Cellar/cmake/3.19.3/share/cmake/Modules/CMakeTestCCompiler.cmake:66 (message):
  The C compiler

    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc"

  is not able to compile a simple test program.
[...]
  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)
[...]
make[2]: *** [../.nih_c/unix_makefiles/AppleClang_12.0.0.12000032/Debug/src/sqlite3-stamp/sqlite3-configure] Error 1
make[1]: *** [CMakeFiles/sqlite3.dir/all] Error 2
make: *** [all] Error 2

Then try running:

# list available xcode toolchains
xcode-select -p

# select one of listed above
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

# could reopen Terminal instead of the following
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)

Then, try cmake --build . -- -j 4 again.

Clone this wiki locally