Hi everyone!
I'm having issues compiling OpenWrt v21.02.2 for Ubiquiti's Aircube AC. I wanted to compile it from scratch to be able to customize the image for mass flashing, but so far CMake seems to break, therefore no cross-toolchain.
My setup is as follows:
- vagrant virtual machine (Tried both bullseye and buster releases)
- installed build dependencies as stated here
- Checked out
v21.02.2
branch - Used
ath79/generic
official build config with Aircube AC as profile
Everything works fine from the beginning up until trying to build the toolchain. Specifically it breaks at compiling CMake. The specific code snippet with the error is:
Checking whether 'g++ -O2 -I/home/vagrant/openwrt/staging_dir/host/include ' supports 'filesystem'.
Try: g++
Line: g++ -O2 -I/home/vagrant/openwrt/staging_dir/host/include /home/vagrant/openwrt/build_dir/host/cmake-3.19.1/Source/Checks/cm_cxx_filesystem.cxx -o cmake_bootstrap_2536_test
---------- file -----------------------
#include <filesystem>
int main()
{
std::filesystem::path p0(L"/a/b/c");
std::filesystem::path p1("/a/b/c");
std::filesystem::path p2("/a/b/c");
if (p1 != p2) {
return 1;
}
#if defined(_WIN32)
std::filesystem::path p3("//host/a/b/../c");
if (p3.lexically_normal().generic_string() != "//host/a/c") {
return 1;
}
std::filesystem::path p4("c://a/.///b/../");
if (p4.lexically_normal().generic_string() != "c:/a/") {
return 1;
}
#endif
return 0;
}
------------------------------------------
/home/vagrant/openwrt/build_dir/host/cmake-3.19.1/Source/Checks/cm_cxx_filesystem.cxx: In function 'int main()':
/home/vagrant/openwrt/build_dir/host/cmake-3.19.1/Source/Checks/cm_cxx_filesystem.cxx:6:8: error: 'std::filesystem' has not been declared
std::filesystem::path p0(L"/a/b/c");
^~~~~~~~~~
/home/vagrant/openwrt/build_dir/host/cmake-3.19.1/Source/Checks/cm_cxx_filesystem.cxx:8:8: error: 'std::filesystem' has not been declared
std::filesystem::path p1("/a/b/c");
^~~~~~~~~~
/home/vagrant/openwrt/build_dir/host/cmake-3.19.1/Source/Checks/cm_cxx_filesystem.cxx:9:8: error: 'std::filesystem' has not been declared
std::filesystem::path p2("/a/b/c");
^~~~~~~~~~
/home/vagrant/openwrt/build_dir/host/cmake-3.19.1/Source/Checks/cm_cxx_filesystem.cxx:10:7: error: 'p1' was not declared in this scope
if (p1 != p2) {
^~
/home/vagrant/openwrt/build_dir/host/cmake-3.19.1/Source/Checks/cm_cxx_filesystem.cxx:10:13: error: 'p2' was not declared in this scope
if (p1 != p2) {
^~
Test failed to compile
Try: gmake
/home/vagrant/openwrt/build_dir/host/cmake-3.19.1/bootstrap: 853: /home/vagrant/openwrt/build_dir/host/cmake-3.19.1/bootstrap: gmake: not found
gmake does not work
Try: make
make[4]: Entering directory '/home/vagrant/openwrt/build_dir/host/cmake-3.19.1/Bootstrap.cmk/cmake_bootstrap_2536_test_dir'
"gcc" -L/home/vagrant/openwrt/staging_dir/host/lib -O2 -I/home/vagrant/openwrt/staging_dir/host/include -o test test.c
make[4]: Leaving directory '/home/vagrant/openwrt/build_dir/host/cmake-3.19.1/Bootstrap.cmk/cmake_bootstrap_2536_test_dir'
1
make works
Any help is very much welcome. Thanks!