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

How do I do a cross compiling for raspberry pi 3 (arm) from WSL 2 #24912

Closed
VinceGHER opened this issue May 25, 2022 · 7 comments
Closed

How do I do a cross compiling for raspberry pi 3 (arm) from WSL 2 #24912

VinceGHER opened this issue May 25, 2022 · 7 comments
Assignees
Labels
category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. category:question This issue is a question

Comments

@VinceGHER
Copy link

VinceGHER commented May 25, 2022

Hello,
I would like to configure vcpkg to do cross-compiling on a raspberry pi 3 (arm) from WSL2.
I use cmake to build my cpp project.
I need to have the cpp 20 standard.

Could you tell me what step I have to follow in order to do this?

ps: I'm new to vcpkg.

Thank you !

@LilyWangLL LilyWangLL added category:question This issue is a question category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. labels May 26, 2022
@LilyWangLL
Copy link
Contributor

You can use VCPKG according to the documentation: https://github.com/microsoft/vcpkg#quick-start-unix, if you have any question when using port, you can comment here.

@VinceGHER
Copy link
Author

Hello,
I'm getting this error

-- Using community triplet arm-linux. This triplet configuration is not guaranteed to succeed.
-- [COMMUNITY] Loading triplet configuration from: /home/vincent/vcpkg/triplets/community/arm-linux.cmake
CMake Warning at ports/outcome/portfile.cmake:18 (message):
Outcome depends on QuickCppLib which uses the vcpkg versions of gsl-lite
and byte-lite, rather than the versions tested by QuickCppLib's and
Outcome's CI. It is not guaranteed to work with other versions, with
failures experienced in the past up-to-and-including runtime crashes. See
the warning message from QuickCppLib for how you can pin the versions of
those dependencies in your manifest file to those with which QuickCppLib
was tested. Do not report issues to upstream without first pinning the
versions as QuickCppLib was tested against.

Call Stack (most recent call first):
scripts/ports.cmake:145 (include)

-- Using cached ned14-outcome-9c6ad6e8e6a48ddde65c0617e3df306bc901b41d.tar.gz.
-- Cleaning sources at /home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source /home/vincent/vcpkg/downloads/ned14-outcome-9c6ad6e8e6a48ddde65c0617e3df306bc901b41d.tar.gz
-- Applying patch outcome-prune-sources.patch
-- Using source at /home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean
-- Configuring arm-linux-rel
-- Building arm-linux-rel
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:158 (message):
Command failed: /usr/bin/cmake --build . --config Release --target install -- -v -j9
Working Directory: /home/vincent/vcpkg/buildtrees/outcome/arm-linux-rel
See logs for more information:
/home/vincent/vcpkg/buildtrees/outcome/install-arm-linux-rel-out.log

Call Stack (most recent call first):
scripts/cmake/vcpkg_build_cmake.cmake:106 (vcpkg_execute_build_process)
scripts/cmake/vcpkg_install_cmake.cmake:44 (vcpkg_build_cmake)
ports/outcome/portfile.cmake:70 (vcpkg_install_cmake)
scripts/ports.cmake:145 (include)

error: building outcome:arm-linux failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with git pull and ./vcpkg update.
Then check for known issues at:
https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+outcome
You can submit a new issue at:
https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[outcome]+Build+error
including:
package: outcome[core]:arm-linux -> 2.2.2-20211208
vcpkg-tool version: 2022-03-30-692785ac944e81417840c6de244fb3e18a4b35eb
vcpkg-scripts version: 6268290c9 2022-05-24 (6 days ago)

Additionally, attach any relevant sections from the log files above.

@VinceGHER
Copy link
Author

*** FILE /home/vincent/vcpkg/buildtrees/outcome/install-arm-linux-rel-out.log ***
[1/5] /usr/bin/arm-linux-gnueabihf-g++ -I/home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean/include -O3 -DNDEBUG -fexceptions -frtti -fstack-protector-strong -MD -MT CMakeFiles/outcome-dependency-smoke-test_1.dir/test/tests/core-result.cpp.o -MF CMakeFiles/outcome-dependency-smoke-test_1.dir/test/tests/core-result.cpp.o.d -o CMakeFiles/outcome-dependency-smoke-test_1.dir/test/tests/core-result.cpp.o -c /home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean/test/tests/core-result.cpp
FAILED: CMakeFiles/outcome-dependency-smoke-test_1.dir/test/tests/core-result.cpp.o
/usr/bin/arm-linux-gnueabihf-g++ -I/home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean/include -O3 -DNDEBUG -fexceptions -frtti -fstack-protector-strong -MD -MT CMakeFiles/outcome-dependency-smoke-test_1.dir/test/tests/core-result.cpp.o -MF CMakeFiles/outcome-dependency-smoke-test_1.dir/test/tests/core-result.cpp.o.d -o CMakeFiles/outcome-dependency-smoke-test_1.dir/test/tests/core-result.cpp.o -c /home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean/test/tests/core-result.cpp
In file included from /home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean/test/tests/../../include/outcome/basic_result.hpp:28,
from /home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean/test/tests/../../include/outcome/std_result.hpp:28,
from /home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean/test/tests/../../include/outcome/result.hpp:28,
from /home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean/test/tests/core-result.cpp:28:
/home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean/test/tests/../../include/outcome/config.hpp:35:10: fatal error: quickcpplib/config.hpp: No such file or directory
35 | #include "quickcpplib/config.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[2/5] /usr/bin/arm-linux-gnueabihf-g++ -I/home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean/include -O3 -DNDEBUG -fexceptions -frtti -fstack-protector-strong -MD -MT CMakeFiles/outcome-dependency-smoke-test_2.dir/test/tests/experimental-core-result-status.cpp.o -MF CMakeFiles/outcome-dependency-smoke-test_2.dir/test/tests/experimental-core-result-status.cpp.o.d -o CMakeFiles/outcome-dependency-smoke-test_2.dir/test/tests/experimental-core-result-status.cpp.o -c /home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean/test/tests/experimental-core-result-status.cpp
FAILED: CMakeFiles/outcome-dependency-smoke-test_2.dir/test/tests/experimental-core-result-status.cpp.o
/usr/bin/arm-linux-gnueabihf-g++ -I/home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean/include -O3 -DNDEBUG -fexceptions -frtti -fstack-protector-strong -MD -MT CMakeFiles/outcome-dependency-smoke-test_2.dir/test/tests/experimental-core-result-status.cpp.o -MF CMakeFiles/outcome-dependency-smoke-test_2.dir/test/tests/experimental-core-result-status.cpp.o.d -o CMakeFiles/outcome-dependency-smoke-test_2.dir/test/tests/experimental-core-result-status.cpp.o -c /home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean/test/tests/experimental-core-result-status.cpp
In file included from /home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean/test/tests/../../include/outcome/experimental/../basic_result.hpp:28,
from /home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean/test/tests/../../include/outcome/experimental/status_result.hpp:28,
from /home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean/test/tests/experimental-core-result-status.cpp:24:
/home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean/test/tests/../../include/outcome/experimental/../config.hpp:35:10: fatal error: quickcpplib/config.hpp: No such file or directory
35 | #include "quickcpplib/config.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.

@VinceGHER
Copy link
Author

*** arm-linux .cmake *** Modifed CUSTOM
set(VCPKG_TARGET_ARCHITECTURE arm)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_CMAKE_SYSTEM_NAME Linux)

set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE /home/vincent/vcpkg/scripts/toolchains/custom.cmake)

*** Custom.cmake ***
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(tools /usr)
set(CMAKE_C_COMPILER ${tools}/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER ${tools}/bin/arm-linux-gnueabihf-g++)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

@LilyWangLL
Copy link
Contributor

/home/vincent/vcpkg/buildtrees/outcome/src/6bc901b41d-bf00471cc6.clean/test/tests/../../include/outcome/config.hpp:35:10: fatal error: quickcpplib/config.hpp: No such file or directory
35 | #include "quickcpplib/config.hpp"

"quickcpplib/config.hpp" from port ned14-internal-quickcpplib, it is dependency of outcome. You could check if it install correct.

@LilyWangLL
Copy link
Contributor

@VinceGHER Does this issue resolved?

@LilyWangLL
Copy link
Contributor

We hope your question was answered to your satisfaction; if it wasn't, you can reopen with more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. category:question This issue is a question
Projects
None yet
Development

No branches or pull requests

2 participants