Building Fiware Orion context broker on LinuxOne docker (s390x) - docker

I am trying to build Fiware Orion context broker using Dockerfile at:
https://hub.docker.com/r/fiware/orion/
As a first step I have tried replacing the FROM image with the "supposed" equivalent of Centos for s390x, ClefOS: https://hub.docker.com/_/clefos :
FROM s390x/clefos:7.6.1810
It takes a long time and seems to go OK but ends up with the error below. Any ideas? Anybody has successfully built any Orion version docker image on IBM Z? (s390x)
Update: I have added those four libraries in the yum install command in Dockerfile and they are correctly installed but the problem is still there. It seems not just a problem of those boost_* libs missing but some configuration fix needed to "ld" locates them.
[ 97%] Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/mongoRegistrationCreate.cpp.o
[ 97%] Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/mongoRegistrationDelete.cpp.o
[ 97%] Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/connectionOperations.cpp.o
[ 97%] [ 98%] Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/mongoSubCache.cpp.o
Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/safeMongo.cpp.o
[ 98%] Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/compoundResponses.cpp.o
[ 98%] Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/location.cpp.o
[ 99%] Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/compoundValueBson.cpp.o
[ 99%] Building CXX object src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/dateExpiration.cpp.o
Linking CXX static library libmongoBackend.a
make[3]: Leaving directory `/opt/libmicrohttpd-0.9.48/mongo-cxx-driver-legacy-1.1.2/fiware-orion/BUILD_RELEASE'
[ 99%] Built target mongoBackend
make[3]: Entering directory `/opt/libmicrohttpd-0.9.48/mongo-cxx-driver-legacy-1.1.2/fiware-orion/BUILD_RELEASE'
Scanning dependencies of target contextBroker
make[3]: Leaving directory `/opt/libmicrohttpd-0.9.48/mongo-cxx-driver-legacy-1.1.2/fiware-orion/BUILD_RELEASE'
make[3]: Entering directory `/opt/libmicrohttpd-0.9.48/mongo-cxx-driver-legacy-1.1.2/fiware-orion/BUILD_RELEASE'
[100%] Building CXX object src/app/contextBroker/CMakeFiles/contextBroker.dir/contextBroker.cpp.o
[100%] Building CXX object src/app/contextBroker/CMakeFiles/contextBroker.dir/orionRestServices.cpp.o
Linking CXX executable contextBroker
/usr/bin/ld: cannot find -lboost_thread-mt
/usr/bin/ld: cannot find -lboost_filesystem-mt
/usr/bin/ld: cannot find -lboost_system-mt
/usr/bin/ld: cannot find -lboost_regex-mt
collect2: error: ld returned 1 exit status
make[3]: *** [src/app/contextBroker/contextBroker] Error 1
make[3]: Leaving directory `/opt/libmicrohttpd-0.9.48/mongo-cxx-driver-legacy-1.1.2/fiware-orion/BUILD_RELEASE'
make[2]: *** [src/app/contextBroker/CMakeFiles/contextBroker.dir/all] Error 2
make[2]: Leaving directory `/opt/libmicrohttpd-0.9.48/mongo-cxx-driver-legacy-1.1.2/fiware-orion/BUILD_RELEASE'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/opt/libmicrohttpd-0.9.48/mongo-cxx-driver-legacy-1.1.2/fiware-orion/BUILD_RELEASE'
make: *** [release] Error 2
The command '/bin/sh -c adduser --comment "${ORION_USER}" ${ORION_USER} && yum -y install epel-release && yum -y install boost-devel bzip2 cmake gnutls-devel libgcrypt-devel libcurl-devel openssl-devel libuuid-devel make nc git gcc-c++ scons tar which cyrus-sasl-devel && curl -kOL http://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.48.tar.gz && tar xvf libmicrohttpd-0.9.48.tar.gz && cd libmicrohttpd-0.9.48 && ./configure --disable-messages --disable-postprocessor --disable-dauth && make && make install && ldconfig && curl -kOL https://github.com/mongodb/mongo-cxx-driver/archive/legacy-1.1.2.tar.gz && tar xfz legacy-1.1.2.tar.gz && cd mongo-cxx-driver-legacy-1.1.2 && scons --use-sasl-client --ssl && scons install --prefix=/usr/local --use-sasl-client --ssl && curl -kOL https://github.com/miloyip/rapidjson/archive/v1.0.2.tar.gz && tar xfz v1.0.2.tar.gz && mv rapidjson-1.0.2/include/rapidjson/ /usr/local/include && git clone https://github.com/telefonicaid/fiware-orion && cd fiware-orion && git checkout ${GIT_REV_ORION} && make && make install && strip /usr/bin/contextBroker && mkdir -p /var/log/contextBroker && mkdir -p /var/run/contextBroker && chown ${ORION_USER} /var/log/contextBroker && chown ${ORION_USER} /var/run/contextBroker && cd /opt && if [ ${CLEAN_DEV_TOOLS} -eq 0 ] ; then yum clean all && exit 0 ; fi && rm -rf /opt/libmicrohttpd-0.9.48.tar.gz /usr/local/include/microhttpd.h /usr/local/lib/libmicrohttpd.* /opt/libmicrohttpd-0.9.48 /opt/legacy-1.1.2.tar.gz /opt/mongo-cxx-driver-legacy-1.1.2 /usr/local/include/mongo /usr/local/lib/libmongoclient.a /opt/rapidjson-1.0.2 /opt/v1.0.2.tar.gz /usr/local/include/rapidjson /opt/fiware-orion /usr/share/cracklib /usr/share/i18n /usr/{lib,lib64}/gconv && yum -y erase git perl* rsync cmake libarchive gcc-c++ cloog-ppl cpp gcc glibc-devel glibc-headers kernel-headers libgomp libstdc++-devel mpfr ppl scons boost-devel libcurl-devel gnutls-devel libgcrypt-devel clang llvm llvm-libs CUnit-devel CUnit autoconf automake m4 libidn-devel boost-wave boost-serialization boost-python boost-iostreams boost boost-date-time boost-test boost-graph boost-signals boost-program-options boost-math openssh openssh-clients libedit hwdata dbus-glib fipscheck* *devel sysvinit-tools && rpm -qa groff | xargs -r rpm -e --nodeps && yum clean all && rm -rf /var/lib/yum/yumdb && rm -rf /var/lib/yum/history && rpm -vv --rebuilddb && find /usr/share/locale -mindepth 1 -maxdepth 1 ! -name 'en_US' ! -name 'locale.alias' | xargs -r rm -r && bash -c 'localedef --list-archive | grep -v -e "en_US" | xargs localedef --delete-from-archive' && /bin/cp -f /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl && build-locale-archive && rm -f /var/log/*log' returned a non-zero code: 2

By
/usr/bin/ld: cannot find -lboost_thread-mt
/usr/bin/ld: cannot find -lboost_filesystem-mt
/usr/bin/ld: cannot find -lboost_system-mt
/usr/bin/ld: cannot find -lboost_regex-mt
I guess some required dependencies are missing. The solution would be to install them as part of the Dockefile script. However, not sure how to do it in s390x/clefos (in CentOS is a matter of installing the package that contains the dependency using yum, the Dockerfile does that).

Related

Compiling gcc 12.2.0 on dockerized Centos 7 fail with "execvp: Permission denied"

Due to some constraints, I have to compile the latest version of gcc in a dockerized centos7, here is the testing Dockerfile :
FROM centos:7 as deps
ENV INSTALL_PREFIX /opt/deps
ENV PROC -j4
ENV LD_LIBRARY_PATH $INSTALL_PREFIX/lib:$LD_LIBRARY_PATH
ENV PATH $INSTALL_PREFIX/bin:$PATH
WORKDIR /root
RUN yum -y -q install deltarpm && yum -y -q update && yum -y -q groupinstall 'Development Tools'
COPY packages/common/ .
RUN tar -xzf lzip-1.23.tar.gz && cd lzip-1.23 && ./configure && make $PROC && make install
RUN tar -xzf binutils-2.35.2.tar.gz && cd binutils-2.35.2 && ./configure --prefix=$INSTALL_PREFIX && make $PROC && make install
RUN tar --lzip -xf gmp-6.2.1.tar.lz && cd gmp-6.2.1 && ./configure --prefix=$INSTALL_PREFIX && make $PROC && make install
RUN tar -xzf mpfr-4.2.0.tar.gz && cd mpfr-4.2.0 && ./configure --prefix=$INSTALL_PREFIX --with-gmp=$INSTALL_PREFIX && make $PROC && make install
RUN tar -xzf mpc-1.3.1.tar.gz && cd mpc-1.3.1 && ./configure --prefix=$INSTALL_PREFIX --with-mpfr=$INSTALL_PREFIX --with-gmp=$INSTALL_PREFIX && make $PROC && make install
RUN tar -xzf zstd-1.5.4.tar.gz && cd zstd-1.5.4 && make $PROC && make DESTDIR=$INSTALL_PREFIX install && cp -R $INSTALL_PREFIX/usr/local/* $INSTALL_PREFIX/. && rm -rf $INSTALL_PREFIX/usr
RUN tar -xzf isl-0.25.tar.gz && cd isl-0.25 && ./configure --prefix=$INSTALL_PREFIX --with-gmp-prefix=$INSTALL_PREFIX && make $PROC && make install
RUN tar -xzf gcc-12.2.0.tar.gz && mkdir $INSTALL_PREFIX/../gcc
WORKDIR /tmp/gcc
RUN ~/gcc-12.2.0/configure --prefix=$INSTALL_PREFIX/../gcc --with-ld=$INSTALL_PREFIX/bin --enable-languages=c,c++ --disable-multilib --with-mpfr=$INSTALL_PREFIX --with-gmp=$INSTALL_PREFIX \
--with-mpc=$INSTALL_PREFIX --with-isl=$INSTALL_PREFIX --with-zstd=$INSTALL_PREFIX
RUN make $PROC || true
#RUN make install
ENTRYPOINT ["/bin/bash"]
This is the error I get when I try to compile gcc version 12.2.0 :
[ -f stage_final ] || echo stage3 > stage_final
make[1]: Entering directory `/tmp/gcc'
make[2]: Entering directory `/tmp/gcc'
make[3]: Entering directory `/tmp/gcc'
rm -f stage_current
make[3]: Leaving directory `/tmp/gcc'
make[2]: Leaving directory `/tmp/gcc'
make[2]: Entering directory `/tmp/gcc'
make[3]: Entering directory `/tmp/gcc/libiberty'
make[4]: Entering directory `/tmp/gcc/libiberty/testsuite'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/tmp/gcc/libiberty/testsuite'
make[3]: Leaving directory `/tmp/gcc/libiberty'
make[3]: Entering directory `/tmp/gcc/lto-plugin'
make all-am
make[4]: Entering directory `/tmp/gcc/lto-plugin'
make[4]: Leaving directory `/tmp/gcc/lto-plugin'
make[3]: Leaving directory `/tmp/gcc/lto-plugin'
make[3]: Entering directory `/tmp/gcc/intl'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/tmp/gcc/intl'
make[3]: Entering directory `/tmp/gcc/build-x86_64-pc-linux-gnu/libiberty'
make[4]: Entering directory `/tmp/gcc/build-x86_64-pc-linux-gnu/libiberty/testsuite'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/tmp/gcc/build-x86_64-pc-linux-gnu/libiberty/testsuite'
make[3]: Leaving directory `/tmp/gcc/build-x86_64-pc-linux-gnu/libiberty'
make[3]: Entering directory `/tmp/gcc/build-x86_64-pc-linux-gnu/fixincludes'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/tmp/gcc/build-x86_64-pc-linux-gnu/fixincludes'
make[3]: Entering directory `/tmp/gcc/build-x86_64-pc-linux-gnu/libcpp'
test -f config.h || (rm -f stamp-h1 && make stamp-h1)
make[3]: Leaving directory `/tmp/gcc/build-x86_64-pc-linux-gnu/libcpp'
make[3]: Entering directory `/tmp/gcc/zlib'
true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc -std=gnu99" "CFLAGS=-g" "CXXFLAGS=-g" "CFLAGS_FOR_BUILD=-g -O2" "CFLAGS_FOR_TARGET=-g -O2" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c$make[3]: Leaving directory `/tmp/gcc/zlib'
make[3]: Entering directory `/tmp/gcc/libbacktrace'
make all-am
make[4]: Entering directory `/tmp/gcc/libbacktrace'
true DO=all multi-do # make
make[4]: Leaving directory `/tmp/gcc/libbacktrace'
make[3]: Leaving directory `/tmp/gcc/libbacktrace'
make[3]: Entering directory `/tmp/gcc/libcpp'
make[3]: Leaving directory `/tmp/gcc/libcpp'
make[3]: Entering directory `/tmp/gcc/libcody'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/tmp/gcc/libcody'
make[3]: Entering directory `/tmp/gcc/libdecnumber'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/tmp/gcc/libdecnumber'
make[3]: Entering directory `/tmp/gcc/gcc'
make[3]: Leaving directory `/tmp/gcc/gcc'
Checking multilib configuration for libgcc...
make[3]: Entering directory `/tmp/gcc/x86_64-pc-linux-gnu/libgcc'
# If this is the top-level multilib, build all the other
# multilibs.
# Early copyback; see "all" above for the rationale. The
# early copy is necessary so that the gcc -B options find
# the right startup files when linking shared libgcc.
/bin/sh /root/gcc-12.2.0/libgcc/../mkinstalldirs ../.././gcc
parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"; \
for file in $parts; do \
rm -f ../.././gcc/$file; \
/usr/bin/install -c -m 644 $file ../.././gcc/; \
case $file in \
*.a) \
ranlib ../.././gcc/$file ;; \
esac; \
done
# #multilib_flags# is still needed because this may use
# /tmp/gcc/./gcc/xgcc -B/tmp/gcc/./gcc/ -B/opt/deps/../gcc/x86_64-pc-linux-gnu/bin/ -B/opt/deps/../gcc/x86_64-pc-linux-gnu/lib/ -isystem /opt/deps/../gcc/x86_64-pc-linux-gnu/include -isystem /opt/deps/../gcc/x86_64-pc-linux-gnu/sys-incl$# #multilib_dir# is not really necessary, but sometimes it has
# more uses than just a directory name.
/bin/sh /root/gcc-12.2.0/libgcc/../mkinstalldirs .
/tmp/gcc/./gcc/xgcc -B/tmp/gcc/./gcc/ -B/opt/deps/../gcc/x86_64-pc-linux-gnu/bin/ -B/opt/deps/../gcc/x86_64-pc-linux-gnu/lib/ -isystem /opt/deps/../gcc/x86_64-pc-linux-gnu/include -isystem /opt/deps/../gcc/x86_64-pc-linux-gnu/sys-includ$collect2: fatal error: execvp: Permission denied
compilation terminated.
make[3]: *** [libgcc_s.so] Error 1
make[3]: Leaving directory `/tmp/gcc/x86_64-pc-linux-gnu/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/tmp/gcc'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/tmp/gcc'
make: *** [all] Error 2
I get the same kind of error with gcc 10 and 9. I am using docker on windows version 4.16.3(96739).
I fail to understand what is called with execvp, and since I am root, how I am getting Permission denied. I should be able to successfully able to completely compile gcc. How to do ?
67527678, 67090507 do not work (and I am not able to use 67090507)
EDIT : I forgot to precise that chmod or chown do not solve the issue.

Docker Build SofteWare using Alphine Linux with Error 'install: unrecognized option: strip-program=strip'

I'm building a mosquito docker image, when calling make install meet these error messages 'install: unrecognized option: strip-program=strip', please help, thanks.
install -d /usr/local/lib/
install -s --strip-program=strip libmosquitto.so.1
/usr/local/lib/libmosquitto.so.1
install: unrecognized option: strip-program=strip
BusyBox v1.27.2 (2017-12-12 10:41:50 GMT) multi-call binary.
Usage: install [-cdDsp] [-o USER] [-g GRP] [-m MODE] [-t DIR] [SOURCE]... DEST
Copy files and set attributes
-c Just copy (default)
-d Create directories
-D Create leading target directories
-s Strip symbol table
-p Preserve date
-o USER Set ownership
-g GRP Set group ownership
-m MODE Set permissions
-t DIR Install to DIR
make[1]: *** [Makefile:28: install] Error 1
make[1]: Leaving directory '/usr/local/src/mosquitto-1.4.15/lib'
make: *** [Makefile:38: install] Error 2
Part of My Dockfile:
FROM alpine:3.7
RUN apk add --update --no-cache build-base openssl openssl-dev c-ares-dev util-linux-dev libwebsockets-dev libxslt && \
cd /usr/local && \
mkdir src && \
cd src && \
wget https://mosquitto.org/files/source/mosquitto-1.4.15.tar.gz && \
tar -zxvf mosquitto-1.4.15.tar.gz && \
cd mosquitto-1.4.15 && \
make && make install
Call make the last several result lines:
cc -Wall -ggdb -O2 -c mosquitto_passwd.c -o mosquitto_passwd.o
cc mosquitto_passwd.o -o mosquitto_passwd -lcrypto
make[1]: Leaving directory '/usr/local/src/mosquitto-1.4.15/src'
set -e; for d in man; do make -C ${d}; done
make[1]: Entering directory '/usr/local/src/mosquitto-1.4.15/man'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/usr/local/src/mosquitto-1.4.15/man'
The problem is that you're installing a mosquitto tar.gz with /usr/bin/install version: BusyBox v1.27.2, and your mosquitto's tar.gz downloaded with wget needs /usr/bin/install version from GNU coreutils 8.25 for example, which includes your missing option strip-program.
So, solution is simple: install a mosquitto version for alpine, not for generic Linux:
FROM alpine:3.7
RUN apk add --update --no-cache build-base openssl openssl-dev c-ares-dev util-linux-dev libwebsockets-dev libxslt && \
apk add mosquitto
It'll install version 1.4.15.
EDIT: If you need to install a plugin and compile a generic linux tar.gz, you have to install apk add coreutils
Except for the answer #mulg0r gave me. I found there was another way to solve this. I think this is also useful when someone meets a similar problem. From https://git.alpinelinux.org/cgit/aports/tree/main/mosquitto?h=master this link. the package from alpine Linux. Click the Git repository button, inside that page, this package's build process instructions are there. And some code changes to suit alpine Linux.
For this question, find APKBUILD file from https://git.alpinelinux.org/cgit/aports/tree/main/mosquitto?h=master. this line also solved my question:
sed -i -e "s|(INSTALL) -s|(INSTALL)|g" \
-e 's|--strip-program=${CROSS_COMPILE}${STRIP}||' \
*/Makefile */*/Makefile
Above is just comment out --strip-program when excute make install

Build error using cmake in docker

I am currently trying to setup a Gazebo Simulation with Docker.Since i want to use a custom Gazebo Version made by Alessio Rocchi I am building everything from source. But while trying to build everything, i get the following error code:
cc1plus: warning: /tmp/gazebo/deps/klampt/Simulation/include: No such file or directory
cc1plus: warning: /etc/klampt/Library/KrisLibrary: No such file or directory
In file included from /tmp/gazebo/deps/klampt/Simulation/ODECustomGeometry.cpp:1:0:
/tmp/gazebo/deps/klampt/Simulation/ODECustomGeometry.h:4:34: fatal error: geometry/AnyGeometry.h: No such file or directory
#include <geometry/AnyGeometry.h>
^
compilation terminated.
deps/klampt/CMakeFiles/gazebo_klampt.dir/build.make:54: recipe for target 'deps/klampt/CMakeFiles/gazebo_klampt.dir/Simulation/ODECustomGeometry.cpp.o' failed
make[2]: *** [deps/klampt/CMakeFiles/gazebo_klampt.dir/Simulation/ODECustomGeometry.cpp.o] Error 1
CMakeFiles/Makefile2:388: recipe for target 'deps/klampt/CMakeFiles/gazebo_klampt.dir/all' failed
make[1]: *** [deps/klampt/CMakeFiles/gazebo_klampt.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
I am guessing it is more a CMake fault than a Docker fault, but i still don't manage to find a way around it. Maybe somebody can point out my probably fairly obvious errors.
FROM stevekuznetsov/klampt:latest
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu vivid main" > /etc/apt/sources.list.d/ros-latest.list'
RUN apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
RUN apt-get update
RUN apt-get -y install ros-jade-desktop-full
RUN sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable vivid main" > /etc/apt/sources.list.d/gazebo-stable.list'
RUN apt-get -y install wget
RUN wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add -
RUN apt-get update
RUN wget https://bitbucket.org/osrf/release-tools/raw/default/jenkins-scripts/lib/dependencies_archive.sh -O /tmp/dependencies.sh
RUN apt-get -y install build-essential \
cmake \
mercurial
RUN hg clone https://bitbucket.org/ignitionrobotics/ign-math /tmp/ign-math
RUN cd /tmp/ign-math && \
hg up ign-math2 && \
mkdir build && \
cd build && \
cmake ../ && \
make -j4 && \
make install
RUN apt-get -y install build-essential \
cmake \
mercurial \
python \
libboost-system-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-regex-dev \
libboost-iostreams-dev \
libtinyxml-dev \
libxml2-utils \
ruby-dev \
ruby
RUN hg clone https://bitbucket.org/osrf/sdformat /tmp/sdformat
RUN cd /tmp/sdformat && \
hg up sdf3 && \
mkdir build && \
cd build && \
cmake ../ && \
make -j4 && \
make install
RUN hg clone https://lpuck#bitbucket.org/arocchi/gazebo ./tmp/gazebo
RUN apt-get -y install protobuf-compiler
RUN cd /tmp/gazebo && \
hg pull && \
hg update blem_gz6_6.5.1 && \
mkdir build && \
cd build && \
cmake -DKRISLIBRARY_INCLUDE_DIR=/etc/Klampt/Library/KrisLibrary -DKRISLIBRARY_LIBRARY=etc/Klampt/Library/KrisLibrary/lib ../ && \
make -j4 && \
make install
My guess is, that this line (third last):
cmake -DKRISLIBRARY_INCLUDE_DIR=/etc/Klampt/Library/KrisLibrary -DKRISLIBRARY_LIBRARY=etc/Klampt/Library/KrisLibrary/lib ../ && \
is wrong and therefore responsible for the error. I guess i have some dependency which is set wrong. It would be highly appreciated if somebody could help me.
Edit:
The new error, and i updated the Dockerfile and the error Cmake line
Linking CXX shared library libgazebo_physics_ode.so
/usr/bin/ld: cannot find -lKrisLibrary
collect2: error: ld returned 1 exit status
make[2]: *** [gazebo/physics/ode/libgazebo_physics_ode.so.6.5.1] Error 1
gazebo/physics/ode/CMakeFiles/gazebo_physics_ode.dir/build.make:558: recipe for target 'gazebo/physics/ode/libgazebo_physics_ode.so.6.5.1' failed
CMakeFiles/Makefile2:4864: recipe for target 'gazebo/physics/ode/CMakeFiles/gazebo_physics_ode.dir/all' failed
make[1]: *** [gazebo/physics/ode/CMakeFiles/gazebo_physics_ode.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

sha256sum error while building nvidia-docker on ppc64le

gurus.
I encountered the following error while building nvidia-docker of CUDA v8.0 on ppc64le.
root#minsky:/data/nvidia-docker# make cuda OS=ubuntu-16.04
make -C /data/nvidia-docker/ubuntu-16.04/cuda
make[1]: Entering directory '/data/nvidia-docker/ubuntu-16.04/cuda'
docker build -f /data/nvidia-docker/ubuntu-16.04/cuda/8.0/runtime/Dockerfile.ppc64le -t cuda:8.0-runtime /data//nvidia-docker/ubuntu-16.04/cuda/8.0/runtime
Sending build context to Docker daemon 10.24 kB
...
Step 6 : RUN CUDNN_DOWNLOAD_SUM=51f698d468401cef2e3e2ef9bb557bd57cbeb4dca895d1d1ae8a751d090bbe39 && curl -fsSL http://developer.download.nvidia.com/compute/redist/cudnn/v5.1/cudnn-8.0-linux-ppc64le-v5.1.tgz -O && echo "$CUDNN_DOWNLOAD_SUM cudnn-8.0-linux-ppc64le-v5.1.tgz" | sha256sum -c --strict - && tar -xzf cudnn-8.0-linux-ppc64le-v5.1.tgz -C /usr/local --wildcards 'cuda/targets/ppc64le-linux/lib/libcudnn.so.*' && ln -s cuda/targets/ppc64le-linux/lib /usr/local/cuda/lib64 && rm cudnn-8.0-linux-ppc64le-v5.1.tgz && ldconfig
---> Running in 19a5bb5c9c19
cudnn-8.0-linux-ppc64le-v5.1.tgz: FAILED
sha256sum: WARNING: 1 computed checksum did NOT match
The command '/bin/sh -c CUDNN_DOWNLOAD_SUM=51f698d468401cef2e3e2ef9bb557bd57cbeb4dca895d1d1ae8a751d090bbe39 && curl -fsSL http://developer.download.nvidia.com/compute/redist/cudnn/v5.1/cudnn-8.0-linux-ppc64le-v5.1.tgz -O && echo "$CUDNN_DOWNLOAD_SUM cudnn-8.0-linux-ppc64le-v5.1.tgz" | sha256sum -c --strict - && tar -xzf cudnn-8.0-linux-ppc64le-v5.1.tgz -C /usr/local --wildcards 'cuda/targets/ppc64le-linux/lib/libcudnn.so.*' && ln -s cuda/targets/ppc64le-linux/lib /usr/local/cuda/lib64 && rm cudnn-8.0-linux-ppc64le-v5.1.tgz && ldconfig' returned a non-zero code: 1
../../mk/cuda.mk:87: recipe for target '8.0-cudnn5-runtime' failed
make[1]: *** [8.0-cudnn5-runtime] Error 1
make[1]: Leaving directory '/data/fuzhiwen/nvidia-docker/ubuntu-16.04/cuda'
Makefile:37: recipe for target 'cuda' failed
make: *** [cuda] Error 2
Any idea on how to get around this gracefully ?
I solved this situation by editing the Dockerfile.ppc64le files as below.
root#minsky:/data/nvidia-docker# vi ./ubuntu-16.04/cuda/8.0/runtime/cudnn5/Dockerfile.ppc64le
...
RUN CUDNN_DOWNLOAD_SUM=663aac0328f821d90ae9c74ee43e90751706546c2ce769ea9c96f92864300af6 && \
#RUN CUDNN_DOWNLOAD_SUM=51f698d468401cef2e3e2ef9bb557bd57cbeb4dca895d1d1ae8a751d090bbe39 && \
root#minsky:/data/nvidia-docker# vi ./ubuntu-16.04/cuda/8.0/devel/cudnn5/Dockerfile.ppc64le
...
RUN CUDNN_DOWNLOAD_SUM=663aac0328f821d90ae9c74ee43e90751706546c2ce769ea9c96f92864300af6 && \
#RUN CUDNN_DOWNLOAD_SUM=51f698d468401cef2e3e2ef9bb557bd57cbeb4dca895d1d1ae8a751d090bbe39 && \
root#minsky:/data/nvidia-docker# make cuda OS=ubuntu-16.04
I got the checksum value of 663aac0328f821d90ae9c74ee43e90751706546c2ce769ea9c96f92864300af6 from the following test.
root#minsky:/data/nvidia-docker# sha256sum cudnn-8.0-linux-ppc64le-v5.1.tgz
663aac0328f821d90ae9c74ee43e90751706546c2ce769ea9c96f92864300af6 cudnn-8.0-linux-ppc64le-v5.1.tgz
This works fine. Still, I am not sure if this is the correct solution and why this error happens in the first place.

Error cannot find -lz building MariaDB on a debian based container

I'm trying to build MariaDB on a Debian based container. But it cannot find a z library.
Here is the container image script:
FROM debian
RUN apt-get update
RUN apt-get install -y libncurses-dev
RUN apt-get install -y build-essential;
RUN apt-get install -y cmake;
COPY mariadb-10.1.18.tar.gz /usr/bin/
WORKDIR /usr/bin/
RUN gzip -d mariadb-10.1.18.tar.gz
RUN tar -xvf mariadb-10.1.18.tar
RUN ln -s mariadb-10.1.18 mariadb
WORKDIR /usr/bin/mariadb/
RUN mkdir install; mkdir install/data; mkdir install/var; mkdir install/etc; mkdir install/tmp
RUN cd /usr/bin/mariadb/;
RUN rm -f CMakeCache.txt;
RUN cmake \
-DCMAKE_INSTALL_PREFIX=/usr/bin/mariadb/install \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DMYSQL_DATADIR=/usr/bin/mariadb/install/data \
-DDOWNLOAD_BOOST=1 \
-DWITH_BOOST=/usr/bin/mariadb/install/boost \
-DMYSQL_UNIX_ADDR=/usr/bin/mariadb/install/tmp/mariadb.sock
And the console output:
[ 77%] Building CXX object storage/tokudb/PerconaFT/ft/CMakeFiles/ft.dir/log_print.cc.o
Linking CXX shared library libft.so
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
storage/tokudb/PerconaFT/ft/CMakeFiles/ft.dir/build.make:1323: recipe for target 'storage/tokudb/PerconaFT/ft/libft.so' failed
make[2]: *** [storage/tokudb/PerconaFT/ft/libft.so] Error 1
CMakeFiles/Makefile2:3438: recipe for target 'storage/tokudb/PerconaFT/ft/CMakeFiles/ft.dir/all' failed
make[1]: *** [storage/tokudb/PerconaFT/ft/CMakeFiles/ft.dir/all] Error 2
Makefile:147: recipe for target 'all' failed
make: *** [all] Error 2
The command '/bin/sh -c make' returned a non-zero code: 2
either change the container script and specify CMake parameter -DWITH_ZLIB=bundled to use zlib sources in extra/zlib or install zlib by apt-get install zlib-devel

Resources