-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fixing rippled build errors
Try this Conan profile:
[settings]
os=Macos
os_build=Macos
arch=armv8
arch_build=armv8
compiler=apple-clang
compiler.version=15
compiler.libcxx=libc++
build_type=Release
compiler.cppstd=20
[options]
[build_requires]
[env]
CXXFLAGS=-DBOOST_ASIO_DISABLE_CONCEPTS
[conf]
tools.build:cxxflags+=["-DBOOST_ASIO_DISABLE_CONCEPTS"]
- Copy the profile
- Remove your build directory
- Start over from
mkdir .build
step
Don't need to remove Conan cache.
This successfully builds 77e0912a0e4ecf69ce62ce4b102e4bc2f234df50, version string 2.0.0-b1.
There may be a warning during linking:
ld: warning: ignoring duplicate libraries: '-lc++'
The ld warning may be an Apple bug: https://github.com/getsentry/sentry-cocoa/issues/3122
Check the version of Conan you are using. Conan v2.x has known issues, so make sure you're using a version like 1.56. Use the following command to check your Conan version:
conan --version
Check the configuration of your default profile. This is an example command to show your default profile:
conan profile show default
Make sure the compiler
, compiler.version
, compiler.libcxx
, build_type
, and compiler.cppstd
fields match your environment's requirements.
Make sure you are posting the full error message for better troubleshooting. If the error message is too long, consider using a service like Gist to share it.
If you are building on a machine with a different architecture (e.g., Mac M1), verify that your Conan profile has the correct architecture settings.
Look for similar issues in the project's issue tracker. You might find helpful solutions or workarounds there.
Try updating your Conan profile with these commands:
conan profile update 'options.boost:extra_b2_flags="define=BOOST_ASIO_HAS_STD_INVOKE_RESULT"' default
conan profile update 'env.CFLAGS="-DBOOST_ASIO_HAS_STD_INVOKE_RESULT"' default
conan profile update 'env.CXXFLAGS="-DBOOST_ASIO_HAS_STD_INVOKE_RESULT"' default
conan profile update 'conf.tools.build:cflags+=["-DBOOST_ASIO_HAS_STD_INVOKE_RESULT"]' default
conan profile update 'conf.tools.build:cxxflags+=["-DBOOST_ASIO_HAS_STD_INVOKE_RESULT"]' default
Then, try to install Boost again:
conan install boost/1.77.0@ --build
Ensure you're running the command from the correct directory. If you're following the Rippled build instructions, you should be in the .build
directory.
Review the contents of your directory. You should see files like conan.lock
, conanbuildinfo.txt
, conaninfo.txt
, and graph_info.json
.
Check if the toolchain file exists and if its path is correct. Use commands like ls -ld build
, ls -ld build/generators
, and ls -l build/generators/conan_toolchain.cmake
to verify.
If the relative path isn't working, try passing an absolute path to the CMake command like so:
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$(pwd)/build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug ..
If you encounter errors when running the rippled executable, double-check the error message. A common issue is the absence of configuration files or directories.
Ensure that the directories and files mentioned in the error message exist. For example, you might need to create /etc/opt/ripple/
and add the rippled.cfg
file to it:
sudo mkdir -p /etc/opt/ripple/
sudo cp /path/to/your/rippled.cfg /etc/opt/ripple/
Now, try running your rippled executable again.
When running:
conan install .. --output-folder . --build missing --settings build_type=Release
You may get this error:
CMake Error at CMakeLists.txt:49 (project):
The CMAKE_CXX_COMPILER:
<path>
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
You need to give the path to the compiler. In the instructions, <path>
is just a placeholder. To set the compiler path, run the command that set it. It's in your profile. To see it, run conan profile show default
.
In the following command, <path>
must be replaced with the path to the compiler, before you execute the command.
conan profile update 'conf.tools.build:compiler_executables={"c": "<path>", "cpp": "<path>"}' default
On a typical Ubuntu 20 machine, gcc was at /usr/bin/gcc and g++ was at /usr/bin/g++
So the complete command line could be:
conan profile update 'conf.tools.build:compiler_executables={"c": "/usr/bin/gcc", "cpp": "/usr/bin/g++"}' default
- Potentially helpful advice for building on Apple Silicon (arm64, M1, M2)
If you run into conan errors:
grpc-proto/cci.20220627: WARN: Build folder /home/user/.conan/data/grpc-proto/cci.20220627/_/_/build/0623b89cdfdcdc89b2ee9f15778d9510adc21398
ERROR: grpc-proto/cci.20220627: Error in build() method, line 97
cmake = self._configure_cmake()
while calling '_configure_cmake', line 63
cmake.definitions["GOOGLEAPIS_PROTO_DIRS"] = self.dependencies["googleapis"].cpp_info.resdirs[0].replace("\\", "/")
IndexError: list index out of range
CMake Error at /usr/share/cmake/Modules/CMakeDetermineSystem.cmake:130 (message):
Could not find toolchain file:
conan-dependencies/build/generators/conan_toolchain.cmake
Call Stack (most recent call first):
CMakeLists.txt:14 (project)
Then you may need to run:
conan remove grpc/1.50.1
conan remove grpc/1.44.0
conan remove grpc-proto
conan remove googleapis
(The subdependencies grpc-proto
, googleapis
need to be removed)
In this case, this was caused by the need to update grpc. Conan has issues when versions update, so you may need to manually clear out the old versions of the grpc-related packages. i.e.:
for x in grpc googleapis grpc-proto; do conan remove $x ; done
The problem is that Conan does not include the recipe revision in the package ID, so an updated recipe does not trigger a rebuild. That might change with Conan 2.0, so hopefully this issue goes away once we upgrade to that - although we will surely get new issues.
Alternatively, if it's not too much trouble, the nuclear option is to rm -rf ~/.conan/data
Then, you can rerun the conan install
command(s).