Error: unrecognized command line option ‘-Wno-invalid-source-encoding’ [-Werror] within building Mesos - c++

My operating system is Ubuntu 18.10. I follow these steps on three nodes:
To install Mesos I did these steps one by one without any errors, except every node has already had Open JDK 8, so I did not install Open JDK 8 again.
sudo apt-get update
sudo apt-get install -y tar wget git
sudo apt-get install -y openjdk8-jdk (I did not do that)
sudo apt-get install -y autoconf libtool
sudo apt-get -y install build-essential python-dev python-six python-
virtualenv libcurl4-nss-dev libsasl2-dev libsasl2-modules maven
libapr1-dev libsvn-dev zlib1g-dev iputils-ping
The problem is begin when I want to build Mesos. I did these steps for that:
cd mesos-1.7.0
./bootstrap
mkdir build
cd build
../configure
make
My IP addresses are 150.20.11.137,150.20.11.134,150.20.11.157. I downloaded Mesos package on all of them and extracted in the same path.
I did <../configure> on every node without any problems, but when I run "make" I got this error on each node:
third_party/cares/cares/ares_init.c: In function ‘ares_dup’:
third_party/cares/cares/ares_init.c:301:17: error:
argument to ‘sizeof’ in ‘strncpy’ call is the same expression as the source; did
you mean to use the size of the destination? [-Werror=sizeof-pointer-
memaccess]
sizeof(src->local_dev_name));
^
third_party/cares/cares/ares_init.c: At top level:
cc1: error: unrecognized command line option ‘-Wno-invalid-source-
encoding’ [-Werror]
cc1: all warnings being treated as errors
make[4]: *** [Makefile:2635: /home/spark/mesos-
1.7.0/build/3rdparty/grpc-
1.10.0/objs/opt/third_party/cares/cares/ares_init.o] Error 1
make[4]: Leaving directory '/home/spark/mesos-
1.7.0/build/3rdparty/grpc-1.10.0'
make[3]: *** [Makefile:1446: grpc-1.10.0-build-stamp] Error 2
make[3]: Leaving directory '/home/spark/mesos-1.7.0/build/3rdparty'
make 2]: *** [Makefile:1035: all-recursive] Error 1
make[2]: Leaving directory '/home/spark/mesos-1.7.0/build/3rdparty'
make[1]: *** [Makefile:765: all] Error 2
make[1]: Leaving directory '/home/spark/mesos-1.7.0/build/3rdparty'
make: *** [Makefile:768: all-recursive] Error 1

Problem solved. The problem was because of GCC version. GCC version in Ubuntu 18.10 is 8.2.0. I installed gcc-5 and g++-5 with this instruction:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5
Then to choose GCC version that I want, I have to install "update-alternatives" for gcc. Therefore, I run these commands:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 500 --slave
/usr/bin/g++ g++ /usr/bin/g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave
/usr/bin/g++ g++ /usr/bin/g++-8
After that I chose gcc-5 with this command :
sudo update-alternatives --config gcc
Moreover, I had an error related to OpenSSL; then I installed it via this command:
sudo apt-get install libssl-dev
After those modifications, I started to install Mesos and it installed without any errors. I hope this illustration was helpful for others.

Related

Trouble building caffe from source

I am trying to install caffe by building it from source
After issuing the following command from the caffe root directory
$ make all -j4
I am getting an error
...
CXX src/caffe/layer_factory.cpp
CXX src/caffe/blob.cpp
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0
/usr/bin/x86_64-linux-gnu-ld: cannot find -lpython3.6
collect2: error: ld returned 1 exit status
Makefile:582: recipe for target '.build_release/lib/libcaffe.so.1.0.0' failed
make: *** [.build_release/lib/libcaffe.so.1.0.0] Error 1
Dependencies installed
$ sudo apt install python3-opencv
$ sudo apt-get install libatlas-base-dev
$ sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
$ sudo apt-get install --no-install-recommends libboost-all-dev
$ sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
$ sudo apt-get install the python3-dev
CUDA: CUDA 9 CuDnn 7.4
Ubuntu: Ubuntu 18.04
Makefile.config
I have looked at all the issues in the source Github repository but couldn't find anything useful.
Therefore that your error states cannot find -lpython3.6 you are missing the libpython3.6.so on your system.
Try to:
sudo apt-get install libpython3.6-dev
The issue is resolved, I had to make the following changes in Makefile.config file
From
PYTHON_LIBRARIES := boost_python3 python3.6
PYTHON_INCLUDE := /usr/include/python3.6 \
/usr/lib/python3.6/dist-packages/numpy/core/include
To
PYTHON_LIBRARIES := boost_python3 python3.6m
PYTHON_INCLUDE := /usr/include/python3.6m \
/usr/lib/python3.6/dist-packages/numpy/core/include

make: *** [port-target] Error 2 When trying to install GDAL for GeoDjango using Ubuntu 18.04

I am trying to install GeoDjango to use in my project. I am using Ubuntu 18.04 through VirtualBox. I am also using the GeoDjango installlation Guide to install Gdal. I have GEOS and PROJ.4 installled.
I have successfully run the below commands :
$ wget http://download.osgeo.org/gdal/1.11.2/gdal-1.11.2.tar.gz #success
$ tar xzf gdal-1.11.2.tar.gz #success
$ cd gdal-1.11.2 #success
Later I am supposed to do the below (according to the documentation):
$ ./configure
$ make # Go get some coffee, this takes a while.
$ sudo make install
$ cd ..
However, when I run these lines:
$ ./configure #success
$ make # Go get some coffee, this takes a while. #ERROR SEE BELOW
I get the below error:
samir#samir-VirtualBox:~/gdal-1.11.2$ make # Go get some coffee, this takes a while.
(cd port; make)
make[1]: Entering directory '/home/samir/gdal-1.11.2/port'
/bin/bash /home/samir/gdal-1.11.2/libtool --mode=compile --tag=CXX g++ -std=c++98 -g -O2 -DHAVE_SSE_AT_COMPILE_TIME -Wall -DOGR_ENABLED -I/home/samir/gdal-1.11.2/port -I../frmts/zlib -DHAVE_LIBZ -c -o cpl_error.lo cpl_error.cpp
libtool: compile: g++ -std=c++98 -g -O2 -DHAVE_SSE_AT_COMPILE_TIME -Wall -DOGR_ENABLED -I/home/samir/gdal-1.11.2/port -I../frmts/zlib -DHAVE_LIBZ -c cpl_error.cpp -fPIC -DPIC -o .libs/cpl_error.o
cpl_error.cpp: In function 'void CPLErrorV(CPLErr, int, const char*, __va_list_tag*)':
cpl_error.cpp:190:20: error: incompatible types in assignment of '__va_list_tag*' to 'va_list {aka __va_list_tag [1]}'
wrk_args = args;
^~~~
cpl_error.cpp:226:24: error: incompatible types in assignment of '__va_list_tag*' to 'va_list {aka __va_list_tag [1]}'
wrk_args = args;
^~~~
../GDALmake.opt:568: recipe for target 'cpl_error.lo' failed
make[1]: *** [cpl_error.lo] Error 1
make[1]: Leaving directory '/home/samir/gdal-1.11.2/port'
GNUmakefile:53: recipe for target 'port-target' failed
make: *** [port-target] Error 2
Below is a Screenshot of the error. so you can see it in color
How can I resolve this error ?
Please make sure you have ubuntu installed on your computer. If you
are using windows, install VirtualBox and download Ubuntu (Its a Linux
OS). You might have to do a basic course on Ubuntu either on YouTube
or Udemy then do
sudo apt install geos
sudo apt install proj4
sudo apt install gdal
sudo-apt install postgressql
sudo-apt install till postgis
that's it.. you are done as simple as that..
then download pgadmin3 (pgadmin4 is not available on ubuntu at the
time of this comment)
make the database on pgadmin3 (its way simpler than psql)
In your Virtual Env do
pip install dj-database-url
pip install psycopg2
pip install pillow
I suffered 2 weeks figuring this out.. Hopefully you don't have to
Trying this on Windows is next to impossible. Don't follow the
GeoDjango documents for installing GeoDjango with make and
make-install as that is very difficult.

Linking error: "relocation R_X86_64_32 ... can not be used when making a shared object; recompile with -fPIC"

I am attempting to compile Tox (specifically toxcore). When I attempt to compile it, I encounter the following error:
>make
make all-recursive
make[1]: Entering directory '/root/Tox/toxcore'
Making all in build
make[2]: Entering directory '/root/Tox/toxcore/build'
CCLD libtoxav.la
/usr/bin/ld: /usr/local/lib/libvpx.a(vpx_codec.c.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libvpx.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:1385: recipe for target 'libtoxav.la' failed
make[2]: *** [libtoxav.la] Error 1
make[2]: Leaving directory '/root/Tox/toxcore/build'
Makefile:506: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/Tox/toxcore'
Makefile:410: recipe for target 'all' failed
make: *** [all] Error 2
Following the error message, I have attempted to use fPIC by exporting C++ flags (export CXXFLAGS="$CXXFLAGS -fPIC"), by adding an argument to configure (./configure --enable-shared) and by editing the Makefile (changing CC = gcc to CC = gcc -fPIC), but these attempts have not worked and I still encounter the same error. What might be going wrong?
Here's the approach I have right now (on Ubuntu):
sudo apt-get install pkg-config
sudo apt-get install build-essential
sudo apt-get install libtool
sudo apt-get install autotools-dev
sudo apt-get install automake
sudo apt-get install checkinstall
sudo apt-get install check
sudo apt-get install git
sudo apt-get install yasm
cd ~
mkdir Tox
cd Tox
git clone https://github.com/jedisct1/libsodium.git
cd libsodium
git checkout tags/1.0.3
./autogen.sh
./configure && make check
sudo checkinstall --install --pkgname libsodium --pkgversion 1.0.0 --nodoc
sudo ldconfig
cd ..
git clone https://chromium.googlesource.com/webm/libvpx
cd libvpx
git checkout tags/v1.3.0
./configure
make
make install
cd ..
git clone https://github.com/irungentoo/toxcore.git
cd toxcore
autoreconf -i
./configure
make
sudo make install
cd ..
There must be a bug in the configuration script, it shouldn't come up with libvpx.a.
But worry not, since Ubuntu provides packages for both libvpx-dev and libsodium-dev, and using those seems to work just fine, so you should probably just do that unless there's some strong reason not to.
Also, unless you need classic toxcore, it seems c-toxcore is the successor, so you probably should use it instead.
Configuring with --enable-pic will add in the necessary -fPIC options, and works for me.

How to install aclocal in ubuntu14.04

I want to install aclocal -I m4 in ubuntu 14.04 when i run the command its showing
First installed
sudo apt-get install autotools-dev
then,
sudo apt-get install aclocal
same error also getting.
I needed to install all of the following packages to get aclocal running:
apt install automake
apt install autoconf
apt install m4
apt install perl
apt install libtool
This was the error message that I received when I tried to install ssdeep:
WARNING: 'aclocal-1.13' is missing on your system.
You should only need it if you modified 'acinclude.m4' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'aclocal' program is part of the GNU Automake package:
<http://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<http://www.gnu.org/software/autoconf>
<http://www.gnu.org/software/m4/>
<http://www.perl.org/>
Makefile:426: recipe for target 'aclocal.m4' failed
make: *** [aclocal.m4] Error 127
/bin/sh: 1: libtoolize: not found
/usr/bin/m4:aclocal.m4:1069: cannot open `m4/libtool.m4': No such file or directory
/usr/bin/m4:aclocal.m4:1070: cannot open `m4/ltoptions.m4': No such file or directory
/usr/bin/m4:aclocal.m4:1071: cannot open `m4/ltsugar.m4': No such file or directory
/usr/bin/m4:aclocal.m4:1072: cannot open `m4/ltversion.m4': No such file or directory
/usr/bin/m4:aclocal.m4:1073: cannot open `m4/lt~obsolete.m4': No such file or directory
autom4te: /usr/bin/m4 failed with exit status: 1
automake: error: autoconf failed with exit status: 1
Failed while building ssdeep lib with configure and make.
Retry with autoreconf ...
Failed to reconfigure the project build.
Install it from source, you avoid a lot of troubles compiling other software in the future. aclocal package does NOT exist, and is part of automake package.
$ sudo apt-get install automake
Will install aclocal
I recommend compiling from script, it will update to the latest version
#!/bin/bash
VERSION=1.15
wget ftp://ftp.gnu.org/gnu/automake/automake-${VERSION}.tar.gz &> /dev/null
if [ -f "automake-${VERSION}.tar.gz" ]; then
tar -xzf automake-${VERSION}.tar.gz
cd automake-${VERSION}/
./configure
make && make install
echo -e "\e[1;39m[ \e[1;32mOK\e[39m ] automake-${VERSION} installed\e[0;39m"
else
echo -e "\e[1;39m[ \e[31mError\e[39m ] cannot fetch file from ftp://ftp.gnu.org/gnu/automake/ \e[0;39m"
exit 1
fi

make not found with Dockerfile and centos:7 image

I have a very basic Dockerfile which uses FROM centos:7, then downloads Python-2.7.9.tar.xz, and attempts to ./configure && make && make altinstall.
I get the following error upon make:
creating Makefile
/bin/sh: make: command not found
The command '/bin/sh -c cd /root/Python-2.7.9 && ./configure -- prefix=/usr/local && make && make altinstall' returned a non-zero code: 127
I've installing the following libs prior to running make
yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel xz-libs gcc g++ build-essential kernel-headers kernel-devel
Yet error still persists. How can I resolve this?
A simple RUN yum -y install make solved the problem