CPP-REST-SDK in Centos 7 - centos

I have a CentOS 7 (EPEL-Repo is registered) but I do not find the package for CPP-REST (libcpprest-dev in Debian) in the repos.
Do I need to install it from vanilla or is there a package in CentOS?
Thanks!

Short answer...
There is not an "official" CentOS 7 package at this time (2018-10-03) for cpprestsdk (libcpprest-dev in Debian).
Long answer (sharing this in case it helps anyone)...
You could build cpprestsdk from source, but the instructions "How to build for Linux" (https://github.com/Microsoft/cpprestsdk/wiki/How-to-build-for-Linux) do not include CentOS or RHEL (at the time of this writing, 2018-10-03).
Before building cpprestsdk on CentOS 7, you'll need to update boost (at time of this writing CentOS 7 repos have boost 1.53, but 1.54 is required, and 1.68 is latest). You can do this to update (using boost 1.68 as example):
cd && wget https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz
tar -xzvf boost_1_68_0.tar.gz
cd ~/boost_1_68_0
./bootstrap.sh --prefix=/opt/boost
sudo ./b2 install --prefix=/opt/boost --with=all
After updating boost, I was able to build cpprestsdk on CentOS 7 like this...
Install some needed tools/libraries:
sudo yum -y install git cmake3 openssl-devel gcc-c++ make
Download the cpprestsdk project:
git clone https://github.com/Microsoft/cpprestsdk.git casablanca
cpprestsdk wants to treat warnings as errors. I had to turn this off by commenting out this line in ~/casablanca/Release/CMakeLists.txt:
#set(WERROR ON CACHE BOOL "Treat Warnings as Errors.")
Prepare/build cpprestsdk project:
cd casablanca/Release
mkdir build.release && cd build.release
cmake3 .. -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT=/opt/boost
make
Install header files and library
sudo make install
Notice that I am calling cmake3 (not cmake) and I am specifying the boost root; which differs from the official instructions that appear to be written and tested for Ubuntu (not CentOS or RHEL). To build my projects using cpprestsdk, I had to use ldconfig to find the library paths.

Related

Setting up a Movesense development environment on Linux

I followed an instruction to set up a Movesense development environment, "Manual setup on Linux", from Suunto / Movesense-community / Movesense-device-lib, README.md
However, I got stuck at sudo apt-get install gcc-arm-embedded:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gcc-arm-embedded
How can I move forward?
I used Ubuntu 17.10 (Artful Aardvark) as a guest OS.
Try adding the repository:
sudo apt-get remove gcc-arm-none-eabi gdb-arm-none-eabi binutils-arm-none-eabi
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt-get update
I downloaded it directly from ARM IIRC:
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
Following the instructions under "GNU/Linux" in the "GNU ARM Embedded Toolchain" section of
https://gnu-mcu-eclipse.github.io/toolchain/arm/install/#gnu-arm-embedded-toolchain
Summarized:
// Get some support dependencies for 32 bit running on 64-bit machines
// Check toolchain README for actual list.
$ sudo apt-get -y install lib32z1 lib32ncurses5 lib32bz2-1.0
// Install the toolchain
$ mkdir -p "${HOME}"/opt
$ cd "${HOME}"/opt
$ tar xjf ~/Downloads/gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2
$ chmod -R -w "${HOME}"/opt/gcc-arm-none-eabi-7-2017-q4-major
You will likely have to modify some of the build files in the Movesense project to point to this location for it to build.
The following might also be helpful: How to install a functional ARM cross-GCC toolchain on Ubuntu 18.04 (Bionic Beaver)
I had some trouble installing it on a Windows machine and tried out Vagrant. This makes the development environment highly movable and in sync if you have multiple developers working on the project.

How to set up an additional glibc compiler on centOS

I'm using CentOS 7 and it is having glibc version 2.17.
I want to set up additional glibc compiler(same or another version) on this OS.
Please anyone help me in this.
Let us assume you want to install 2.14 along 2.17 on centOS 7 and use it to compile your projects, just follow the steps below :
mkdir ~/glibc_install; cd ~/glibc_install
wget http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
tar zxvf glibc-2.14.tar.gz
cd glibc-2.14
mkdir build
cd build
../configure --prefix=/opt/glibc-2.14
make -j4
sudo make install
export LD_LIBRARY_PATH=/opt/glibc-2.14/lib
PS: Building process takes 2.5 hours on slow AWS.

Install Obsolete Devtoolset Collection for CentOS

At present time Devtoolset-5 (and earlier) cannot be istalled from Software Collection Repository (centos-release-scl) using yum (only Devtoolset-6 and 7 are available). Nevertheless, this collection can be downloaded as a list of rpm-packages. Is it possible to enable such EOL collections for yum, or maybe there is another way to install them correctly?
There was no DTS 5 release. It was skipped to align the DTS version with the GCC major release, once GCC switched to a yearly increasing version number.
DTS versions 3 and 4 are available from the centos-release-scl repository.
While Devtoolset-3 and 4 are located on the Centos mirror site, yum will not be able to find them as they were not included in the repodata on the site. These were probably excluded because they are EOL (end-of-life), and have dependency bugs (Bug 1410152). Try using the older Devtoolset-3 packages here, which do not have the dependency issues:
https://copr.fedorainfracloud.org/coprs/rhscl/devtoolset-3/
If you really want the packages from the centos.org site, I went with wget to download all the RPMs, then recreated a local yum repo. However, you'll see the dependency issues and yum install devtoolset-3 will fail.
$ wget -r -p -e robots=off --directory-prefix="/mnt/local-devtoolset3-repo" --recursive --no-clobber --no-parent http://mirror.centos.org/centos/6/sclo/x86_64/rh/devtoolset-3/
$ sudo yum install createrepo
$ cd /mnt/local-devtoolset3-repo
$ createrepo --database .
You can install the obsolete devtoolset-3 in this way:
sudo yum --obsolete install devtoolset-3

IP Messenger for CentOS 7

I'm Using CentOS 7 and trying to install IP messenger in it but not able to install it. Can anyone help me in installing any IP messenger. Any kind of help would be appreciated. Thanks.
You can also compile iptux from source:
Install dependencies
Ubuntu/Debian
sudo apt-get install git libgtk2.0-dev libgconf2-dev g++ make autoconf libtool automake
Fedora/Cent OS
sudo yum install git gtk2-devel GConf2-devel gcc-c++ make autoconf libtool automake
Clone the directory from github
git clone git://github.com/iptux-src/iptux.git
Compile it and install
cd iptux
./configure
make
sudo make install
Execute the program
iptux
iptux seems quite portable. You could compile it from sources and install it locally like for example this tutorial tells you.
Alternatively, you could manually download a packaged version of iptux in rpm format and install it using the CentOS package manager.
rpm -i iptux-0.5.1-alt1_13.i586.rpm OR rpm -i iptux-0.5.1-alt1_13.x86_64.rpm

Setting up Mesos on CentOS

I tried to install the latest release tarball of Mesos on CentOS 6.4 with no luck. It ended up in all sorts of failures in trying to find jvm & jni bindings. Is there any instructions on how to install Mesos on RHEL or CentOS ?
I couldn't find any instructions around so I thought I would troubleshoot all through my way and thought of documenting it here so it can save your time.
First things first, load your CentOS box with essential build tools to get started
$ sudo yum groupinstall "Development tools"
Get Java and python dependencies installed
$ sudo yum install java-1.6.0-openjdk.x86_64 java-1.6.0-openjdk-devel.x86_64 python python-devel libcurl libcurl-devel
Get the latest Mesos tarball
$ wget http://mirror.nus.edu.sg/apache/mesos/0.13.0/mesos-0.13.0.tar.gz
$ tar -xzvf mesos-0.13.0.tar.gz
$ cd mesos-0.13.0
Before you can build Mesos, you need to set correct JAVA binding paths
$ export JAVA_HOME=/usr
$ export JAVA_LDFLAGS="-L/usr/lib/jvm/java-1.6.0/jre/lib/amd64/server -R/usr/lib/jvm/java-1.6.0/jre/lib/amd64/server -ljvm"
$ export JAVA_CPPFLAGS="-I/usr/lib/jvm/java-1.6.0/include -I/usr/lib/jvm/java-1.6.0/include/linux"
$ export LD_LIBRARY_PATH=/usr/lib/jvm/java-1.6.0/jre/lib/amd64/server:$LD_LIBRARY_PATH
Configure and build it
$ ./configure
$ make
After you have built Mesos, it is advisable that you build and run the tests, this will make sure that what you have installed meets all the requirements
$ make check
If the checks are successful, You are just one step away from installing it in your system installation paths
$ make install
To learn how to use Mesos , go here http://mesos.apache.org/gettingstarted/
For those who prefer installing from RPM's, here is a link to a number of different releases for different Linux flavors: http://mesosphere.io/downloads/ For example, for Centos64:
wget http://downloads.mesosphere.io/master/centos/6/mesos_0.14.2_x86_64.rpm
sudo rpm -Uvh mesos_0.14.2_x86_64.rpm
I also had to set my LD_LIBRARY_PATH, though to a slightly different value. Check yours.
Python bindings can also be downloaded from the first link above:
wget http://downloads.mesosphere.io/master/centos/6/mesos_0.14.2_x86_64.egg
sudo easy_install mesos_0.14.2_x86_64.egg