Tuesday, June 16, 2020

How To install Development Tools , Openssl , CMake On Ubuntu 20.04


------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Development tools are required to install on your system if you have planned to build software. It’ s also useful for building packages on your system. Development tools contain few general useful tools like GCC, g++, make, libc6-dev and dpkg-dev packages.


CMake is a cross-platform, open-source build system. CMake is a family of tools designed to build, test and package software. - https://cmake.org/


OpenSSL is a full-featured software library that contains an open-source implementation of the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols, used for securing information transmitted over computer networks. - https://www.openssl.org/

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Testing Environment: Ubuntu 20.04 LTS  64Bit

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

To install C, C++ Compiler -Development Tools  -  apt update ; apt-get install build-essential -y


Test C and C++ with a sample Program -

apt install ccache -y

nano sum.c

#include<stdio.h>

int main()

{

   int a, b, c;

   printf("Enter two numbers to add, separated by a space: ");

   scanf("%d%d",&a,&b);

   c = a + b;

   printf("The sum of equals %d\n",c);

   return 0;

}

gcc sum.c -o sum && ccache gcc sum.c -o sum && ./sum


------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

installing OpenSSL -

apt update ; apt install -y build-essential net-tools curl git software-properties-common libssl-dev checkinstall zlib1g-dev

openssl version -a

cd /usr/local/src/ ; wget https://www.openssl.org/source/openssl-3.0.0-alpha3.tar.gz

tar -xf openssl-3.0.0-alpha3.tar.gz ; cd openssl-3.0.0-alpha3/

./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib

make && make test && make install

nano /etc/ld.so.conf.d/openssl-3.0.0.conf

/usr/local/ssl/lib

ldconfig -v

mv /usr/bin/c_rehash /usr/bin/c_rehash.BEKUP ; mv /usr/bin/openssl /usr/bin/openssl.BEKUP

nano /etc/environment

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/ssl/bin"

source /etc/environment

echo $PATH ; which openssl ; openssl version -a


------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

installing CMake -

apt update ; apt install -y build-essential net-tools curl git software-properties-common libssl-dev checkinstall zlib1g-dev

wget https://github.com/Kitware/CMake/releases/download/v3.18.0-rc1/cmake-3.18.0-rc1.tar.gz

tar -zxvf cmake-3.18.0-rc1.tar.gz

cd cmake-3.18.0-rc1/

./configure --help

./configure --prefix=/opt/cmake

make && make install

/opt/cmake/bin/cmake -version

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

No comments:

Post a Comment