-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fixing rippled build errors
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).