Closed davidtavarez closed 2 years ago
Hi @davidtavarez Thanks for posting this issue. Since this is a community-triplet issue, which is an unofficial triplet in vcpkg now.
Hope this reference can help you some. https://stackoverflow.com/questions/54633860/how-can-i-fix-the-cmake-c-compiler-is-not-a-full-path-and-was-not-found-in-the
Thanks.
Thanks @NancyLi1013
But if I'm using a custom triplet setting the CMAKE_CXX_COMPILER
to aarch64-unknown-linux-gnueabi-g++
(as my env) I should not have any problems... but I do:
arm64-unknown-linux-static.cmake
set(VCPKG_TARGET_ARCHITECTURE arm64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
set(CMAKE_CXX_COMPILER "aarch64-unknown-linux-gnueabi-g++")
set(CMAKE_C_COMPILER "aarch64-unknown-linux-gnueabi-gcc")
if(NOT CMAKE_HOST_SYSTEM_PROCESSOR)
execute_process(COMMAND "uname" "-m" OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
/vcpkg/vcpkg install --debug --overlay-triplets=/work/vcpkg/custom_triplets --triplet arm64-unknown-linux-static --overlay-ports=/work/vcpkg/custom_ports libsodium
[root:/] # cat /vcpkg/buildtrees/detect_compiler/config-arm64-unknown-linux-static-rel-err.log
CMake Error at CMakeLists.txt:11 (enable_language):
The CMAKE_C_COMPILER:
aarch64-linux-gnu-gcc
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 "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
(Disclaimer: I work for MS, but not on vcpkg. I just happen to be hitting a similar issue)
Be sure not to confuse triplet and toolchain files. Triplet files are for configuring vcpkg's behavior via setting VCPKG_*
variables, whereas toolchain files are for configuring CMake itself via CMAKE_*
variables.
In some cases, vcpkg is smart enough to automatically set certain toolchain variables. For instance, VCPKG_TARGET_ARCHITECTURE
is used to populate the value of CMAKE_SYSTEM_PROCESSOR
. But many CMake settings (such as CMAKE_<lang>_COMPILER
) do not have a corresponding VCPKG_*
variable, so you'll need to chainload a custom toolchain file.
Try splitting the triplet file from your previous comment into two separate files. First the triplet file, arm64-unknown-linux-static.cmake:
set(VCPKG_TARGET_ARCHITECTURE arm64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/arm64-unknown-linux-static-toolchain.cmake)
And a separate toolchain file, arm64-unknown-linux-static-toolchain.cmake:
set(CMAKE_CXX_COMPILER "aarch64-unknown-linux-gnueabi-g++")
set(CMAKE_C_COMPILER "aarch64-unknown-linux-gnueabi-gcc")
# You might not need this section, I believe vcpkg knows how to correctly populate
# if(NOT CMAKE_HOST_SYSTEM_PROCESSOR)
# execute_process(COMMAND "uname" "-m" OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR OUTPUT_STRIP_TRAILING_WHITESPACE)
# endif()
@NancyLi1013 do you think it would make sense for vcpkg to support a new triplet setting (something like VCPKG_<lang>_COMPILER
) so that chainloading a custom toolchain file is not necessary?
Sorry, I'm also not clear about this.
@vicroms Could you please help comment something here?
This issue hasn’t been updated more than 3 months, if it is still an issue, please reopen this issue.
I'm trying to install a library like this:
$ vcpkg install --triplet arm64-linux zlib --debug
but it is failing...
the environment variables are set like this:
since this commit I am not able to install any library https://github.com/microsoft/vcpkg/commit/5e4d2fab8605a21972cb990ba49ade83ef19ffbf
How do I set the proper toolchain file?