Fail compile nginx from source - nginx

dockerfile
FROM ubuntu:20.04
WORKDIR /tmp
COPY build.sh /tmp
RUN ./build.sh
build script
#!/bin/bash
set -xe
NGINX_DIR="/etc/nginx"
mkdir -p ${NGINX_DIR}
mkdir -p ${NGINX_DIR}/temp
mkdir -p /tmp/nginx_bin
apt update -y && apt install wget gcc make libpcre3 libpcre3-dev zlib1g-dev libssl-dev libgeoip-dev automake -y
wget https://nginx.org/download/nginx-1.22.1.tar.gz -P /tmp && tar zxvf /tmp/nginx-1.22.1.tar.gz -C /tmp
cd /tmp/nginx-1.22.1 && ./configure \
--with-debug \
--prefix=${NGINX_DIR} \
--sbin-path=${NGINX_DIR}/sbin/nginx \
--conf-path=${NGINX_DIR}/nginx.conf \
--pid-path=${NGINX_DIR}/logs/nginx.pid \
--lock-path=${NGINX_DIR}/logs/nginx.lock \
--error-log-path=${NGINX_DIR}/logs/error.log \
--http-log-path=${NGINX_DIR}/logs/access.log \
--with-cc-opt="-O2 -g -Wno-error" \
--with-ld-opt="-static" \
--with-pcre-jit \
--http-client-body-temp-path=${NGINX_DIR}/temp/client_body_temp \
--http-proxy-temp-path=${NGINX_DIR}/temp/proxy_temp \
--with-stream \
--with-stream_ssl_module \
--with-file-aio \
--with-threads \
--with-http_geoip_module \
--with-http_auth_request_module \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_v2_module \
--with-http_slice_module \
--with-http_gunzip_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_addition_module \
--with-http_gzip_static_module \
--with-http_realip_module \
--with-http_stub_status_module \
--with-http_dav_module \
--with-http_sub_module \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \
--with-openssl-opt="-g" && make -j4 && make -j4 install && cp objs/nginx /tmp/nginx_bin
I use the above dockerfile and shell script to compile nginx from source, if remove --with-ld-opt="-static" parameter, it will compile success, but after I add --with-ld-opt="-static" parameter, the complie will fail with the below error
checking for GeoIP library ... not found
checking for GeoIP library in /usr/local/ ... not found
checking for GeoIP library in /usr/pkg/ ... not found
checking for GeoIP library in /opt/local/ ... not found
but I already install the libgeoip-dev when running shell script
Could any one help take a look, how to fix it, thanks.
I use the above dockerfile and shell script to compile nginx from source, if remove --with-ld-opt="-static" parameter, it will compile success, but after I add --with-ld-opt="-static" parameter, the complie will fail with the below error
checking for GeoIP library ... not found
checking for GeoIP library in /usr/local/ ... not found
checking for GeoIP library in /usr/pkg/ ... not found
checking for GeoIP library in /opt/local/ ... not found

Related

error building docker image: Error: dependency ‘cmdstanr’ is not available

I have a problem building a docker image with the following codes:
FROM rocker/verse:latest
MAINTAINER xxx
RUN apt-get update \
&& apt-get install -y --no-install-recommends apt-utils ed libnlopt-dev libgdal-dev libudunits2-dev cargo jags libcairo2-dev libxt-dev libgeos-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/
# Install rstan
RUN install2.r --error --deps TRUE \
rstan \
&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds
# Global site-wide config -- neeeded for building packages
RUN mkdir -p $HOME/.R/ \
&& echo "CXXFLAGS=-O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -ffat-lto-objects -Wno-unused-local-typedefs \n" >> $HOME/.R/Makevars
# Config for rstudio user
RUN mkdir -p $HOME/.R/ \
&& echo "CXXFLAGS=-O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -ffat-lto-objects -Wno-unused-local-typedefs -Wno-ignored-attributes -Wno-deprecated-declarations\n" >> $HOME/.R/Makevars \
&& echo "rstan::rstan_options(auto_write = TRUE)\n" >> /home/rstudio/.Rprofile \
&& echo "options(mc.cores = parallel::detectCores())\n" >> /home/rstudio/.Rprofile
RUN Rscript -e "install.packages('cmdstanr', repos = 'http://cran.us.r-project.org', dependencies=TRUE)"
# Install rstan
RUN install2.r --error --deps TRUE \
rstan \
loo \
bayesplot \
rstanarm \
rstantools \
shinystan \
ggmcmc \
tidybayes \
LaplacesDemon \
&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds
RUN install2.r --error --deps TRUE \
zoo \
mgcv \
lubridate \
stringr \
loo \
jsonlite \
scales \
directlabels \
betareg \
extrafont \
pointdensityP \
&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds
# Install Roboto condensed
RUN wget -O /tmp/rc.zip https://fonts.google.com/download?family=Roboto%20Condensed \
&& cd /usr/share/fonts \
&& sudo mkdir googlefonts \
&& cd googlefonts \
&& sudo unzip -d . /tmp/rc.zip \
&& sudo chmod -R --reference=/usr/share/fonts/truetype /usr/share/fonts/googlefonts \
&& sudo fc-cache -fv \
&& rm -rf /tmp/rc.zip \
&& Rscript --slave --no-save --no-restore-history -e "extrafont::font_import(prompt=FALSE)"
And I failed to build the docker image with the following error:
#10 224.1 Error: dependency ‘cmdstanr’ is not available------executor failed running [/bin/sh -c install2.r --error --deps TRUE rstan loo bayesplot rstanarm rstantools shinystan ggmcmc tidybayes LaplacesDemon && rm -rf /tmp/downloaded_packages/ /tmp/*.rds]: exit code: 1
Can anyone help me with the issue?
The Getting Started with CmdStanR vignette says you should use
install.packages("cmdstanr",
repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
you're trying to install it from a CRAN mirror, which won't work because the package isn't on CRAN. (I haven't tested, you might want to install cmdstanr after you install Stan ...

Error while cross compiling Qt for a raspberry pi3

I want to cross compile Qt to develop a gui for a raspberry pi. I have been following this tutorial: https://wiki.qt.io/RaspberryPi2EGLFS
I am using this configure command:
./configure -release -opengl es2 -device linux-rasp-pi3-g++ -device-option \
CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- \
-sysroot ~/raspi/sysroot -opensource -confirm-license \
-make libs -no-use-gold-linker -prefix /usr/local/qt5pi \
-extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v
This is the error I'm getting back:
/home/vbox/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/vbox/raspi/sysroot -Wl,-O1 -Wl,-rpath-link,/home/vbox/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/vbox/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/vbox/raspi/sysroot/lib/arm-linux-gnueabihf -o verifyspec verifyspec.o
/home/vbox/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory
/home/vbox/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory
/home/vbox/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm
collect2: error: ld returned 1 exit status
Makefile:66: recipe for target 'verifyspec' failed
make: *** [verifyspec] Error 1
Note: Also available for Linux: linux-clang linux-icc
ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.`
This is the config.log:
vbox#vbox:~/qtbase$ cat config.log
Command line: -release -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=/home/vbox/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot /home/vbox/raspi/sysroot -opensource -confirm-license -make libs -no-use-gold-linker -prefix /usr/local/qt5pi -extprefix /home/vbox/raspi/qt5pi -hostprefix /home/vbox/raspi/qt5 -v
executing config test machineTuple
+ /home/vbox/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -dumpmachine
arm-linux-gnueabihf
test config.qtbase.tests.machineTuple succeeded
executing config test verifyspec
+ cd /home/vbox/qtbase/config.tests/verifyspec && /home/vbox/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_CFLAGS += --sysroot=/home/vbox/raspi/sysroot" "QMAKE_CXXFLAGS += --sysroot=/home/vbox/raspi/sysroot" "QMAKE_LFLAGS += --sysroot=/home/vbox/raspi/sysroot" -early "CONFIG += cross_compile" /home/vbox/qtbase/config.tests/verifyspec
Info: creating stash file /home/vbox/qtbase/config.tests/.qmake.stash
+ cd /home/vbox/qtbase/config.tests/verifyspec && MAKEFLAGS= /usr/bin/make
/home/vbox/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=/home/vbox/raspi/sysroot -O2 -std=gnu++11 -w -fPIC -I. -I/home/vbox/qtbase/mkspecs/devices/linux-rasp-pi3-g++ -o verifyspec.o verifyspec.cpp
/home/vbox/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/vbox/raspi/sysroot -Wl,-O1 -Wl,-rpath-link,/home/vbox/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/vbox/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/vbox/raspi/sysroot/lib/arm-linux-gnueabihf -o verifyspec verifyspec.o /home/vbox/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory
/home/vbox/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory
/home/vbox/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm
collect2: error: ld returned 1 exit status
Makefile:66: recipe for target 'verifyspec' failed
make: *** [verifyspec] Error 1
I'm not sure where to go from here, I don't know enough to start debugging this issue. Are there alternate toolchains available? Or is the issue with the QMakeSpec? Any suggestions on things to try would be very helpful.
This blog post seems more specific to RPi3, and probably does it too (last Jan 12, 2017):
https://medium.com/#amirmann/how-to-cross-compile-qt-for-raspberry-pi-3-on-linux-ubuntu-for-beginners-75acf2a078c
sudo apt-get upgrade
sudo apt-get update
sudo apt-get install libgl1-mesa-dev
...
sudo apt-get build-dep qt5-default
sudo apt-get install libxcb-xinerama0-dev
sudo apt-add-repository ppa:u-szeged/sedkit
sudo apt-get update
sudo apt-get install sedkit-env-qtwebkit
sudo apt-get install build-essential perl python git
sudo apt-get install “^libxcb.*” libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev
sudo apt-get install flex bison gperf libicu-dev libxslt-dev ruby
sudo apt-get install libssl-dev libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libfontconfig1-dev libcap-dev libxtst-dev libpulse-dev libudev-dev libpci-dev libnss3-dev libasound2-dev libxss-dev libegl1-mesa-dev gperf bison
sudo apt-get install libbz2-dev libgcrypt11-dev libdrm-dev libcups2-dev libatkmm-1.6-dev
sudo apt-get install libasound2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev
There is a note on the wiki you are looking at of some things they did to get it to work on newer builds. Here is some of the history of that wiki page:
https://wiki.qt.io/index.php?title=RaspberryPi2EGLFS&type=revision&diff=31538&oldid=30634
And then there is the device creation licensed version of Qt then you would use these instructions:
http://doc.qt.io/QtForDeviceCreation/qtee-preparing-hardware-rasberrypi.html
I have always learned a lot while digging into the articles on Linux from Scratch. In my recent building of Qt with nothing, they have been super helpful.
http://www.linuxfromscratch.org/blfs/view/8.0/x/qt5.html
Hope those links help.
This is my bash script for cross-compiling Qt for raspberry-pi. You can
this script with command <script name> <TcpIp of Raspberrry> $USER
#!/bin/bash
RASP_ADR=$1
USERNAME=$2
if [ ! $RASP_ADR ]
then
echo "Error: need Ip address"
exit 1
fi
LOGFILE=install.log.txt
rm -f $LOGFILE
ID_RSA=/root/.ssh/cu4_rsa
SSH="ssh -i $ID_RSA root#$RASP_ADR"
DEST=~/raspi
QT_VERSION=5.9
function log {
local t=`date`
echo "[$t] $#" | tee -a $LOGFILE
}
function remote_src {
local message
local exitcode
message=$1
shift
log $message
log "Remote $RASP_ADR command: $#"
OUT=`$SSH "$#" | tee /dev/tty | tee -a $LOGFILE`
exitcode=$?
if [ $exitcode -ne 0 ]; then
log "Exit with ERROR $exitcode"
exit $exitcode
fi
}
function local_src {
local message
local exitcode
message=$1
shift
log $message
log "Local command: $#"
OUT=`bash -c "$#" | tee /dev/tty | tee -a $LOGFILE`
exitcode=$?
if [ $exitcode -ne 0 ]; then
log "Exit with ERROR $exitcode"
exit $exitcode
fi
}
function Append_Qt_Module {
local QtModule
QtModule=$1
log "install $QtModule"
local_src \
"Clone $QtModule Qt-module" \
"cd $DEST && git clone git://code.qt.io/qt/$QtModule.git -b $QT_VERSION"
local_src \
"Make $QtModule Qt-module" \
"cd $DEST/$QtModule && $DEST/qt5/bin/qmake -r && make && make install"
local_src \
"Synchronize qt5pi with Raspberry pi" \
"rsync -avz -e \"ssh -i $ID_RSA\" $DEST/qt5pi pi#$RASP_ADR:/usr/local"
}
local_src \
"open key -> Raspberry" \
"cat /root/.ssh/cu4_rsa.pub | ssh pi#$RASP_ADR \"sudo cat - > authorized_keys; sudo mkdir -p /root/.ssh; sudo mv authorized_keys /root/.ssh; sudo chown -R root:root /root/.ssh\""
remote_src \
"Update System" \
"apt-get update"
remote_src \
"Upgrade System" \
"apt-get -y upgrade"
remote_src \
"Install Synaptic" \
"apt-get -y install synaptic"
remote_src \
"Install Qt libraries" \
"apt-get -y install libfontconfig1-dev libdbus-1-dev libudev-dev"
remote_src \
"Install Xcb" \
"apt-get -y install \"^libxcb.*\" libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev"
remote_src \
"Install Qt-WebKit" \
"apt-get -y install flex bison gperf libicu-dev libxslt-dev ruby"
remote_src \
"Install Qt WebEngine" \
"apt-get -y install libssl-dev libxcursor-dev libxcomposite-dev libxrandr-dev"
remote_src \
"Install Qt Multimedia" \
"apt-get -y install libasound2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev"
DEB_SRC="deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi"
remote_src \
"Проверка открытости deb_src" \
"cat /etc/apt/sources.list | grep -s -G '^$DEB_SRC' | cat"
if [ ! "$OUT" ]
then
remote_src \
"Открываем комментарии" \
"echo '$DEB_SRC' >> /etc/apt/sources.list"
else
log "DEB_SRC открыты ранее"
fi
remote_src \
"Update System" \
"apt-get update"
remote_src \
"Build dependences for qt4-x11" \
"apt-get -y build-dep qt4-x11"
remote_src \
"Build dependences for libqt5gui5" \
"apt-get -y build-dep libqt5gui5"
remote_src \
"Install more libs for Xcb" \
"apt-get -y install libinput-dev libts-dev libxcb-xinerama0-dev libxcb-xinerama0"
remote_src \
"Make dir for Qt libs" \
"mkdir /usr/local/qt5pi; chown pi:pi /usr/local/qt5pi"
remote_src \
"Reboot" \
"reboot"
while true; do
sleep 1s
log "wait..."
$SSH "echo done"
if [ $? -eq 0 ]; then break; fi
done
local_src \
"Install Git" \
"apt-get -y install git && mkdir -p $DEST && cd $DEST"
local_src \
"Clone RaspberryPi tools" \
"git clone https://github.com/raspberrypi/tools $DEST/tools"
local_src \
"OR Update Raspberry Pi Tools" \
"cd $DEST/tools && git pull origin master"
fi
local_src \
"Synchronize local computer with Raspberry Pi" \
"cd $DEST && mkdir -p /sysroot /sysroot/usr /sysroot/opt && \
rsync -avz -e \"ssh -i $ID_RSA\" root#$RASP_ADR:/lib sysroot && \
rsync -avz -e \"ssh -i $ID_RSA\" root#$RASP_ADR:/usr/include sysroot/usr && \
rsync -avz -e \"ssh -i $ID_RSA\" root#$RASP_ADR:/usr/lib sysroot/usr && \
rsync -avz -e \"ssh -i $ID_RSA\" root#$RASP_ADR:/opt/vc sysroot/opt && \
rsync -avz -e \"ssh -i $ID_RSA\" root#$RASP_ADR:/usr/local/include sysroot/usr/local && \
rsync -avz -e \"ssh -i $ID_RSA\" root#$RASP_ADR:/usr/local/lib sysroot/usr/local"
local_src \
"Get sysroot-relative.py script" \
"cd $DEST && wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py && \
chmod +x sysroot-relativelinks.py && \
./sysroot-relativelinks.py sysroot "
exit 0
local_src \
"Получаем qtbase версии $QT_VERSION и конфигурируем Qt."
"`git clone -b $QT_VERSION git://code.qt.io/qt/qtbase.git $DEST/qtbase`"
local_src \
"OR Update qtbase версии $QT_VERSION" \
"cd $DEST/qtbase && git pull origin $QT_VERSION"
local_src \
"Конфигурация и установка Qt$QT_VERSION" \
"cd $DEST/qtbase && ./configure -release -opengl es2 -device linux-rasp-pi3-g++ \
-device-option CROSS_COMPILE=$DEST/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- \
-sysroot $DEST/sysroot -opensource -confirm-license -make libs -make tools -qt-pcre -optimized-qmake -reduce-exports \
-release -prefix /usr/local/qt5pi -extprefix $DEST/qt5pi -hostprefix $DEST/qt5 -no-use-gold-linker -v && \
make -j 4 && make install"
local_src \
"Change owner to $USERNAME on $DEST" \
"chown -R $USERNAME:$USERNAME $DEST"
local_src \
"Get new free types from http://dejavu-fonts.org" \
"cd $DEST && wget http://sourceforge.net/projects/dejavu/files/dejavu/2.37/dejavu-fonts-ttf-2.37.tar.bz2 && \
tar -xvf dejavu-fonts-ttf-2.37.tar.bz2"
local_src \
"Send type to target dir" \
"cd $DEST && mkdir -p qt5pi/lib/fonts && \
cp dejavu-fonts-ttf-2.37/ttf/DejaVuSansMono.ttf qt5pi/lib/fonts/"
local_src \
"Send libs to RaspberryPi" \
"cd $DEST && rsync -avz -e \"ssh -i $ID_RSA\" qt5pi root#$RASP_ADR:/usr/local"
local_src \
"Build Test application" \
"cd $DEST/qtbase/examples/opengl/qopenglwidget && \
$DEST/qt5/bin/qmake && \
make && \
scp -i $ID_RSA qopenglwidget root#$RASP_ADR:/home/pi "
remote_src \
"Добавляем пути к библиотекам Qt на Raspberry Pi" \
"echo /usr/local/qt5pi/lib | tee /etc/ld.so.conf.d/qt5pi.conf && \
ldconfig"
remote_src \
"Устранение неполадок в библиотеке EGL/GLES " \
"rm /usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0 /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0 && \
ln -s /opt/vc/lib/libEGL.so /usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0 && \
ln -s /opt/vc/lib/libGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0 && \
ln -s /opt/vc/lib/libEGL.so /opt/vc/lib/libEGL.so.1 && \
ln -s /opt/vc/lib/libGLESv2.so /opt/vc/lib/libGLESv2.so.2"
remote_src \
"Запуск теста" \
"nohup /home/pi/qopenglwidget > /dev/null 2>&1 &"
log "Please push the some key when you are ready to next operation"
read -n1
remote_src \
"Kill test" \
"pkill qopenglwidget"
#Add youre Qt modules
Append_Qt_Module qtserialport
remote_src \
"Обновляем символьные линки к библиотекам Qt на Raspberry Pi" \
"ldconfig"
log "DONE!!!!"
exit 0
I edited device mkspec file linux-rasp-pi3-g++/qmake.conf like this
VC_LIBRARY_PATH = $$[QT_SYSROOT]/opt/vc/lib
VC_INCLUDE_PATH = $$[QT_SYSROOT]/opt/vc/include
QMAKE_LIBDIR_OPENGL_ES2 = $${VC_LIBRARY_PATH}
QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL_ES2
QMAKE_LIBDIR_OPENVG = $$QMAKE_LIBDIR_OPENGL_ES2
QMAKE_INCDIR_EGL = \
$${VC_INCLUDE_PATH} \
$${VC_INCLUDE_PATH}/interface/vcos/pthreads \
$${VC_INCLUDE_PATH}/interface/vmcs_host/linux
QMAKE_INCDIR_OPENGL_ES2 = $${QMAKE_INCDIR_EGL}
QMAKE_INCDIR_OPENVG = $${QMAKE_INCDIR_EGL}
QMAKE_LIBS_OPENGL_ES2 = -lGLESv2
QMAKE_LIBS_EGL = -lEGL -lGLESv2
QMAKE_LIBS_OPENVG = -lEGL -lOpenVG -lGLESv2
and use gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf toolchain.
I wrote this blog which may be helpful: Build Qt 5.10 for Raspberry Pi 3

Issues with R packages install inside Postgres Docker Image

I have a postgres Dockerfile that works perfectly fine. I managed to install R-3.3.3 inside the image via the Dockerfile and found the containers from this work correctly. However when I tried to install packages via the following entries, the image creation succeeds however the container from it exits right away with normal status. Here are the new entries I added that changed the behavior. What am I missing?
RUN R -e "install.packages('devtools',repos='http://cran.us.r-project.org')"
&& R -e "install.packages('RPostgreSQL',repos='http://cran.us.r-project.org')" \
&& R -e "install.packages('hash',repos='http://cran.us.r-project.org')" \
&& R -e "install.packages('nloptr',repos='http://cran.us.r-project.org')" \
&& R -e "install.packages('DBI',repos='http://cran.us.r-project.org')" \
&& R -e "install.packages('Rcpp',repos='http://cran.us.r-project.org')" \
&& R -e "install.packages('BH',repos='http://cran.us.r-project.org')"
It all worked fine. Something incorrect with the Docker file. After I got this together, it all started working fine.
RUN apt-get install -y --auto-remove \
default-jdk \
libcurl4-openssl-dev \
build-essential \
gfortran \
zlib1g \
zlib1g-dev \
libbz2-dev \
liblzma-dev \
libpcre3-dev \
postgresql-9.6-plr \
libpq-dev \
libssl-dev \
&& LD_LIBRARY_PATH=/usr/lib/apt/methods/bzip2 apt-get -y install wget \
&& wget -O /R-3.3.3.tar.gz https://cran.r-project.org/src/base/R-3/R-3.3.3.tar.gz \
&& cd / \
&& gunzip /R-3.3.3.tar.gz \
&& tar xvf R-3.3.3.tar \
&& cd R-3.3.3 \
&& ./configure --prefix=/usr --with-readline=no --with-x=no \
&& make \
&& make install \
&& R -e "install.packages('devtools',repos='http://cran.us.r-project.org')" \
&& R -e "install.packages('RPostgreSQL',repos='http://cran.us.r-project.org')" \
&& R -e "install.packages('hash',repos='http://cran.us.r-project.org')" \
&& R -e "install.packages('nloptr',repos='http://cran.us.r-project.org')" \
&& R -e "install.packages('DBI',repos='http://cran.us.r-project.org')" \
&& R -e "install.packages('Rcpp',repos='http://cran.us.r-project.org')" \
&& R -e "install.packages('BH',repos='http://cran.us.r-project.org')" \
&& cd .. \
&& rm R-3.3.3.tar \
&& rm -rf R-3.3.3 \
&& apt purge -y --auto-remove \
default-jdk \
libssl-dev \
libpq-dev \
libpcre3-dev \
liblzma-dev \
libbz2-dev \
zlib1g-dev \
libcurl4-openssl-dev \
build-essential \
wget \
&& rm -f /tmp/Rtmp* \
&& apt-get -y autoremove

Unable to build Nginx (unrecognized option)

I am having some issues when configuring nginx, I have the following:
./configure \
--user=www-data \
--group=www-data \
--prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-debug \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-pcre \
--with-file-aio \
--with-http_realip_module \
--with-http_v2_module \
--with-pcre-jit \
--with-ipv6 \
--add-module=/root/modsecurity \
--add-module=/root/ngx_pagespeed-1.12.34.2-beta ${PS_NGX_EXTRA_FLAGS} \
--add-module=/root/headers-more-nginx
But I am getting the following error:
configure: error: unrecognized option: `--user=www-data'
If I try removing that option then the next option will give the exact same.
Does anyone know what I am doing wrong here?
Thanks!
Strangely I managed to fix it by removing the following:
--add-module=/root/modsecurity \

Nginx unable to find libpcre.so.0 after install from source

I am building nginx from source on ubuntu 14.04 but after building, when I run nginx I get the following error:
/etc/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.0:
cannot open shared object file: No such file or directory
The reason is probably because it is called libpcre.so.3. Is there a package I can install for libpcre0?
Can I configure nginx to use libpcre.so.3 somehow?
Here is the how to compile Nginx with OpenSSL and Pcre-8.36, with custom Username and Group for additional privileges:
./configure --with-cc-opt="-I $STATICLIBSSL/include -I/usr/include" \
--with-ld-opt="-L $STATICLIBSSL/lib -Wl,-rpath -lssl -lcrypto -ldl -lz" \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--pid-path=/var/run/nginx.pid \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-pcre=/lib/libpcre.so.1
--with-http_ssl_module \
--with-http_spdy_module \
--with-file-aio \
--with-ipv6 \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--without-mail_pop3_module \
--without-mail_smtp_module \
--without-mail_imap_module \
--user=nginx \
--group=nginx \
--with-http_spdy_module \
--with-http_auth_request_module \
--with-openssl=/root/openssl/openssl-1.0.2a/libssl.a
--with-zlib=/usr/lib/x86_64-linux-gnu/libz.a

Resources