[SOLVED] Failure when building OpenWrt

I am using instructions here and here to build OpenWRT in Ubuntu but am getting this build failure:

make[4]: Entering directory '~/openwrt/build_dir/host/cmake-3.11.1/Bootstrap.cmk'
make[4]: 'cmake' is up to date.
make[4]: Leaving directory '~/openwrt/build_dir/host/cmake-3.11.1/Bootstrap.cmk'
loading initial cache file ~/openwrt/build_dir/host/cmake-3.11.1/Bootstrap.cmk/InitialCacheFlags.cmake
CMake Error at CMakeLists.txt:92 (message):
  The C++ compiler does not support C++11 (e.g.  std::unique_ptr).


-- Configuring incomplete, errors occurred!

Tried checking out latest OpenWRT v18.06.2. When that failed to build I deleted the cloned directory and tried v18.06.0-rc2. There was no improvement.

The state of my g++ install:

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-27ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)

Misconfiguration on my build environment? Bug?

Ubuntu 12.04 LTS
sudo apt-get install build-essential git-core libncurses5-dev zlib1g-dev gawk flex quilt libssl-dev xsltproc libxml-parser-perl mercurial bzr ecj cvs unzip

Ubuntu, Kubuntu 17.10
sudo apt-get install build-essential libncurses5-dev zlib1g-dev gawk gcc-multilib flex git-core gettext libssl-dev unzip python

Ubuntu, Kubuntu 18.10
sudo apt install build-essential libncurses-dev unzip python
Build system – Installation

TLDR: Build openWRT on a local directory.

The issue was that I was compiling in a home directory which is mounted over NFS. The local machine was not NTP-synced to the Synology NAS and resulted in modification times in the future. After that issue was ironed out there were random permissions errors which would stop the build. I would then chmod the whole openwrt tree to 777. The build would progress further than snag on another permissions error, etc. Not sure if this is a bug in NFS or a quirk in NFS.

Tried many permutations for mounting options with little avail. The command-line on a Synology system is structured differently from a Debian system and I found the learning curve to be more time-costly than just building a homebrew NAS from scratch using Debian/Ubuntu and mini PC.

Tried the same build on the same machine from a local directory and the build went fine the first time around.

Maybe SSHFS would work better for home directory when compiling - it's something to try in the future- I am holding out until a new NAS is built because the Synology NAS is not cooperating for public-key SSH logins either.

1 Like

If your problem is solved, please consider marking the topic as [Solved] (Click the pencil behind the topic...).

synology often has funky fs options.

i think you have to run some whacky db insert for that. pgsql... or something.