make not found with Dockerfile and centos:7 image - python-2.7

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

Related

installation error: 'Unable to locate package g++-4.8'

I am trying to install gcc and g++ version 4.8 to run a specific software in Ubuntu 22.04.1
when I perform
sudo apt-get install g++-4.8
it says
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package g++-4.8
E: Couldn't find any package by glob 'g++-4.8'
E: Couldn't find any package by regex 'g++-4.8'
and When I perform
sudo apt-get install gcc-4.8
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'gcc-4.8-hppa64' for regex 'gcc-4.8'
The following packages were automatically installed and are no longer required:
chromium-codecs-ffmpeg-extra gstreamer1.0-vaapi i965-va-driver intel-media-va-driver libaacs0 libaom3 libass9 libavcodec58 libavformat58 libavutil56 libbdplus0 libbluray2
libbs2b0 libchromaprint1 libcodec2-1.0 libdav1d5 libflashrom1 libflite1 libftdi1-2 libgme0 libgsm1 libgstreamer-plugins-bad1.0-0 libigdgmm12 liblilv-0-0 libmfx1 libmysofa1
libnorm1 libopenmpt0 libpgm-5.3-0 libpostproc55 librabbitmq4 librubberband2 libserd-0-0 libshine3 libsnappy1v5 libsord-0-0 libsratom-0-0 libsrt1.4-gnutls libssh-gcrypt-4
libswresample3 libswscale5 libudfread0 libva-drm2 libva-wayland2 libva-x11-2 libva2 libvdpau1 libvidstab1.1 libx265-199 libxvidcore4 libzimg2 libzmq5 libzvbi-common libzvbi0
mesa-va-drivers mesa-vdpau-drivers pocketsphinx-en-us va-driver-all vdpau-driver-all
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
What could be done?
You could possibly recompile gcc 4.8.5 with the following script. However there is a lot that can go wrong depending on the machine that you are compiling it since the compiler itself depends on a large set of utilities - called the toolchain and they are tightly coupled with the machine's own system libraries, in particular the C standard library.
sudo dpkg --add-architecture i386
sudo apt update
sudo apt upgrade
sudo apt-get install gcc-multilib libstdc++6:i386
wget https://ftp.gnu.org/gnu/gcc/gcc-4.8.5/gcc-4.8.5.tar.bz2 --no-check-certificate
tar xf gcc-4.8.5.tar.bz2
cd gcc-4.8.5
./contrib/download_prerequisites
cd ..
sed -i -e 's/__attribute__/\/\/__attribute__/g' gcc-4.8.5/gcc/cp/cfns.h
sed -i 's/struct ucontext/ucontext_t/g' gcc-4.8.5/libgcc/config/i386/linux-unwind.h
mkdir xgcc-4.8.5
pushd xgcc-4.8.5
$PWD/../gcc-4.8.5/configure --enable-languages=c,c++ --prefix=/usr --enable-shared --enable-plugin --program-suffix=-4.8.5
make MAKEINFO="makeinfo --force" -j
sudo make install -j

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

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

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.

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