unable to build grpc v1.28.1 inside a container - build

I am getting c++: fatal errors when trying to build grpc inside a container. Tried it with GNU CC 7, and 10, on three different machines, all running Docker Desktop for Windows.
the basic Dockerfile is mimicing the grpc building docs:
FROM gcc:10.1.0
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y build-essential autoconf libtool pkg-config git curl cmake
RUN cd /tmp && \
git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc && \
cd grpc && \
git submodule update --init && \
mkdir -p cmake/build && \
mkdir -p /opt/grpc && \
cd cmake/build && \
cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/opt/grpc ../.. && \
make -j && \
make install
but can't get to a successful build as on all systems, I get this:
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[2]: *** [CMakeFiles/grpc.dir/build.make:2130: CMakeFiles/grpc.dir/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[2]: *** [CMakeFiles/grpc_cronet.dir/build.make:2182: CMakeFiles/grpc_cronet.dir/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc.o] Error 1
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[2]: *** Waiting for unfinished jobs....
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[2]: *** [CMakeFiles/grpc.dir/build.make:2182: CMakeFiles/grpc.dir/src/core/ext/transport/chttp2/transport/chttp2_transport.cc.o] Error 1
make[2]: *** [CMakeFiles/grpc_cronet.dir/build.make:2598: CMakeFiles/grpc_cronet.dir/src/core/ext/filters/client_channel/client_channel.cc.o] Error 1
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[2]: *** [CMakeFiles/grpc_unsecure.dir/build.make:2208: CMakeFiles/grpc_unsecure.dir/src/core/ext/transport/chttp2/transport/chttp2_transport.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/grpc_cronet.dir/build.make:2819: CMakeFiles/grpc_cronet.dir/src/core/ext/filters/client_channel/resolving_lb_policy.cc.o] Error 1
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[2]: *** [CMakeFiles/grpc.dir/build.make:2520: CMakeFiles/grpc.dir/src/core/lib/security/context/security_context.cc.o] Error 1
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
[ 89%] Building C object CMakeFiles/grpc.dir/src/core/ext/upb-generated/envoy/api/v2/cluster.upb.c.o
make[2]: *** [CMakeFiles/grpc.dir/build.make:2546: CMakeFiles/grpc.dir/src/core/lib/security/credentials/composite/composite_credentials.cc.o] Error 1
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[2]: *** [CMakeFiles/grpc_unsecure.dir/build.make:2858: CMakeFiles/grpc_unsecure.dir/src/core/ext/filters/client_channel/resolving_lb_policy.cc.o] Error 1
make[2]: *** [CMakeFiles/grpc_cronet.dir/build.make:2234: CMakeFiles/grpc_cronet.dir/src/core/ext/transport/chttp2/transport/chttp2_transport.cc.o] Error 1
...
The terminations happen at different stages in the build. Any ideas what is terminating the compiler?

Aha, the failures were caused by memory constraints; the make -j without arguments is too aggressive for Windows. Constraining it to a given value solves the problem.

Related

"No rule to make target" compiling c++ module for Apache Ignite

When compiling the c++ module from sources I am getting the following error, which seems to arise because the file "ignite/impl/interop/interop_target.h" is missing. Any suggestions where I should go from here?
Making all in include
make[3]: Entering directory `/work/apache-ignite-1.7.0-src/modules/platforms/cpp/core/include'
make[3]: Leaving directory `/work/apache-ignite-1.7.0-src/modules/platforms/cpp/core/include'
make[3]: *** No rule to make target `ignite/impl/interop/interop_target.h', needed by `all-am'. Stop.
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/work/apache-ignite-1.7.0-src/modules/platforms/cpp/core'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/work/apache-ignite-1.7.0-src/modules/platforms/cpp'
make: *** [all] Error 2
The command '/bin/sh -c cd /work/apache-ignite-1.7.0-src/modules/platforms/cpp && libtoolize && aclocal && autoheader && automake --add-missing && autoreconf && ./configure && make -j4' returned a non-zero code: 2
Where the build process I am following, leading up to the error, is
cd /work
curl -L -O https://archive.apache.org/dist/ignite/1.7.0/apache-ignite-1.7.0-src.zip
unzip -q apache-ignite-1.7.0-src.zip
cd apache-ignite-1.7.0-src
mvn clean package -DskipTests
cd modules/platforms/cpp
libtoolize && aclocal && autoheader && automake --add-missing && autoreconf
./configure
make -j4
Incidentally I am getting the same error if I repeat the build process on apache-ignite-1.8.0-src.zip.
This is a known issue with the sources releases. As a solution, you can use sources from project repository.

build/org/qore/jni/QoreJavaApi.class: No such file or directory

make[2]: Entering directory
/export/home/build/src/el7/develop/qore/git/module-jni/build'
/usr/bin/cmake -E cmake_progress_report /export/home/build/src/el7/develop/qore/git/module-jni/build/CMakeFiles 36
[ 22%] unhandled QORE System exception thrown in TID 1 at 2017-01-10 07:23:45.694794 Tue +01:00 (CET) in FileInputStream::constructor() (/export/home/build/src/el7/develop/qore/gi
t/module-jni/make-inc:53, builtin code)
FILE-OPEN2-ERROR: cannot open '/export/home/build/src/el7/develop/qore/git/module-jni/build/org/qore/jni/QoreJavaApi.class': No such file or directory
call stack:
2: FileInputStream::constructor() (/export/home/build/src/el7/develop/qore/git/module-jni/make-inc:53, builtin code)
1: MakeInc::constructor() (line -1, user code)
make[2]: *** [JavaClassQoreJavaApi.inc] Error 3
make[2]: Leaving directory /export/home/build/src/el7/develop/qore/git/module-jni/build
make[1]: *** [CMakeFiles/jni.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
does anybody know why the class is not exported?
it looks like you just have to run cmake again from the build directory - try:
rm -rf * && cmake .. && make
from the build directory - if you are building from the develop branch, this should work on centos7 / rhel7 (just tried it myself)

Coova-Chilli 1.3.0 build fails for Ubuntu server 14.04

Followed the directions from Coova-Chilli distribution build.
wget https://coova.github.io/coova-chilli/coova-chilli-1.3.0.tar.gz
tar xzf coova-chilli-1.3.0.tar.gz
cd coova-chilli-1.3.0/
debuild -b
and the results are the following error.
...........Error Section................
/usr/bin/ld: /usr/lib/libssl.a(s23_srvr.o): relocation R_X86_64_32 against
`.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib/libssl.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
libtool: install: error: relink `libchilli.la' with the above command before
installing it
make[4]: *** [install-libLTLIBRARIES] Error 1
make[4]: Leaving directory `/home/download/coova-chilli-1.3.0/src'
make[3]: *** [install-am] Error 2
make[3]: Leaving directory `/home/download/coova-chilli-1.3.0/src'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/download/coova-chilli-1.3.0/src'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/download/coova-chilli-1.3.0'
make: *** [install] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit
status 2
debuild: fatal error at line 1364:
dpkg-buildpackage -rfakeroot -D -us -uc -b failed
I initially thought maybe openssl was not a recent enough version. None of the other applications had that problem. So I removed openssl package, built and installed it from source. The latest version is openssl 1.0.2e. I retested radius server after ripping up and rebuilding openssl and all is surprisingly still working fine.
I tried to compile coova-chilli again and also 1.2.9 as well but received the same error. libssl.a is present in that location.
Any thoughts on how best to proceed?
The instructions for Debian/Ubuntu on Coova-Chilli were not correct for Ubuntu.
wget https://coova.github.io/coova-chilli/coova-chilli-1.3.0.tar.gz
tar xzf coova-chilli-1.3.0.tar.gz
cd coova-chilli-1.3.0/
./configure --prefix= --enable-miniportal (or whatever flags you want)
make
sudo make install
update-rc.d chilli defaults
Reference: https://help.ubuntu.com/community/WifiDocs/CoovaChilli

QtOpenGl: No such file or directory

I installed Deepin Linux few days back. I am trying to install OpenCv2.4.10 but during compilation I am getting this error:
fatal error: QtOpenGL: No such file or directory
#include <QtOpenGL>
^
compilation terminated.
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_QT.cpp.o] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Disable the compilation of Qt modules for opencv or install Qt with OpenGL support to solve the error

Netbeans and C++ installation

i have a litle problem using Netbeans 7.4 and Cygwin 4.x for compiling my C++ programms. I've done everything as in netbeans tutorial. I've installed gcc, gdb, g++ and make compilers. Everything is setup properly in Netbeans properties, every path. But i still get the same problem, i don't know what is this problem. I'm trying to compile Hello sample from Netbeans. Please help me. Here is the error log:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/cygdrive/c/Users/Dragosh/Documents/NetBeansProjects/Welcome_2'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_4.x-Windows/welcome_2.exe
make[2]: Entering directory '/cygdrive/c/Users/Dragosh/Documents/NetBeansProjects/Welcome_2'
mkdir -p build/Debug/Cygwin_4.x-Windows
g++ -c -g -o build/Debug/Cygwin_4.x-Windows/welcome.o welcome.cc
In file included from /usr/include/sys/reent.h:14:0,
from /usr/include/wchar.h:6,
from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/cwchar:44,
from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/bits/postypes.h:40,
from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/iosfwd:40,
from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/ios:38,
from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/ostream:38,
from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/iostream:39,
from welcome.cc:31:
/usr/include/sys/_types.h:72:20: fatal error: stddef.h: No such file or directory
#include <stddef.h>
^
compilation terminated.
nbproject/Makefile-Debug.mk:66: recipe for target 'build/Debug/Cygwin_4.x-Windows/welcome.o' failed
make[2]: *** [build/Debug/Cygwin_4.x-Windows/welcome.o] Error 1
make[2]: Leaving directory '/cygdrive/c/Users/Dragosh/Documents/NetBeansProjects/Welcome_2'
nbproject/Makefile-Debug.mk:59: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/Dragosh/Documents/NetBeansProjects/Welcome_2'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 467ms)
Got this issue with cygwin too, after last update to 2.830 (see setup.exe version). I am using 64 bit version. To verify that we have the same issue, try manualy compiling something supersimple with g++ usgin cygwin terminal.
I checked with:
$ echo -e "#include <iostream>\n int main() { return 0; }" | g++ -xc++ -
And got:
In file included from /usr/include/sys/reent.h:14:0,
from /usr/include/wchar.h:6,
from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/cwchar:44,
from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/bits/postypes.h:40,
from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/iosfwd:40,
from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/ios:38,
from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/ostream:38,
from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/iostream:39,
from <stdin>:1:
/usr/include/sys/_types.h:72:20: fatal error: stddef.h: No such file or directory
#include <stddef.h>
^
compilation terminated.
I noticed that there are two folders of gcc here
C:\cygwin\lib\gcc\x86_64-pc-cygwin\4.8.1
C:\cygwin\lib\gcc\x86_64-pc-cygwin\4.8.2
and g++ --version gives 4.8.2
Running Cygwin's latest Setup.exe and looking for installed packets showed that versions mismatch for gcc-core and gcc-g++ :
gcc-core = 4.8.2-1
gcc-c++ = 4.8.1-3
I downgraded gcc-core to 4.8.1-3 and fixed the issue.